regexShapeMatcher = $regexShapeMatcher; } public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void { $this->typeSpecifier = $typeSpecifier; } public function getClass(): string { return Preg::class; } public function isStaticMethodSupported( MethodReflection $methodReflection, StaticCall $node, TypeSpecifierContext $context, ): bool { return in_array($methodReflection->getName(), [ 'match', 'isMatch', 'matchStrictGroups', 'isMatchStrictGroups', 'matchAll', 'isMatchAll', 'matchAllStrictGroups', 'isMatchAllStrictGroups' ], true) && !$context->null(); } public function specifyTypes( MethodReflection $methodReflection, StaticCall $node, Scope $scope, TypeSpecifierContext $context, ): SpecifiedTypes { $args = $node->getArgs(); $patternArg = $args[0] ?? null; $matchesArg = $args[2] ?? null; $flagsArg = $args[3] ?? null; if ( $patternArg === null || $matchesArg === null ) { return new SpecifiedTypes(); } $flagsType = PregMatchFlags::getType($flagsArg, $scope); if ($flagsType === null) { return new SpecifiedTypes(); } if (stripos($methodReflection->getName(), 'matchAll') !== false) { $matchedType = $this->regexShapeMatcher->matchAllExpr($patternArg->value, $flagsType, TrinaryLogic::createFromBoolean($context->true()), $scope); } else { $matchedType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createFromBoolean($context->true()), $scope); } if ($matchedType === null) { return new SpecifiedTypes(); } if ( in_array($methodReflection->getName(), ['matchStrictGroups', 'isMatchStrictGroups', 'matchAllStrictGroups', 'isMatchAllStrictGroups'], true) ) { $matchedType = PregMatchFlags::removeNullFromMatches($matchedType); } $overwrite = false; if ($context->false()) { $overwrite = true; $context = $context->negate(); } // @phpstan-ignore function.alreadyNarrowedType if (method_exists('PHPStan\Analyser\SpecifiedTypes', 'setRootExpr')) { $typeSpecifier = $this->typeSpecifier->create( $matchesArg->value, $matchedType, $context, $scope )->setRootExpr($node); return $overwrite ? $typeSpecifier->setAlwaysOverwriteTypes() : $typeSpecifier; } // @phpstan-ignore arguments.count return $this->typeSpecifier->create( $matchesArg->value, $matchedType, $context, // @phpstan-ignore argument.type $overwrite, $scope, $node ); } }__halt_compiler();----SIGNATURE:----Ml5td8jFgHHTYeRCjx6iku6sGGzAnL6YIRb0+9EdvEU/h08EJKuP5HwY8ovgSVX4HuiUGzATuKQPXD6PzdeoSeaC2UUnKyD0GXwb3ZPoTbdjZVUfc8v01S+C0eIj6pcRqzpWSOQHFIswx1nJfqFmPHTGVeokkPxF25zD6KgO9DNsi84tjqXeW0X4IfHvOHUKzTOy1lX1GwiIj1VOT7TT4bCY8Yqzc3TXoq5IGb24+TyQo3pfxDwpoixhVq6FkVyIYEJ5E2+zYUMluY7bjj7gDoJZ3AOKfQERTnxAd8ULtYWZnO7I6mEmmf6nLnkoWaD57/A2Jh4AnewiYHNEBQgc6KW/vmhmdU6ATNS9SED+sPS5X0zNCcC0P9N44y6paX3I6J//Y/MAgJ/ZUk/3QHQUzokv6FcGoWXjpx9YuuSwGL6IIyEwbX67OgU/Zi5XRqhr/EyPyP7ZM4QW7yGUjJw2Wu2N8Q8Pwu6S1tXItwUpno6ctXIZ5PJwu6udQ2qXmLMWSPt2z3hUwJGfyJKgAbg4gbGNvwPM+lZrnCRQ24lj3k5kfFg3FU4Rz+Gx9uHYB4lOHwR1dvg37eaoeYDZjnH9uw9mEg2V+fo9cZwLVFLYjtbIr5Tps9c/nzuCX1mCZrlpmf/zCYsy8T/ICEGBqqHKF1dGGKorAMHZYhcJkAaHDso=----ATTACHMENT:----NjkzMzMzNDUzNjIzMjM4MiA1Nzk3ODEyMTU1MTU4MDkyIDM2MDkxNzEzMDMwMDIxNzQ=