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:----sJ5ew64m0fMq2xFn7CJ0s48q2SGLZmnRAN56wg4qdSfeEQwvtTgPBOlmt4ESg1fNUclfwAB8SkfQuOpDbsF919y6DNdPRvgBQnF0Pl9X66i90MyTSFMMCnclFbjecUwdGgve9wljH2YWFx5U2DNzCrEbFX+GgjLt4fnf1kWIqyTiaR91IRY8fGAFd+EpkKLYOavtMHDLq9h5zJeIPEejpad5llqVYWjWZlEYR0N4zz80tq45He0jweX/UNmenjZPOYlAz8eB1p+9BhZlTunGRI/m9rIuae5clUyLYxeeDDrzRu1DTSl0A/16VklpSULryE+XezGQPiOik2upf3MNjH/aObbP9KeZYXZMd5l5AFLntAuzgc8zvkRE1UQKo+rNEx4O03Ii5N1TwiwT6NrvXfgncsYBE7PkfrgPMKxEwFZa7P25SwrEWu9bTD+vmERKVjI8m/w5E5LWIBTCPrFEZzsbj06PYhdGLtJ5gdHZmiZFKgA/UjmaNPmjiiCtp9JfnFcqfihHxmoVtWwaFiIflUFAGTDHxVxZG8F2LZFFyQ05+kSReoXhcp/GvwGuRf7yikyyy6zIVMRVKKALBPAWJ8Xg01aO1Q7e3oSiBVhxJuOZ1u/d70Zd/FQ5y/pVCJQwsHb/PubPAVkHySRBse5m8UPmC6Z2ObR8aVkluKZgSiA=----ATTACHMENT:----MTY1ODI0MjUyNDI5NDUxNiAxMDk1OTYxMjU2ODI0NjQwIDkzOTc0NTgyODQ1NDEyODM=