diff --git a/composer.json b/composer.json index ff71443..ef04963 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.2.2" + "phpstan/phpstan": "^2.2.3" }, "conflict": { "nette/application": "<2.3.0", diff --git a/src/Type/Nette/StringsMatchAllDynamicReturnTypeExtension.php b/src/Type/Nette/StringsMatchAllDynamicReturnTypeExtension.php index dc50bf1..b985682 100644 --- a/src/Type/Nette/StringsMatchAllDynamicReturnTypeExtension.php +++ b/src/Type/Nette/StringsMatchAllDynamicReturnTypeExtension.php @@ -51,7 +51,7 @@ public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, return $this->regexArrayShapeMatcher->matchAllExpr( $patternArg->value, $this->resolveFlagsType($args, $scope), - TrinaryLogic::createYes(), + TrinaryLogic::createMaybe(), $scope, ); } diff --git a/tests/Type/Nette/data/strings-match.php b/tests/Type/Nette/data/strings-match.php index 68c6b26..87ea3e4 100644 --- a/tests/Type/Nette/data/strings-match.php +++ b/tests/Type/Nette/data/strings-match.php @@ -26,17 +26,17 @@ function (string $s): void { function (string $s): void { $result = Strings::matchAll($s, '/ab(?P\d+)(?Pab)?/', PREG_SET_ORDER); - assertType("list", $result); + assertType("list", $result); }; function (string $s): void { $result = Strings::matchAll($s, '/ab(?P\d+)(?Pab)?/', PREG_PATTERN_ORDER); - assertType("array{0: list, num: list, 1: list, suffix: list<''|'ab'>, 2: list<''|'ab'>}", $result); + assertType("array{0: list, num: list, 1: list, suffix: list<''|'ab'>, 2: list<''|'ab'>}", $result); }; function (string $s): void { $result = Strings::matchAll($s, '/ab(?P\d+)(?Pab)?/', false, 0, false, true); - assertType("array{0: list, num: list, 1: list, suffix: list<''|'ab'>, 2: list<''|'ab'>}", $result); + assertType("array{0: list, num: list, 1: list, suffix: list<''|'ab'>, 2: list<''|'ab'>}", $result); }; function (string $s): void {