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.
1212- Do not cache bypass decision in stream mode
1313- Replace unauthorized chars by underscore ` _ ` in cache key
1414
15+ ### Added
16+ - Add compatibility with PHP 8.2
17+
1518### Fixed
1619- Fix decision duration parsing when it uses milliseconds
1720
Original file line number Diff line number Diff line change 5050 "ext-json" : " *"
5151 },
5252 "require-dev" : {
53- "phpunit/phpunit" : " 8.5.27 " ,
53+ "phpunit/phpunit" : " ^ 8.5.30 || ^9.3 " ,
5454 "ext-curl" : " *"
5555 },
5656 "suggest" : {
Original file line number Diff line number Diff line change @@ -583,7 +583,8 @@ private function configureAdapter(): void
583583 $ this ->adapter = new RedisTagAwareAdapter ((RedisAdapter::createConnection ($ redisDsn )));
584584 } catch (Exception $ e ) {
585585 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 ());
587588 }
588589 break ;
589590
@@ -619,7 +620,7 @@ private static function parseDurationToSeconds(string $duration): int
619620 $ re = '/(-?)(?:(?:(\d+)h)?(\d+)m)?(\d+).\d+(m?)s/m ' ;
620621 preg_match ($ re , $ duration , $ matches );
621622 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 );
623624 }
624625 $ seconds = 0 ;
625626 if (isset ($ matches [2 ])) {
Original file line number Diff line number Diff line change 55use Gregwar \Captcha \CaptchaBuilder as GregwarCaptchaBuilder ;
66
77/**
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+ *
913 * @see https://github.com/crowdsecurity/php-cs-bouncer/issues/62 and
1014 * @see https://github.com/Gregwar/Captcha/pull/101/files
1115 * @SuppressWarnings(PHPMD.ElseExpression)
1216 *
1317 */
1418class CaptchaBuilder extends GregwarCaptchaBuilder
1519{
20+ /**
21+ * @var false|int
22+ */
23+ protected $ background = false ;
1624 /**
1725 * Writes the phrase on the image
1826 */
Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ public static function sortRemediationByPriority(array $remediations): array
5757 }
5858
5959 // Sort by priorities.
60- /** @var callable $compareFunction */
61- $ compareFunction = ' self::comparePriorities ' ;
60+ /** @var callable $compareFunction */
61+ $ compareFunction = self ::class . ' ::comparePriorities ' ;
6262 usort ($ remediationsWithPriorities , $ compareFunction );
6363
6464 return $ remediationsWithPriorities ;
Original file line number Diff line number Diff line change 2323 "jest-playwright-preset" : " ^1.4.3" ,
2424 "jest-runner" : " ^26.6.3" ,
2525 "lodash" : " ^4.17.21" ,
26- "playwright-chromium" : " 1.22.2" ,
27- "soap" : " ^0.42.0" ,
26+ "playwright-chromium" : " ^1.27.1" ,
2827 "ws" : " ^7.4.6"
2928 }
3029}
You can’t perform that action at this time.
0 commit comments