File tree Expand file tree Collapse file tree 4 files changed +12
-17
lines changed Expand file tree Collapse file tree 4 files changed +12
-17
lines changed Original file line number Diff line number Diff line change 65
65
- " highest"
66
66
67
67
symfony :
68
- - " ~4.4.0"
69
68
- " ~5.4.0"
70
69
- " ~6.4.0"
71
70
- " ~7.0.0"
@@ -124,7 +123,6 @@ jobs:
124
123
- " highest"
125
124
126
125
symfony :
127
- - " ~4.4.0"
128
126
- " ~5.4.0"
129
127
- " ~6.4.0"
130
128
- " ~7.0.0"
@@ -183,7 +181,6 @@ jobs:
183
181
- " highest"
184
182
185
183
symfony :
186
- - " ~4.4.0"
187
184
- " ~5.4.0"
188
185
- " ~6.4.0"
189
186
- " ~7.0.0"
Original file line number Diff line number Diff line change 11
11
],
12
12
"require" : {
13
13
"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" ,
19
18
"twig/twig" : " ^2.14 || ^3.4"
20
19
},
21
20
"require-dev" : {
28
27
"psalm/plugin-phpunit" : " ^0.18" ,
29
28
"setono/code-quality-pack" : " ^2.4" ,
30
29
"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" ,
33
32
"webmozart/assert" : " ^1.11"
34
33
},
35
34
"prefer-stable" : true ,
Original file line number Diff line number Diff line change 4
4
errorLevel =" 1"
5
5
xmlns =" https://getpsalm.org/schema/config"
6
6
xsi : schemaLocation =" https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7
+ findUnusedBaselineEntry =" false"
8
+ findUnusedCode =" false"
9
+ findUnusedPsalmSuppress =" true"
10
+ findUnusedVariablesAndParams =" false"
7
11
phpVersion =" 8.1"
8
12
>
9
13
<projectFiles >
Original file line number Diff line number Diff line change 4
4
5
5
namespace Setono \BotDetectionBundle \BotDetector ;
6
6
7
- use Setono \MainRequestTrait \MainRequestTrait ;
8
7
use Symfony \Component \HttpFoundation \Request ;
9
8
use Symfony \Component \HttpFoundation \RequestStack ;
10
9
11
10
final class BotDetector implements BotDetectorInterface
12
11
{
13
- use MainRequestTrait;
14
-
15
12
/** @var array<string, bool> */
16
13
private array $ cache = [];
17
14
@@ -56,11 +53,9 @@ public function isBot(string $userAgent): bool
56
53
57
54
public function isBotRequest (Request $ request = null ): bool
58
55
{
56
+ $ request = $ request ?? $ this ->requestStack ->getMainRequest ();
59
57
if (null === $ request ) {
60
- $ request = $ this ->getMainRequestFromRequestStack ($ this ->requestStack );
61
- if (null === $ request ) {
62
- return false ;
63
- }
58
+ return false ;
64
59
}
65
60
66
61
$ userAgent = $ request ->headers ->get ('user-agent ' );
You can’t perform that action at this time.
0 commit comments