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:----Y3kEuXdoOQzqqAiRGW7ml8pFL5xNTkbFbITHIEsccrUMwErQEKGRBqRnKTZd6S5wXFu9dTcerTgFKnWW9zhWQUllmv1hrQo8uMgKrliftOj3SfZABFocQSk7fuHTFAsZHXPGrhmrrKbTIeQclQx8suWuEZSQz4ugKDcn4LKDS/Vdt5IeIfORI38Sfo78bw9DYSr4kva5Esvnfar2ogemwmJE1ScW/x7b35lCv54pOB4eDva+lIHHEAy/nPeKHvnIbmASXS49JTFnVu40+eMjJsznREXyRsHhDUW8aKb49ayM72cqvuP+gA13+0+gtNfnrbIml1pi1MK8pm5GrroIrn8WyipYDoQZCfF8aScM/ThpI7E79558TIyiFfjGkhMczVHKCs9Tp1nLwT23KeYgRsYRukVlCgshvKMHKGvGjio/oR8045rXSbtWwQXLOb88ZDTg1IpvMmJAMer6qtVU1xCdQ4MrUetRyxHTeIhyf/M3caRGY0WCa39cf6RguSl0OS4G2JUvobVl8hDBq3Rtob1LfhjTxLk4byJyj/VdbhzZAgjSXTkDkEwOFbGDZYRcjoIh3vcw6bvwUmKriF6IzhenwhKyqionyLeCJDz/eXz7DFi/POyE2TrPf0eeoPnmvTXkK+Uy8oykqEUNnhmVoxQ0DQHFMsSRRiv5H2/hbZ0=----ATTACHMENT:----MTY5MDM4NDE5NTI4NTY5NCA3NTU0MjA3MjI2MjM5NTMxIDExMjkwNDczMTkwMjQyMDM=