File tree Expand file tree Collapse file tree 6 files changed +19
-8
lines changed Expand file tree Collapse file tree 6 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
12
12
- Do not cache bypass decision in stream mode
13
13
- Replace unauthorized chars by underscore ` _ ` in cache key
14
14
15
+ ### Added
16
+ - Add compatibility with PHP 8.2
17
+
15
18
### Fixed
16
19
- Fix decision duration parsing when it uses milliseconds
17
20
Original file line number Diff line number Diff line change 50
50
"ext-json" : " *"
51
51
},
52
52
"require-dev" : {
53
- "phpunit/phpunit" : " 8.5.27 " ,
53
+ "phpunit/phpunit" : " ^ 8.5.30 || ^9.3 " ,
54
54
"ext-curl" : " *"
55
55
},
56
56
"suggest" : {
Original file line number Diff line number Diff line change @@ -583,7 +583,8 @@ private function configureAdapter(): void
583
583
$ this ->adapter = new RedisTagAwareAdapter ((RedisAdapter::createConnection ($ redisDsn )));
584
584
} catch (Exception $ e ) {
585
585
throw new BouncerException ('Error when connecting to Redis. ' .
586
- ' Please fix the Redis DSN or select another cache technology. ' );
586
+ ' Please fix the Redis DSN or select another cache technology. ' .
587
+ ' Initial error was: ' . $ e ->getMessage ());
587
588
}
588
589
break ;
589
590
@@ -619,7 +620,7 @@ private static function parseDurationToSeconds(string $duration): int
619
620
$ re = '/(-?)(?:(?:(\d+)h)?(\d+)m)?(\d+).\d+(m?)s/m ' ;
620
621
preg_match ($ re , $ duration , $ matches );
621
622
if (!\count ($ matches )) {
622
- throw new BouncerException (" Unable to parse the following duration: $ { $ duration} . " );
623
+ throw new BouncerException (' Unable to parse the following duration: ' . $ duration );
623
624
}
624
625
$ seconds = 0 ;
625
626
if (isset ($ matches [2 ])) {
Original file line number Diff line number Diff line change 5
5
use Gregwar \Captcha \CaptchaBuilder as GregwarCaptchaBuilder ;
6
6
7
7
/**
8
- * Override to fix "implicit conversion error on PHP 8.1"
8
+ * Override to :
9
+ * - fix "implicit conversion error on PHP 8.1"
10
+ * - fix "creation of dynamic property $background error on PHP 8.2"
11
+ *
12
+ *
9
13
* @see https://github.com/crowdsecurity/php-cs-bouncer/issues/62 and
10
14
* @see https://github.com/Gregwar/Captcha/pull/101/files
11
15
* @SuppressWarnings(PHPMD.ElseExpression)
12
16
*
13
17
*/
14
18
class CaptchaBuilder extends GregwarCaptchaBuilder
15
19
{
20
+ /**
21
+ * @var false|int
22
+ */
23
+ protected $ background = false ;
16
24
/**
17
25
* Writes the phrase on the image
18
26
*/
Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ public static function sortRemediationByPriority(array $remediations): array
57
57
}
58
58
59
59
// Sort by priorities.
60
- /** @var callable $compareFunction */
61
- $ compareFunction = ' self::comparePriorities ' ;
60
+ /** @var callable $compareFunction */
61
+ $ compareFunction = self ::class . ' ::comparePriorities ' ;
62
62
usort ($ remediationsWithPriorities , $ compareFunction );
63
63
64
64
return $ remediationsWithPriorities ;
Original file line number Diff line number Diff line change 23
23
"jest-playwright-preset" : " ^1.4.3" ,
24
24
"jest-runner" : " ^26.6.3" ,
25
25
"lodash" : " ^4.17.21" ,
26
- "playwright-chromium" : " 1.22.2" ,
27
- "soap" : " ^0.42.0" ,
26
+ "playwright-chromium" : " ^1.27.1" ,
28
27
"ws" : " ^7.4.6"
29
28
}
30
29
}
You can’t perform that action at this time.
0 commit comments