Skip to content

Commit 0acb820

Browse files
committed
Remove support for SF4
1 parent 9f188b0 commit 0acb820

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
- "highest"
6666

6767
symfony:
68-
- "~4.4.0"
6968
- "~5.4.0"
7069
- "~6.4.0"
7170
- "~7.0.0"
@@ -124,7 +123,6 @@ jobs:
124123
- "highest"
125124

126125
symfony:
127-
- "~4.4.0"
128126
- "~5.4.0"
129127
- "~6.4.0"
130128
- "~7.0.0"
@@ -183,7 +181,6 @@ jobs:
183181
- "highest"
184182

185183
symfony:
186-
- "~4.4.0"
187184
- "~5.4.0"
188185
- "~6.4.0"
189186
- "~7.0.0"

composer.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
],
1212
"require": {
1313
"php": ">=7.4",
14-
"setono/symfony-main-request-trait": "^1.0",
15-
"symfony/config": "^4.4 || ^5.4 || ^6.4 || ^7.0",
16-
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.4 || ^7.0",
17-
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.4 || ^7.0",
18-
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.4 || ^7.0",
14+
"symfony/config": "^5.4 || ^6.4 || ^7.0",
15+
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
16+
"symfony/http-foundation": "^5.4 || ^6.4 || ^7.0",
17+
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
1918
"twig/twig": "^2.14 || ^3.4"
2019
},
2120
"require-dev": {
@@ -28,8 +27,8 @@
2827
"psalm/plugin-phpunit": "^0.18",
2928
"setono/code-quality-pack": "^2.4",
3029
"shipmonk/composer-dependency-analyser": "^1.8",
31-
"symfony/console": "^4.4 || ^5.4 || ^6.4 || ^7.0",
32-
"symfony/yaml": "^4.4 || ^5.4 || ^6.4 || ^7.0",
30+
"symfony/console": "^5.4 || ^6.4 || ^7.0",
31+
"symfony/yaml": "^5.4 || ^6.4 || ^7.0",
3332
"webmozart/assert": "^1.11"
3433
},
3534
"prefer-stable": true,

psalm.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
errorLevel="1"
55
xmlns="https://getpsalm.org/schema/config"
66
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7+
findUnusedBaselineEntry="false"
8+
findUnusedCode="false"
9+
findUnusedPsalmSuppress="true"
10+
findUnusedVariablesAndParams="false"
711
phpVersion="8.1"
812
>
913
<projectFiles>

src/BotDetector/BotDetector.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44

55
namespace Setono\BotDetectionBundle\BotDetector;
66

7-
use Setono\MainRequestTrait\MainRequestTrait;
87
use Symfony\Component\HttpFoundation\Request;
98
use Symfony\Component\HttpFoundation\RequestStack;
109

1110
final class BotDetector implements BotDetectorInterface
1211
{
13-
use MainRequestTrait;
14-
1512
/** @var array<string, bool> */
1613
private array $cache = [];
1714

@@ -56,11 +53,9 @@ public function isBot(string $userAgent): bool
5653

5754
public function isBotRequest(Request $request = null): bool
5855
{
56+
$request = $request ?? $this->requestStack->getMainRequest();
5957
if (null === $request) {
60-
$request = $this->getMainRequestFromRequestStack($this->requestStack);
61-
if (null === $request) {
62-
return false;
63-
}
58+
return false;
6459
}
6560

6661
$userAgent = $request->headers->get('user-agent');

0 commit comments

Comments
 (0)