diff --git a/src/Analyser/ArgumentsHandler.php b/src/Analyser/ArgumentsHandler.php index 4e84ba02c59..9cba65d625d 100644 --- a/src/Analyser/ArgumentsHandler.php +++ b/src/Analyser/ArgumentsHandler.php @@ -382,14 +382,8 @@ public function processArgs( if ( $closureBindScopeFactory === null && $parameter instanceof ExtendedParameterReflection - && !$arg->value->static ) { - $closureThisType = $this->resolveClosureThisType($callLike, $calleeReflection, $parameter, $scopeToPass); - if ($closureThisType !== null) { - $restoreThisScope = $scopeToPass; - $scopeToPass = $scopeToPass->assignVariable('this', $closureThisType, new ObjectWithoutClassType(), TrinaryLogic::createYes()) - ->withClosureBindScopeClasses($closureThisType->getObjectClassNames()); - } + [$scopeToPass, $restoreThisScope] = $this->applyClosureThisAndScope($scopeToPass, $callLike, $calleeReflection, $parameter, $arg->value->static); } if ($parameter !== null) { @@ -531,13 +525,8 @@ public function processArgs( if ( $closureBindScopeFactory === null && $parameter instanceof ExtendedParameterReflection - && !$arg->value->static ) { - $closureThisType = $this->resolveClosureThisType($callLike, $calleeReflection, $parameter, $scopeToPass); - if ($closureThisType !== null) { - $scopeToPass = $scopeToPass->assignVariable('this', $closureThisType, new ObjectWithoutClassType(), TrinaryLogic::createYes()) - ->withClosureBindScopeClasses($closureThisType->getObjectClassNames()); - } + [$scopeToPass] = $this->applyClosureThisAndScope($scopeToPass, $callLike, $calleeReflection, $parameter, $arg->value->static); } if ($parameter !== null) { @@ -1230,7 +1219,7 @@ private function getParameterOutExtensionsType(CallLike $callLike, $calleeReflec /** * @param FunctionReflection|MethodReflection|null $calleeReflection */ - private function resolveClosureThisType( + private function resolveClosureThisTypeFromExtensions( ?CallLike $call, $calleeReflection, ParameterReflection $parameter, @@ -1269,11 +1258,52 @@ private function resolveClosureThisType( } } - if ($parameter instanceof ExtendedParameterReflection) { - return $parameter->getClosureThisType(); + return null; + } + + /** + * A closure-this type from an extension also binds the closure scope; + * from @param-closure-this it binds only $this, the scope comes from @param-closure-scope. + * + * @param FunctionReflection|MethodReflection|null $calleeReflection + * @return array{MutatingScope, MutatingScope|null} + */ + private function applyClosureThisAndScope( + MutatingScope $scopeToPass, + ?CallLike $call, + $calleeReflection, + ParameterReflection $parameter, + bool $isStatic, + ): array + { + if (!$parameter instanceof ExtendedParameterReflection) { + return [$scopeToPass, null]; } - return null; + $closureThisType = null; + $closureScopeType = $parameter->getClosureScopeType(); + if (!$isStatic) { + $closureThisType = $this->resolveClosureThisTypeFromExtensions($call, $calleeReflection, $parameter, $scopeToPass); + if ($closureThisType !== null) { + $closureScopeType ??= $closureThisType; + } else { + $closureThisType = $parameter->getClosureThisType(); + } + } + + if ($closureThisType === null && $closureScopeType === null) { + return [$scopeToPass, null]; + } + + $restoreThisScope = $scopeToPass; + if ($closureThisType !== null) { + $scopeToPass = $scopeToPass->assignVariable('this', $closureThisType, new ObjectWithoutClassType(), TrinaryLogic::createYes()); + } + if ($closureScopeType !== null) { + $scopeToPass = $scopeToPass->withClosureBindScopeClasses($closureScopeType->getObjectClassNames()); + } + + return [$scopeToPass, $restoreThisScope]; } /** diff --git a/src/Analyser/MutatingScope.php b/src/Analyser/MutatingScope.php index 85867200a20..8c5463a9044 100644 --- a/src/Analyser/MutatingScope.php +++ b/src/Analyser/MutatingScope.php @@ -1898,6 +1898,7 @@ public function enterTrait(ClassReflection $traitReflection): self * @param array $phpDocClosureThisTypeParameters * @param array $phpDocPureUnlessCallableIsImpureParameters * @param array $phpDocPureUnlessParameterPassedParameters + * @param array $phpDocClosureScopeTypeParameters */ public function enterClassMethod( Node\Stmt\ClassMethod $classMethod, @@ -1921,6 +1922,7 @@ public function enterClassMethod( ?ResolvedPhpDocBlock $resolvedPhpDocBlock = null, array $phpDocPureUnlessCallableIsImpureParameters = [], array $phpDocPureUnlessParameterPassedParameters = [], + array $phpDocClosureScopeTypeParameters = [], ): self { if (!$this->isInClass()) { @@ -1958,6 +1960,7 @@ public function enterClassMethod( $this->services->attributeReflectionFactory->fromAttrGroups($classMethod->attrGroups, InitializerExprContext::fromStubParameter($this->getClassReflection()->getName(), $this->getFile(), $classMethod)), $phpDocPureUnlessCallableIsImpureParameters, $phpDocPureUnlessParameterPassedParameters, + array_map(fn (Type $type): Type => $this->transformStaticType(TemplateTypeHelper::toArgument($type)), $phpDocClosureScopeTypeParameters), ), !$classMethod->isStatic(), ); @@ -2128,6 +2131,7 @@ private function getParameterAttributes(ClassMethod|Function_|PropertyHook $func * @param array $phpDocClosureThisTypeParameters * @param array $pureUnlessCallableIsImpureParameters * @param array $pureUnlessParameterPassedParameters + * @param array $phpDocClosureScopeTypeParameters */ public function enterFunction( Node\Stmt\Function_ $function, @@ -2147,6 +2151,7 @@ public function enterFunction( array $phpDocClosureThisTypeParameters = [], array $pureUnlessCallableIsImpureParameters = [], array $pureUnlessParameterPassedParameters = [], + array $phpDocClosureScopeTypeParameters = [], ): self { return $this->enterFunctionLike( @@ -2174,6 +2179,7 @@ public function enterFunction( $this->services->attributeReflectionFactory->fromAttrGroups($function->attrGroups, InitializerExprContext::fromStubParameter(null, $this->getFile(), $function)), $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters, + $phpDocClosureScopeTypeParameters, ), false, ); diff --git a/src/Analyser/PhpDocsResolver.php b/src/Analyser/PhpDocsResolver.php index 407aeba91f6..c1c40a41978 100644 --- a/src/Analyser/PhpDocsResolver.php +++ b/src/Analyser/PhpDocsResolver.php @@ -42,7 +42,7 @@ public function __construct( } /** - * @return array{TemplateTypeMap, array, array, array, ?Type, ?Type, ?string, bool, bool, bool, bool|null, bool, bool, string|null, Assertions, ?Type, array, array<(string|int), VarTag>, bool, ?ResolvedPhpDocBlock, array, array} + * @return array{TemplateTypeMap, array, array, array, ?Type, ?Type, ?string, bool, bool, bool, bool|null, bool, bool, string|null, Assertions, ?Type, array, array<(string|int), VarTag>, bool, ?ResolvedPhpDocBlock, array, array, array} */ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $node): array { @@ -50,6 +50,7 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n $phpDocParameterTypes = []; $phpDocImmediatelyInvokedCallableParameters = []; $phpDocClosureThisTypeParameters = []; + $phpDocClosureScopeTypeParameters = []; $phpDocReturnType = null; $phpDocThrowType = null; $deprecatedDescription = null; @@ -184,6 +185,16 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n } $phpDocClosureThisTypeParameters[$paramName] = $paramClosureThisType; } + foreach ($resolvedPhpDoc->getParamClosureScopeTags() as $paramName => $paramClosureScopeTag) { + if (array_key_exists($paramName, $phpDocClosureScopeTypeParameters)) { + continue; + } + $paramClosureScopeType = $paramClosureScopeTag->getType(); + if ($scope->isInClass()) { + $paramClosureScopeType = $this->transformStaticType($scope->getClassReflection(), $paramClosureScopeType); + } + $phpDocClosureScopeTypeParameters[$paramName] = $paramClosureScopeType; + } foreach ($resolvedPhpDoc->getParamOutTags() as $paramName => $paramOutTag) { $phpDocParameterOutTypes[$paramName] = $paramOutTag->getType(); @@ -236,7 +247,7 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n } } - return [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, $isReadOnly, $docComment, $asserts, $selfOutType, $phpDocParameterOutTypes, $varTags, $isAllowedPrivateMutation, $resolvedPhpDoc, $phpDocPureUnlessCallableIsImpureParameters, $phpDocPureUnlessParameterPassedParameters]; + return [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, $isReadOnly, $docComment, $asserts, $selfOutType, $phpDocParameterOutTypes, $varTags, $isAllowedPrivateMutation, $resolvedPhpDoc, $phpDocPureUnlessCallableIsImpureParameters, $phpDocPureUnlessParameterPassedParameters, $phpDocClosureScopeTypeParameters]; } private function getPhpDocReturnType(ResolvedPhpDocBlock $resolvedPhpDoc, Type $nativeReturnType): ?Type diff --git a/src/Analyser/StmtHandler/ClassMethodHandler.php b/src/Analyser/StmtHandler/ClassMethodHandler.php index 9858ce6a213..2e264813b22 100644 --- a/src/Analyser/StmtHandler/ClassMethodHandler.php +++ b/src/Analyser/StmtHandler/ClassMethodHandler.php @@ -76,7 +76,7 @@ public function processStmt( { $dependencies = []; $dependencies[] = $this->attributesHandler->processAttributeGroups($nodeScopeResolver, $stmt, $stmt->attrGroups, $scope, $storage, $nodeCallback); - [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, $isReadOnly, $phpDocComment, $asserts, $selfOutType, $phpDocParameterOutTypes, , , , $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters] = $this->phpDocsResolver->getPhpDocs($scope, $stmt); + [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, $isReadOnly, $phpDocComment, $asserts, $selfOutType, $phpDocParameterOutTypes, , , , $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters, $phpDocClosureScopeTypeParameters] = $this->phpDocsResolver->getPhpDocs($scope, $stmt); $dependencies[] = $this->parametersProcessor->processParams($nodeScopeResolver, $stmt, $stmt->params, $scope, $storage, $nodeCallback); @@ -113,6 +113,7 @@ public function processStmt( null, $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters, + $phpDocClosureScopeTypeParameters, ); if (!$scope->isInClass()) { diff --git a/src/Analyser/StmtHandler/FunctionHandler.php b/src/Analyser/StmtHandler/FunctionHandler.php index 1c1611ee03f..e1e8114d290 100644 --- a/src/Analyser/StmtHandler/FunctionHandler.php +++ b/src/Analyser/StmtHandler/FunctionHandler.php @@ -67,7 +67,7 @@ public function processStmt( { $dependencies = []; $dependencies[] = $this->attributesHandler->processAttributeGroups($nodeScopeResolver, $stmt, $stmt->attrGroups, $scope, $storage, $nodeCallback); - [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, , $isPure, $acceptsNamedArguments, , $phpDocComment, $asserts,, $phpDocParameterOutTypes, , , , $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters] = $this->phpDocsResolver->getPhpDocs($scope, $stmt); + [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, , $isPure, $acceptsNamedArguments, , $phpDocComment, $asserts,, $phpDocParameterOutTypes, , , , $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters, $phpDocClosureScopeTypeParameters] = $this->phpDocsResolver->getPhpDocs($scope, $stmt); $dependencies[] = $this->parametersProcessor->processParams($nodeScopeResolver, $stmt, $stmt->params, $scope, $storage, $nodeCallback); @@ -97,6 +97,7 @@ public function processStmt( $phpDocClosureThisTypeParameters, $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters, + $phpDocClosureScopeTypeParameters, ); $functionReflection = $functionScope->getFunction(); if (!$functionReflection instanceof PhpFunctionFromParserNodeReflection) { diff --git a/src/Dependency/DependencyTypes.php b/src/Dependency/DependencyTypes.php index d9ed004edef..0e1267d8684 100644 --- a/src/Dependency/DependencyTypes.php +++ b/src/Dependency/DependencyTypes.php @@ -51,6 +51,7 @@ public static function ofCalledParameters(array $parameters): array $types[] = $parameter->getOutType(); $types[] = $parameter->getClosureThisType(); + $types[] = $parameter->getClosureScopeType(); } return $types; @@ -141,6 +142,7 @@ public static function ofDeclaration(PhpFunctionFromParserNodeReflection $reflec $types[] = $parameter->getPhpDocType(); $types[] = $parameter->getOutType(); $types[] = $parameter->getClosureThisType(); + $types[] = $parameter->getClosureScopeType(); } $types[] = $reflection->getNativeReturnType(); $types[] = $reflection->getPhpDocReturnType(); diff --git a/src/PhpDoc/PhpDocNodeResolver.php b/src/PhpDoc/PhpDocNodeResolver.php index 004444161d0..fed1214ebc1 100644 --- a/src/PhpDoc/PhpDocNodeResolver.php +++ b/src/PhpDoc/PhpDocNodeResolver.php @@ -12,6 +12,7 @@ use PHPStan\PhpDoc\Tag\MethodTag; use PHPStan\PhpDoc\Tag\MethodTagParameter; use PHPStan\PhpDoc\Tag\MixinTag; +use PHPStan\PhpDoc\Tag\ParamClosureScopeTag; use PHPStan\PhpDoc\Tag\ParamClosureThisTag; use PHPStan\PhpDoc\Tag\ParamOutTag; use PHPStan\PhpDoc\Tag\ParamTag; @@ -440,6 +441,27 @@ public function resolveParamClosureThisTags(PhpDocNode $phpDocNode, NameScope $n return $closureThisTypes; } + /** + * @return array + */ + public function resolveParamClosureScopeTags(PhpDocNode $phpDocNode, NameScope $nameScope): array + { + $closureScopeTypes = []; + foreach (['@param-closure-scope', '@phpstan-param-closure-scope'] as $tagName) { + foreach ($phpDocNode->getParamClosureScopeTagValues($tagName) as $tagValue) { + $parameterName = substr($tagValue->parameterName, 1); + $closureScopeTypes[$parameterName] = new ParamClosureScopeTag( + TypeCombinator::intersect( + $this->typeNodeResolver->resolve($tagValue->type, $nameScope), + new ObjectWithoutClassType(), + ), + ); + } + } + + return $closureScopeTypes; + } + public function resolveReturnTag(PhpDocNode $phpDocNode, NameScope $nameScope): ?ReturnTag { $resolved = null; diff --git a/src/PhpDoc/ResolvedPhpDocBlock.php b/src/PhpDoc/ResolvedPhpDocBlock.php index e1026770cef..976a9822f73 100644 --- a/src/PhpDoc/ResolvedPhpDocBlock.php +++ b/src/PhpDoc/ResolvedPhpDocBlock.php @@ -9,6 +9,7 @@ use PHPStan\PhpDoc\Tag\ImplementsTag; use PHPStan\PhpDoc\Tag\MethodTag; use PHPStan\PhpDoc\Tag\MixinTag; +use PHPStan\PhpDoc\Tag\ParamClosureScopeTag; use PHPStan\PhpDoc\Tag\ParamClosureThisTag; use PHPStan\PhpDoc\Tag\ParamOutTag; use PHPStan\PhpDoc\Tag\ParamTag; @@ -108,6 +109,9 @@ final class ResolvedPhpDocBlock /** @var array|false */ private array|false $paramClosureThisTags = false; + /** @var array|false */ + private array|false $paramClosureScopeTags = false; + private ReturnTag|false|null $returnTag = false; private ThrowsTag|false|null $throwsTag = false; @@ -232,6 +236,7 @@ public static function createEmpty(): self $self->paramsPureUnlessCallableIsImpure = []; $self->paramsPureUnlessParameterPassed = []; $self->paramClosureThisTags = []; + $self->paramClosureScopeTags = []; $self->returnTag = null; $self->throwsTag = null; $self->mixinTags = []; @@ -290,6 +295,7 @@ public function merge(ResolvedPhpDocBlock $parent, InheritedPhpDocParameterMappi $result->paramsPureUnlessCallableIsImpure = self::mergeParamsPureUnlessCallableIsImpure($this->getParamsPureUnlessCallableIsImpure(), $parent, $parameterMapping); $result->paramsPureUnlessParameterPassed = self::mergeParamsPureUnlessParameterPassed($this->getParamsPureUnlessParameterPassed(), $parent, $parameterMapping); $result->paramClosureThisTags = self::mergeParamClosureThisTags($this->getParamClosureThisTags(), $parent, $parameterMapping, $parentClass); + $result->paramClosureScopeTags = self::mergeParamClosureScopeTags($this->getParamClosureScopeTags(), $parent, $parameterMapping, $parentClass); $result->returnTag = self::mergeReturnTags($this->getReturnTag(), $declaringClass, $parent, $parameterMapping, $parentClass); $result->throwsTag = self::mergeThrowsTags($this->getThrowsTag(), $parent, $parameterMapping); $result->mixinTags = $this->getMixinTags(); @@ -376,6 +382,17 @@ public function changeParameterNamesByMapping(array $parameterNameMapping): self $newParamClosureThisTags[$parameterNameMapping[$key]] = $paramClosureThisTag->withType($transformedType); } + $paramClosureScopeTags = $this->getParamClosureScopeTags(); + $newParamClosureScopeTags = []; + foreach ($paramClosureScopeTags as $key => $paramClosureScopeTag) { + if (!array_key_exists($key, $parameterNameMapping)) { + continue; + } + + $transformedType = TypeTraverser::map($paramClosureScopeTag->getType(), $mapParameterCb); + $newParamClosureScopeTags[$parameterNameMapping[$key]] = $paramClosureScopeTag->withType($transformedType); + } + $returnTag = $this->getReturnTag(); if ($returnTag !== null) { $transformedType = TypeTraverser::map($returnTag->getType(), $mapParameterCb); @@ -413,6 +430,7 @@ public function changeParameterNamesByMapping(array $parameterNameMapping): self $self->paramOutTags = $newParamOutTags; $self->paramsImmediatelyInvokedCallable = $newParamsImmediatelyInvokedCallable; $self->paramClosureThisTags = $newParamClosureThisTags; + $self->paramClosureScopeTags = $newParamClosureScopeTags; $self->returnTag = $returnTag; $self->throwsTag = $this->throwsTag; $self->mixinTags = $this->mixinTags; @@ -640,6 +658,21 @@ public function getParamClosureThisTags(): array return $this->paramClosureThisTags; } + /** + * @return array + */ + public function getParamClosureScopeTags(): array + { + if ($this->paramClosureScopeTags === false) { + $this->paramClosureScopeTags = $this->phpDocNodeResolver->resolveParamClosureScopeTags( + $this->phpDocNode, + $this->getNameScope(), + ); + } + + return $this->paramClosureScopeTags; + } + public function getReturnTag(): ?ReturnTag { if (is_bool($this->returnTag)) { @@ -1223,6 +1256,40 @@ private static function mergeOneParentParamClosureThisTag(array $paramsClosureTh return $paramsClosureThisTags; } + /** + * @param array $paramsClosureScopeTags + * @return array + */ + private static function mergeParamClosureScopeTags(array $paramsClosureScopeTags, self $parent, InheritedPhpDocParameterMapping $parameterMapping, ClassReflection $parentClass): array + { + return self::mergeOneParentParamClosureScopeTag($paramsClosureScopeTags, $parent, $parameterMapping, $parentClass); + } + + /** + * @param array $paramsClosureScopeTags + * @return array + */ + private static function mergeOneParentParamClosureScopeTag(array $paramsClosureScopeTags, self $parent, InheritedPhpDocParameterMapping $parameterMapping, ClassReflection $parentClass): array + { + $parentClosureScopeTags = $parameterMapping->transformArrayKeysWithParameterNameMapping($parent->getParamClosureScopeTags()); + + foreach ($parentClosureScopeTags as $name => $parentParamClosureScopeTag) { + if (array_key_exists($name, $paramsClosureScopeTags)) { + continue; + } + + $paramsClosureScopeTags[$name] = self::resolveTemplateTypeInTag( + $parentParamClosureScopeTag->withType( + $parameterMapping->transformConditionalReturnTypeWithParameterNameMapping($parentParamClosureScopeTag->getType()), + ), + $parentClass, + TemplateTypeVariance::createContravariant(), + ); + } + + return $paramsClosureScopeTags; + } + private static function mergePureTags(?bool $isPure, self $parent): ?bool { if ($isPure !== null) { diff --git a/src/PhpDoc/Tag/ParamClosureScopeTag.php b/src/PhpDoc/Tag/ParamClosureScopeTag.php new file mode 100644 index 00000000000..95cc612cf94 --- /dev/null +++ b/src/PhpDoc/Tag/ParamClosureScopeTag.php @@ -0,0 +1,29 @@ +type; + } + + public function withType(Type $type): self + { + return new self($type); + } + +} diff --git a/src/Reflection/Annotations/AnnotationsMethodParameterReflection.php b/src/Reflection/Annotations/AnnotationsMethodParameterReflection.php index 7becf4b758a..ef35dd12ecf 100644 --- a/src/Reflection/Annotations/AnnotationsMethodParameterReflection.php +++ b/src/Reflection/Annotations/AnnotationsMethodParameterReflection.php @@ -62,6 +62,11 @@ public function getClosureThisType(): ?Type return null; } + public function getClosureScopeType(): ?Type + { + return null; + } + public function passedByReference(): PassedByReference { return $this->passedByReference; diff --git a/src/Reflection/BetterReflection/BetterReflectionProvider.php b/src/Reflection/BetterReflection/BetterReflectionProvider.php index 391e293a2ec..007fa32ba81 100644 --- a/src/Reflection/BetterReflection/BetterReflectionProvider.php +++ b/src/Reflection/BetterReflection/BetterReflectionProvider.php @@ -31,6 +31,7 @@ use PHPStan\Php\PhpVersion; use PHPStan\PhpDoc\ResolvedPhpDocBlock; use PHPStan\PhpDoc\StubPhpDocProvider; +use PHPStan\PhpDoc\Tag\ParamClosureScopeTag; use PHPStan\PhpDoc\Tag\ParamClosureThisTag; use PHPStan\PhpDoc\Tag\ParamOutTag; use PHPStan\Reflection\Assertions; @@ -304,6 +305,7 @@ private function getCustomFunction(string $functionName): PhpFunctionReflection $phpDocParameterOutTags = []; $phpDocParameterImmediatelyInvokedCallable = []; $phpDocParameterClosureThisTypeTags = []; + $phpDocParameterClosureScopeTypeTags = []; $phpDocParameterPureUnlessCallableIsImpure = []; $phpDocParameterPureUnlessParameterPassed = []; @@ -332,6 +334,7 @@ private function getCustomFunction(string $functionName): PhpFunctionReflection $phpDocParameterOutTags = $resolvedPhpDoc->getParamOutTags(); $phpDocParameterImmediatelyInvokedCallable = $resolvedPhpDoc->getParamsImmediatelyInvokedCallable(); $phpDocParameterClosureThisTypeTags = $resolvedPhpDoc->getParamClosureThisTags(); + $phpDocParameterClosureScopeTypeTags = $resolvedPhpDoc->getParamClosureScopeTags(); $phpDocParameterPureUnlessCallableIsImpure = $resolvedPhpDoc->getParamsPureUnlessCallableIsImpure(); $phpDocParameterPureUnlessParameterPassed = $resolvedPhpDoc->getParamsPureUnlessParameterPassed(); } @@ -375,6 +378,7 @@ private function getCustomFunction(string $functionName): PhpFunctionReflection $this->attributeReflectionFactory->fromNativeReflection($reflectionFunction->getAttributes(), InitializerExprContext::fromFunction($reflectionFunction->getName(), $reflectionFunction->getFileName() !== false ? $reflectionFunction->getFileName() : null)), $phpDocParameterPureUnlessCallableIsImpure, $phpDocParameterPureUnlessParameterPassed, + array_map(static fn (ParamClosureScopeTag $tag): Type => $tag->getType(), $phpDocParameterClosureScopeTypeTags), ); } diff --git a/src/Reflection/ExtendedParameterReflection.php b/src/Reflection/ExtendedParameterReflection.php index f25d065ff2b..830346dc6f4 100644 --- a/src/Reflection/ExtendedParameterReflection.php +++ b/src/Reflection/ExtendedParameterReflection.php @@ -26,6 +26,8 @@ public function isImmediatelyInvokedCallable(): TrinaryLogic; public function getClosureThisType(): ?Type; + public function getClosureScopeType(): ?Type; + /** * @return list */ diff --git a/src/Reflection/FunctionReflectionFactory.php b/src/Reflection/FunctionReflectionFactory.php index 3ff2adcbbbe..327936ff687 100644 --- a/src/Reflection/FunctionReflectionFactory.php +++ b/src/Reflection/FunctionReflectionFactory.php @@ -18,6 +18,7 @@ interface FunctionReflectionFactory * @param list $attributes * @param array $phpDocParameterPureUnlessCallableIsImpure * @param array $phpDocParameterPureUnlessParameterPassed + * @param array $phpDocParameterClosureScopeTypes */ public function create( ReflectionFunction $reflection, @@ -39,6 +40,7 @@ public function create( array $attributes, array $phpDocParameterPureUnlessCallableIsImpure, array $phpDocParameterPureUnlessParameterPassed, + array $phpDocParameterClosureScopeTypes = [], ): PhpFunctionReflection; } diff --git a/src/Reflection/Native/ExtendedNativeParameterReflection.php b/src/Reflection/Native/ExtendedNativeParameterReflection.php index f28e9e45aca..02377a769d1 100644 --- a/src/Reflection/Native/ExtendedNativeParameterReflection.php +++ b/src/Reflection/Native/ExtendedNativeParameterReflection.php @@ -35,6 +35,7 @@ public function __construct( private ?ParameterAllowedConstants $allowedConstants, private TrinaryLogic $pureUnlessCallableIsImpureParameter, private TrinaryLogic $pureUnlessParameterPassedParameter, + private ?Type $closureScopeType = null, ) { } @@ -99,6 +100,11 @@ public function getClosureThisType(): ?Type return $this->closureThisType; } + public function getClosureScopeType(): ?Type + { + return $this->closureScopeType; + } + public function getAttributes(): array { return $this->attributes; diff --git a/src/Reflection/ParametersAcceptorSelector.php b/src/Reflection/ParametersAcceptorSelector.php index 22c137ede82..6b7a10ce540 100644 --- a/src/Reflection/ParametersAcceptorSelector.php +++ b/src/Reflection/ParametersAcceptorSelector.php @@ -612,6 +612,14 @@ public static function hasAcceptorTemplateOrLateResolvableParameterType(Paramete return true; } + if ( + $parameter instanceof ExtendedParameterReflection + && $parameter->getClosureScopeType() !== null + && $parameter->getClosureScopeType()->hasTemplateOrLateResolvableType() + ) { + return true; + } + if (!$parameter->getType()->hasTemplateOrLateResolvableType()) { continue; } @@ -844,6 +852,7 @@ public static function combineAcceptors(array $acceptors): ExtendedParametersAcc $parameter instanceof ExtendedParameterReflection ? $parameter->getAllowedConstants() : null, $parameter instanceof ExtendedParameterReflection ? $parameter->isPureUnlessCallableIsImpureParameter() : TrinaryLogic::createNo(), $parameter instanceof ExtendedParameterReflection ? $parameter->isPureUnlessParameterPassedParameter() : TrinaryLogic::createNo(), + $parameter instanceof ExtendedParameterReflection ? $parameter->getClosureScopeType() : null, ); continue; } @@ -863,6 +872,7 @@ public static function combineAcceptors(array $acceptors): ExtendedParametersAcc $outType = $parameters[$i]->getOutType(); $immediatelyInvokedCallable = $parameters[$i]->isImmediatelyInvokedCallable(); $closureThisType = $parameters[$i]->getClosureThisType(); + $closureScopeType = $parameters[$i]->getClosureScopeType(); $attributes = $parameters[$i]->getAttributes(); if ($parameter instanceof ExtendedParameterReflection) { $nativeType = TypeCombinator::union($nativeType, $parameter->getNativeType()); @@ -880,6 +890,12 @@ public static function combineAcceptors(array $acceptors): ExtendedParametersAcc $closureThisType = null; } + if ($parameter->getClosureScopeType() !== null && $closureScopeType !== null) { + $closureScopeType = TypeCombinator::union($closureScopeType, $parameter->getClosureScopeType()); + } else { + $closureScopeType = null; + } + $immediatelyInvokedCallable = $parameter->isImmediatelyInvokedCallable()->or($immediatelyInvokedCallable); $attributes = array_merge($attributes, $parameter->getAttributes()); } else { @@ -888,6 +904,7 @@ public static function combineAcceptors(array $acceptors): ExtendedParametersAcc $outType = null; $immediatelyInvokedCallable = TrinaryLogic::createMaybe(); $closureThisType = null; + $closureScopeType = null; } if ($isParameterVariadic) { @@ -942,6 +959,7 @@ public static function combineAcceptors(array $acceptors): ExtendedParametersAcc $allowedConstants, $pureUnlessCallableIsImpureParameter, $pureUnlessParameterPassedParameter, + $closureScopeType, ); if ($isParameterVariadic) { @@ -1404,6 +1422,7 @@ private static function overrideParameterType(ParameterReflection $original, Typ $wrapped->getAllowedConstants(), $wrapped->isPureUnlessCallableIsImpureParameter(), $wrapped->isPureUnlessParameterPassedParameter(), + $wrapped->getClosureScopeType(), ); } diff --git a/src/Reflection/Php/BackedEnumFromMethodReflection.php b/src/Reflection/Php/BackedEnumFromMethodReflection.php index 0faea145a09..ec364cbb2d8 100644 --- a/src/Reflection/Php/BackedEnumFromMethodReflection.php +++ b/src/Reflection/Php/BackedEnumFromMethodReflection.php @@ -86,6 +86,7 @@ public function getVariants(): array $parameter->getAllowedConstants(), $parameter->isPureUnlessCallableIsImpureParameter(), $parameter->isPureUnlessParameterPassedParameter(), + $parameter->getClosureScopeType(), ), $variant->getParameters()), $variant->isVariadic(), $variant->getReturnType(), diff --git a/src/Reflection/Php/ExtendedDummyParameter.php b/src/Reflection/Php/ExtendedDummyParameter.php index efd3d70b9eb..b7893b2a24b 100644 --- a/src/Reflection/Php/ExtendedDummyParameter.php +++ b/src/Reflection/Php/ExtendedDummyParameter.php @@ -35,6 +35,7 @@ public function __construct( private ?ParameterAllowedConstants $allowedConstants, private TrinaryLogic $pureUnlessCallableIsImpureParameter, private TrinaryLogic $pureUnlessParameterPassedParameter, + private ?Type $closureScopeType = null, ) { parent::__construct($name, $type, $optional, $passedByReference, $variadic, $defaultValue); @@ -70,6 +71,11 @@ public function getClosureThisType(): ?Type return $this->closureThisType; } + public function getClosureScopeType(): ?Type + { + return $this->closureScopeType; + } + public function getAttributes(): array { return $this->attributes; diff --git a/src/Reflection/Php/PhpClassReflectionExtension.php b/src/Reflection/Php/PhpClassReflectionExtension.php index 55dbd02acae..3544268027e 100644 --- a/src/Reflection/Php/PhpClassReflectionExtension.php +++ b/src/Reflection/Php/PhpClassReflectionExtension.php @@ -678,6 +678,7 @@ private function createMethod( $phpDocParameterOutTypes = []; $immediatelyInvokedCallableParameters = []; $closureThisParameters = []; + $closureScopeParameters = []; $currentResolvedPhpDoc = null; $phpDocDeclaringClass = $declaringClass; $phpDocFromStubs = false; @@ -721,6 +722,7 @@ private function createMethod( } $closureThisParameters = array_map(static fn ($tag) => $tag->getType(), $currentResolvedPhpDoc->getParamClosureThisTags()); + $closureScopeParameters = array_map(static fn ($tag) => $tag->getType(), $currentResolvedPhpDoc->getParamClosureScopeTags()); foreach ($currentResolvedPhpDoc->getParamTags() as $name => $paramTag) { $phpDocParameterTypes[$name] = TemplateTypeHelper::resolveTemplateTypes( $paramTag->getType(), @@ -768,7 +770,7 @@ private function createMethod( } } } - $variantsByType[$signatureType][] = $this->createNativeMethodVariant($declaringClassName, $methodReflection->getName(), $methodSignature, $phpDocParameterTypes, $phpDocReturnType, $phpDocParameterNameMapping, $phpDocParameterOutTypes, $immediatelyInvokedCallableParameters, $closureThisParameters, $phpDocFromStubs, $signatureType !== 'named'); + $variantsByType[$signatureType][] = $this->createNativeMethodVariant($declaringClassName, $methodReflection->getName(), $methodSignature, $phpDocParameterTypes, $phpDocReturnType, $phpDocParameterNameMapping, $phpDocParameterOutTypes, $immediatelyInvokedCallableParameters, $closureThisParameters, $phpDocFromStubs, $signatureType !== 'named', $closureScopeParameters); } } @@ -935,6 +937,7 @@ public function createUserlandMethodReflection(ClassReflection $fileDeclaringCla $templateTypeMap = TemplateTypeMap::createEmpty(); $immediatelyInvokedCallableParameters = []; $closureThisParameters = []; + $closureScopeParameters = []; $phpDocThrowType = null; $isInternal = false; $isFinal = false; @@ -946,6 +949,7 @@ public function createUserlandMethodReflection(ClassReflection $fileDeclaringCla $templateTypeMap = $resolvedPhpDoc->getTemplateTypeMap(); $immediatelyInvokedCallableParameters = array_map(static fn (bool $immediate) => TrinaryLogic::createFromBoolean($immediate), $resolvedPhpDoc->getParamsImmediatelyInvokedCallable()); $closureThisParameters = array_map(static fn ($tag) => $tag->getType(), $resolvedPhpDoc->getParamClosureThisTags()); + $closureScopeParameters = array_map(static fn ($tag) => $tag->getType(), $resolvedPhpDoc->getParamClosureScopeTags()); foreach ($resolvedPhpDoc->getParamsPureUnlessCallableIsImpure() as $paramName => $isPureUnlessCallableIsImpure) { $pureUnlessCallableIsImpureParameters[$paramName] = $isPureUnlessCallableIsImpure; } @@ -1033,6 +1037,7 @@ public function createUserlandMethodReflection(ClassReflection $fileDeclaringCla $this->attributeReflectionFactory->fromNativeReflection($methodReflection->getAttributes(), InitializerExprContext::fromClassMethod($actualDeclaringClass->getName(), $declaringTraitName, $methodReflection->getName(), $actualDeclaringClass->getFileName())), $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters, + $closureScopeParameters, ); } @@ -1042,6 +1047,7 @@ public function createUserlandMethodReflection(ClassReflection $fileDeclaringCla * @param array $phpDocParameterOutTypes * @param array $immediatelyInvokedCallableParameters * @param array $closureThisParameters + * @param array $closureScopeParameters */ private function createNativeMethodVariant( string $declaringClassName, @@ -1055,6 +1061,7 @@ private function createNativeMethodVariant( array $closureThisParameters, bool $phpDocFromStubs, bool $usePhpDocParameterNames, + array $closureScopeParameters = [], ): ExtendedFunctionVariant { $parameters = []; @@ -1085,6 +1092,11 @@ private function createNativeMethodVariant( $closureThisType = $closureThisParameters[$phpDocParameterName]; } + $closureScopeType = null; + if (isset($closureScopeParameters[$phpDocParameterName])) { + $closureScopeType = $closureScopeParameters[$phpDocParameterName]; + } + $parameters[] = new ExtendedNativeParameterReflection( $usePhpDocParameterNames ? $phpDocParameterName @@ -1106,6 +1118,7 @@ private function createNativeMethodVariant( // Class::method entries in functionMetadata.php). TrinaryLogic::createNo(), TrinaryLogic::createNo(), + $closureScopeType, ); } @@ -1213,7 +1226,7 @@ private function inferAndCachePropertyTypes( $classScope = $classScope->enterNamespace($namespace); } $classScope = $classScope->enterClass($declaringClass); - [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, , $phpDocComment, $asserts, $selfOutType, $phpDocParameterOutTypes, , , , $phpDocPureUnlessCallableIsImpureParameters, $phpDocPureUnlessParameterPassedParameters] = $this->phpDocsResolver->getPhpDocs($classScope, $methodNode); + [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, , $phpDocComment, $asserts, $selfOutType, $phpDocParameterOutTypes, , , , $phpDocPureUnlessCallableIsImpureParameters, $phpDocPureUnlessParameterPassedParameters, $phpDocClosureScopeTypeParameters] = $this->phpDocsResolver->getPhpDocs($classScope, $methodNode); $methodScope = $classScope->enterClassMethod( $methodNode, $templateTypeMap, @@ -1236,6 +1249,7 @@ private function inferAndCachePropertyTypes( null, $phpDocPureUnlessCallableIsImpureParameters, $phpDocPureUnlessParameterPassedParameters, + $phpDocClosureScopeTypeParameters, ); $propertyTypes = []; diff --git a/src/Reflection/Php/PhpFunctionFromParserNodeReflection.php b/src/Reflection/Php/PhpFunctionFromParserNodeReflection.php index 12ec0f36278..37c8b8610fa 100644 --- a/src/Reflection/Php/PhpFunctionFromParserNodeReflection.php +++ b/src/Reflection/Php/PhpFunctionFromParserNodeReflection.php @@ -53,6 +53,7 @@ class PhpFunctionFromParserNodeReflection implements FunctionReflection, Extende * @param list $attributes * @param array $pureUnlessCallableIsImpureParameters * @param array $pureUnlessParameterPassedParameters + * @param array $phpDocClosureScopeTypeParameters */ public function __construct( FunctionLike $functionLike, @@ -78,6 +79,7 @@ public function __construct( private array $attributes, private array $pureUnlessCallableIsImpureParameters, private array $pureUnlessParameterPassedParameters, + private array $phpDocClosureScopeTypeParameters = [], ) { $this->functionLike = $functionLike; @@ -184,6 +186,12 @@ public function getParameters(): array $closureThisType = null; } + if (isset($this->phpDocClosureScopeTypeParameters[$parameter->var->name])) { + $closureScopeType = $this->phpDocClosureScopeTypeParameters[$parameter->var->name]; + } else { + $closureScopeType = null; + } + $pureUnlessCallableIsImpureParameter = TrinaryLogic::createFromBoolean($this->pureUnlessCallableIsImpureParameters[$parameter->var->name] ?? false); $pureUnlessParameterPassedParameter = TrinaryLogic::createFromBoolean($this->pureUnlessParameterPassedParameters[$parameter->var->name] ?? false); @@ -203,6 +211,7 @@ public function getParameters(): array $this->parameterAttributes[$parameter->var->name] ?? [], $pureUnlessCallableIsImpureParameter, $pureUnlessParameterPassedParameter, + $closureScopeType, ); } diff --git a/src/Reflection/Php/PhpFunctionReflection.php b/src/Reflection/Php/PhpFunctionReflection.php index 1dbee429546..686bc28dfb5 100644 --- a/src/Reflection/Php/PhpFunctionReflection.php +++ b/src/Reflection/Php/PhpFunctionReflection.php @@ -42,6 +42,7 @@ final class PhpFunctionReflection implements FunctionReflection * @param list $attributes * @param array $phpDocParameterPureUnlessCallableIsImpure * @param array $phpDocParameterPureUnlessParameterPassed + * @param array $phpDocParameterClosureScopeTypes */ public function __construct( private InitializerExprTypeResolver $initializerExprTypeResolver, @@ -66,6 +67,7 @@ public function __construct( private array $attributes, private array $phpDocParameterPureUnlessCallableIsImpure, private array $phpDocParameterPureUnlessParameterPassed, + private array $phpDocParameterClosureScopeTypes = [], ) { } @@ -136,6 +138,7 @@ private function getParameters(): array $this->allowedConstantsMapProvider->getForFunctionParameter(strtolower($this->reflection->getName()), $reflection->getName()), TrinaryLogic::createFromBoolean($this->phpDocParameterPureUnlessCallableIsImpure[$reflection->getName()] ?? false), TrinaryLogic::createFromBoolean($this->phpDocParameterPureUnlessParameterPassed[$reflection->getName()] ?? false), + $this->phpDocParameterClosureScopeTypes[$reflection->getName()] ?? null, ); }, $this->reflection->getParameters()); } diff --git a/src/Reflection/Php/PhpMethodFromParserNodeReflection.php b/src/Reflection/Php/PhpMethodFromParserNodeReflection.php index 3d8ca7bbbbc..e3d34f7f704 100644 --- a/src/Reflection/Php/PhpMethodFromParserNodeReflection.php +++ b/src/Reflection/Php/PhpMethodFromParserNodeReflection.php @@ -45,6 +45,7 @@ final class PhpMethodFromParserNodeReflection extends PhpFunctionFromParserNodeR * @param array $immediatelyInvokedCallableParameters * @param array $phpDocClosureThisTypeParameters * @param list $attributes + * @param array $phpDocClosureScopeTypeParameters */ public function __construct( private ClassReflection $declaringClass, @@ -76,6 +77,7 @@ public function __construct( array $attributes, array $pureUnlessCallableIsImpureParameters, array $pureUnlessParameterPassedParameters, + array $phpDocClosureScopeTypeParameters = [], ) { if ($this->classMethod instanceof Node\PropertyHook) { @@ -144,6 +146,7 @@ public function __construct( $attributes, $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters, + $phpDocClosureScopeTypeParameters, ); } diff --git a/src/Reflection/Php/PhpMethodReflection.php b/src/Reflection/Php/PhpMethodReflection.php index db2f8a8d69c..b2e03e58398 100644 --- a/src/Reflection/Php/PhpMethodReflection.php +++ b/src/Reflection/Php/PhpMethodReflection.php @@ -69,6 +69,7 @@ final class PhpMethodReflection implements ExtendedMethodReflection * @param list $attributes * @param array $pureUnlessCallableIsImpureParameters * @param array $pureUnlessParameterPassedParameters + * @param array $phpDocClosureScopeTypeParameters */ public function __construct( private InitializerExprTypeResolver $initializerExprTypeResolver, @@ -98,6 +99,7 @@ public function __construct( private array $attributes, private array $pureUnlessCallableIsImpureParameters, private array $pureUnlessParameterPassedParameters, + private array $phpDocClosureScopeTypeParameters = [], ) { } @@ -243,6 +245,7 @@ private function getParameters(): array $this->allowedConstantsMapProvider->getForMethodParameter($this->declaringClass->getName(), $this->reflection->getName(), $reflection->getName()), TrinaryLogic::createFromBoolean($this->pureUnlessCallableIsImpureParameters[$reflection->getName()] ?? false), TrinaryLogic::createFromBoolean($this->pureUnlessParameterPassedParameters[$reflection->getName()] ?? false), + $this->phpDocClosureScopeTypeParameters[$reflection->getName()] ?? null, ), $this->reflection->getParameters()); } @@ -465,6 +468,7 @@ public function changePropertyGetHookPhpDocType(Type $phpDocType): self $this->attributes, $this->pureUnlessCallableIsImpureParameters, $this->pureUnlessParameterPassedParameters, + $this->phpDocClosureScopeTypeParameters, ); } @@ -501,6 +505,7 @@ public function changePropertySetHookPhpDocType(string $parameterName, Type $php $this->attributes, $this->pureUnlessCallableIsImpureParameters, $this->pureUnlessParameterPassedParameters, + $this->phpDocClosureScopeTypeParameters, ); } diff --git a/src/Reflection/Php/PhpMethodReflectionFactory.php b/src/Reflection/Php/PhpMethodReflectionFactory.php index 583d2cb4d28..912553867f8 100644 --- a/src/Reflection/Php/PhpMethodReflectionFactory.php +++ b/src/Reflection/Php/PhpMethodReflectionFactory.php @@ -22,6 +22,7 @@ interface PhpMethodReflectionFactory * @param list $attributes * @param array $pureUnlessCallableIsImpureParameters * @param array $pureUnlessParameterPassedParameters + * @param array $phpDocClosureScopeTypeParameters */ public function create( ClassReflection $declaringClass, @@ -47,6 +48,7 @@ public function create( array $attributes, array $pureUnlessCallableIsImpureParameters, array $pureUnlessParameterPassedParameters, + array $phpDocClosureScopeTypeParameters = [], ): PhpMethodReflection; } diff --git a/src/Reflection/Php/PhpParameterFromParserNodeReflection.php b/src/Reflection/Php/PhpParameterFromParserNodeReflection.php index 9535b0c7f7c..a3e8d838a5a 100644 --- a/src/Reflection/Php/PhpParameterFromParserNodeReflection.php +++ b/src/Reflection/Php/PhpParameterFromParserNodeReflection.php @@ -35,6 +35,7 @@ public function __construct( private array $attributes, private TrinaryLogic $pureUnlessCallableIsImpureParameter, private TrinaryLogic $pureUnlessParameterPassedParameter, + private ?Type $closureScopeType = null, ) { } @@ -112,6 +113,11 @@ public function getClosureThisType(): ?Type return $this->closureThisType; } + public function getClosureScopeType(): ?Type + { + return $this->closureScopeType; + } + public function getAttributes(): array { return $this->attributes; diff --git a/src/Reflection/Php/PhpParameterReflection.php b/src/Reflection/Php/PhpParameterReflection.php index 968a3e38a7e..3bf21f9cca9 100644 --- a/src/Reflection/Php/PhpParameterReflection.php +++ b/src/Reflection/Php/PhpParameterReflection.php @@ -41,6 +41,7 @@ public function __construct( private ?ParameterAllowedConstants $allowedConstants, private TrinaryLogic $pureUnlessCallableIsImpureParameter, private TrinaryLogic $pureUnlessParameterPassedParameter, + private ?Type $closureScopeType = null, ) { } @@ -145,6 +146,11 @@ public function getClosureThisType(): ?Type return $this->closureThisType; } + public function getClosureScopeType(): ?Type + { + return $this->closureScopeType; + } + public function getAttributes(): array { return $this->attributes; diff --git a/src/Reflection/ResolvedFunctionVariantWithOriginal.php b/src/Reflection/ResolvedFunctionVariantWithOriginal.php index af85439f365..901558bae53 100644 --- a/src/Reflection/ResolvedFunctionVariantWithOriginal.php +++ b/src/Reflection/ResolvedFunctionVariantWithOriginal.php @@ -124,6 +124,19 @@ function (ExtendedParameterReflection $param): ExtendedParameterReflection { ); } + $closureScopeType = $param->getClosureScopeType(); + if ($closureScopeType !== null) { + $closureScopeType = TypeUtils::resolveLateResolvableTypes( + TemplateTypeHelper::resolveTemplateTypes( + $this->resolveConditionalTypesForParameter($closureScopeType), + $this->resolvedTemplateTypeMap, + $this->callSiteVarianceMap, + TemplateTypeVariance::createCovariant(), + ), + false, + ); + } + return new ExtendedDummyParameter( $param->getName(), $paramType, @@ -140,6 +153,7 @@ function (ExtendedParameterReflection $param): ExtendedParameterReflection { $param->getAllowedConstants(), $param->isPureUnlessCallableIsImpureParameter(), $param->isPureUnlessParameterPassedParameter(), + $closureScopeType, ); }, $this->parametersAcceptor->getParameters(), diff --git a/src/Reflection/SignatureMap/NativeFunctionReflectionProvider.php b/src/Reflection/SignatureMap/NativeFunctionReflectionProvider.php index 6a868d39971..831b32f2f56 100644 --- a/src/Reflection/SignatureMap/NativeFunctionReflectionProvider.php +++ b/src/Reflection/SignatureMap/NativeFunctionReflectionProvider.php @@ -137,6 +137,7 @@ public function findFunctionReflection(string $functionName): ?NativeFunctionRef $phpDocType = null; $immediatelyInvokedCallable = TrinaryLogic::createMaybe(); $closureThisType = null; + $closureScopeType = null; $pureUnlessCallableIsImpureParameter = TrinaryLogic::createFromBoolean($pureUnlessCallableIsImpureParameters[$name] ?? false); $pureUnlessParameterPassedParameter = TrinaryLogic::createFromBoolean($pureUnlessParameterPassedParameters[$name] ?? false); if ($phpDoc !== null) { @@ -149,6 +150,9 @@ public function findFunctionReflection(string $functionName): ?NativeFunctionRef if (array_key_exists($parameterSignature->getName(), $phpDoc->getParamClosureThisTags())) { $closureThisType = $phpDoc->getParamClosureThisTags()[$parameterSignature->getName()]->getType(); } + if (array_key_exists($parameterSignature->getName(), $phpDoc->getParamClosureScopeTags())) { + $closureScopeType = $phpDoc->getParamClosureScopeTags()[$parameterSignature->getName()]->getType(); + } if (($phpDoc->getParamsPureUnlessCallableIsImpure()[$parameterSignature->getName()] ?? false) === true) { $pureUnlessCallableIsImpureParameter = TrinaryLogic::createYes(); } @@ -173,6 +177,7 @@ public function findFunctionReflection(string $functionName): ?NativeFunctionRef $allowedConstantsMapProvider->getForFunctionParameter($lowerCasedFunctionName, $parameterSignature->getName()), $pureUnlessCallableIsImpureParameter, $pureUnlessParameterPassedParameter, + $closureScopeType, ); }, $functionSignature->getParameters()), $functionSignature->isVariadic(), diff --git a/src/Reflection/Type/CallbackUnresolvedMethodPrototypeReflection.php b/src/Reflection/Type/CallbackUnresolvedMethodPrototypeReflection.php index f0e0254fd40..a3aca383a50 100644 --- a/src/Reflection/Type/CallbackUnresolvedMethodPrototypeReflection.php +++ b/src/Reflection/Type/CallbackUnresolvedMethodPrototypeReflection.php @@ -123,6 +123,7 @@ function (ExtendedParameterReflection $parameter): ExtendedParameterReflection { $parameter->getAllowedConstants(), $parameter->isPureUnlessCallableIsImpureParameter(), $parameter->isPureUnlessParameterPassedParameter(), + $parameter->getClosureScopeType() !== null ? $this->transformStaticType($parameter->getClosureScopeType()) : null, ); }, $acceptor->getParameters(), diff --git a/src/Reflection/Type/CalledOnTypeUnresolvedMethodPrototypeReflection.php b/src/Reflection/Type/CalledOnTypeUnresolvedMethodPrototypeReflection.php index ba61cd9c1fc..19160895108 100644 --- a/src/Reflection/Type/CalledOnTypeUnresolvedMethodPrototypeReflection.php +++ b/src/Reflection/Type/CalledOnTypeUnresolvedMethodPrototypeReflection.php @@ -110,6 +110,7 @@ private function transformMethodWithStaticType(ClassReflection $declaringClass, $parameter->getAllowedConstants(), $parameter->isPureUnlessCallableIsImpureParameter(), $parameter->isPureUnlessParameterPassedParameter(), + $parameter->getClosureScopeType() !== null ? $this->transformStaticType($parameter->getClosureScopeType()) : null, ), $acceptor->getParameters(), ), diff --git a/src/Rules/FunctionDefinitionCheck.php b/src/Rules/FunctionDefinitionCheck.php index 161679ecd34..c35245621de 100644 --- a/src/Rules/FunctionDefinitionCheck.php +++ b/src/Rules/FunctionDefinitionCheck.php @@ -754,6 +754,9 @@ private function getParameterReferencedClasses(ParameterReflection $parameter): if ($parameter->getClosureThisType() !== null) { $moreClasses = array_merge($moreClasses, $parameter->getClosureThisType()->getReferencedClasses()); } + if ($parameter->getClosureScopeType() !== null) { + $moreClasses = array_merge($moreClasses, $parameter->getClosureScopeType()->getReferencedClasses()); + } return array_merge( $parameter->getNativeType()->getReferencedClasses(), diff --git a/src/Rules/Functions/MissingFunctionParameterTypehintRule.php b/src/Rules/Functions/MissingFunctionParameterTypehintRule.php index 4476427835c..e147202f5d6 100644 --- a/src/Rules/Functions/MissingFunctionParameterTypehintRule.php +++ b/src/Rules/Functions/MissingFunctionParameterTypehintRule.php @@ -52,6 +52,12 @@ public function processNode(Node $node, Scope $scope): array } } + if ($parameterReflection->getClosureScopeType() !== null) { + foreach ($this->checkFunctionParameter($functionReflection, sprintf('@param-closure-scope PHPDoc tag for parameter $%s', $parameterReflection->getName()), $parameterReflection->getClosureScopeType()) as $parameterMessage) { + $messages[] = $parameterMessage; + } + } + if ($parameterReflection->getOutType() === null) { continue; } diff --git a/src/Rules/Methods/MissingMethodParameterTypehintRule.php b/src/Rules/Methods/MissingMethodParameterTypehintRule.php index a0a5cd3b936..3cfcfe42a02 100644 --- a/src/Rules/Methods/MissingMethodParameterTypehintRule.php +++ b/src/Rules/Methods/MissingMethodParameterTypehintRule.php @@ -52,6 +52,12 @@ public function processNode(Node $node, Scope $scope): array } } + if ($parameterReflection->getClosureScopeType() !== null) { + foreach ($this->checkMethodParameter($methodReflection, sprintf('@param-closure-scope PHPDoc tag for parameter $%s', $parameterReflection->getName()), $parameterReflection->getClosureScopeType()) as $parameterMessage) { + $messages[] = $parameterMessage; + } + } + if ($parameterReflection->getOutType() === null) { continue; } diff --git a/src/Rules/PhpDoc/ConditionalReturnTypeRuleHelper.php b/src/Rules/PhpDoc/ConditionalReturnTypeRuleHelper.php index 4835cb3f3c9..8b2d3a39303 100644 --- a/src/Rules/PhpDoc/ConditionalReturnTypeRuleHelper.php +++ b/src/Rules/PhpDoc/ConditionalReturnTypeRuleHelper.php @@ -61,6 +61,16 @@ public function check(ExtendedParametersAcceptor $acceptor): array }); } + if ($parameter->getClosureScopeType() !== null) { + TypeTraverser::map($parameter->getClosureScopeType(), static function (Type $type, callable $traverse) use (&$conditionalTypes): Type { + if ($type instanceof ConditionalType || $type instanceof ConditionalTypeForParameter) { + $conditionalTypes[] = $type; + } + + return $traverse($type); + }); + } + $parametersByName[$parameter->getName()] = $parameter; } diff --git a/src/Rules/PhpDoc/IncompatiblePhpDocTypeCheck.php b/src/Rules/PhpDoc/IncompatiblePhpDocTypeCheck.php index 9280c062350..19692302f5c 100644 --- a/src/Rules/PhpDoc/IncompatiblePhpDocTypeCheck.php +++ b/src/Rules/PhpDoc/IncompatiblePhpDocTypeCheck.php @@ -51,7 +51,7 @@ public function check( { $errors = []; - foreach (['@param' => $resolvedPhpDoc->getParamTags(), '@param-out' => $resolvedPhpDoc->getParamOutTags(), '@param-closure-this' => $resolvedPhpDoc->getParamClosureThisTags()] as $tagName => $parameters) { + foreach (['@param' => $resolvedPhpDoc->getParamTags(), '@param-out' => $resolvedPhpDoc->getParamOutTags(), '@param-closure-this' => $resolvedPhpDoc->getParamClosureThisTags(), '@param-closure-scope' => $resolvedPhpDoc->getParamClosureScopeTags()] as $tagName => $parameters) { foreach ($parameters as $parameterName => $phpDocParamTag) { $phpDocParamType = $phpDocParamTag->getType(); $unresolvableType = $this->unresolvableTypeHelper->getUnresolvableType($phpDocParamType); @@ -173,7 +173,7 @@ public function check( } } - if ($tagName === '@param-closure-this') { + if (in_array($tagName, ['@param-closure-this', '@param-closure-scope'], true)) { $isNonClosure = (new ClosureType())->isSuperTypeOf($nativeParamType)->no(); if ($isNonClosure) { $errors[] = RuleErrorBuilder::message(sprintf( @@ -181,7 +181,7 @@ public function check( $tagName, $parameterName, $nativeParamType->describe(VerbosityLevel::typeOnly()), - ))->identifier('paramClosureThis.nonClosure')->build(); + ))->identifier($tagName === '@param-closure-this' ? 'paramClosureThis.nonClosure' : 'paramClosureScope.nonClosure')->build(); } } } diff --git a/src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php b/src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php index e7f58e41bbc..8ca5b3ece10 100644 --- a/src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php +++ b/src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php @@ -66,6 +66,7 @@ final class InvalidPHPStanDocTagRule implements MultipleNodeTypesRule '@phpstan-param-closure-this', '@phpstan-pure-unless-callable-is-impure', '@phpstan-pure-unless-parameter-passed', + '@phpstan-param-closure-scope', '@phpstan-all-methods-pure', '@phpstan-all-methods-impure', ]; diff --git a/src/Type/CallableType.php b/src/Type/CallableType.php index b58dd0fb886..9d5c4a21746 100644 --- a/src/Type/CallableType.php +++ b/src/Type/CallableType.php @@ -869,6 +869,9 @@ public function hasTemplateOrLateResolvableType(): bool if ($parameter->getClosureThisType() !== null && $parameter->getClosureThisType()->hasTemplateOrLateResolvableType()) { return true; } + if ($parameter->getClosureScopeType() !== null && $parameter->getClosureScopeType()->hasTemplateOrLateResolvableType()) { + return true; + } } foreach ($this->assertions->getAll() as $assertTag) { diff --git a/src/Type/ClosureType.php b/src/Type/ClosureType.php index 2bf0c3b332b..cba44d2036e 100644 --- a/src/Type/ClosureType.php +++ b/src/Type/ClosureType.php @@ -1057,6 +1057,9 @@ public function hasTemplateOrLateResolvableType(): bool if ($parameter->getClosureThisType() !== null && $parameter->getClosureThisType()->hasTemplateOrLateResolvableType()) { return true; } + if ($parameter->getClosureScopeType() !== null && $parameter->getClosureScopeType()->hasTemplateOrLateResolvableType()) { + return true; + } } foreach ($this->assertions->getAll() as $assertTag) { diff --git a/tests/PHPStan/Analyser/nsrt/bug-15197.php b/tests/PHPStan/Analyser/nsrt/bug-15197.php new file mode 100644 index 00000000000..b20276eeba7 --- /dev/null +++ b/tests/PHPStan/Analyser/nsrt/bug-15197.php @@ -0,0 +1,28 @@ += 8.0 + +namespace Bug15197; + +use function PHPStan\Testing\assertType; + +interface DiInterface +{ + /** + * @param-closure-this DiInterface $definition + */ + public function set(string $name, mixed $definition): void; + + public function get(string $service): object; +} + +class MyServiceProvider +{ + const SERVICE_FOO = 'foo'; + + public function provide(DiInterface $di): void { + $di->set('foobar', function () { + assertType(DiInterface::class, $this); + assertType("'foo'", self::SERVICE_FOO); + assertType('object', $this->get(self::SERVICE_FOO)); + }); + } +} diff --git a/tests/PHPStan/Analyser/nsrt/param-closure-this.php b/tests/PHPStan/Analyser/nsrt/param-closure-this.php index 6486cf0952a..9ff24163935 100644 --- a/tests/PHPStan/Analyser/nsrt/param-closure-this.php +++ b/tests/PHPStan/Analyser/nsrt/param-closure-this.php @@ -334,6 +334,7 @@ class StaticReturnClosureThis /** * @param-closure-this FooChild $cb + * @param-closure-scope FooChild $cb */ public function withFooChild(callable $cb): void { @@ -342,6 +343,7 @@ public function withFooChild(callable $cb): void /** * @param-closure-this Foo $cb + * @param-closure-scope Foo $cb */ public function withFoo(callable $cb): void { @@ -388,3 +390,84 @@ public function testNullableStaticReturnType(StaticReturnClosureThis $o): void } } + +class ClosureThisWithoutScope +{ + + public const SERVICE_FOO = 'foo'; + + /** + * @param-closure-this Some $cb + */ + public function paramClosureThisOnly(callable $cb): void + { + + } + + /** + * @param-closure-scope Some $cb + */ + public function paramClosureScopeOnly(callable $cb): void + { + + } + + /** + * @param-closure-this Some $cb + * @param-closure-scope Some $cb + */ + public function paramClosureThisAndScope(callable $cb): void + { + + } + + public function testThisWithoutScope(): void + { + $this->paramClosureThisOnly(function () { + assertType(Some::class, $this); + assertType("'foo'", self::SERVICE_FOO); + }); + + $this->paramClosureThisOnly(fn () => assertType("'foo'", self::SERVICE_FOO)); + } + + public function testScopeWithoutThis(): void + { + $this->paramClosureScopeOnly(function () { + assertType(sprintf('$this(%s)', self::class), $this); + }); + } + + public function testThisAndScope(): void + { + $this->paramClosureThisAndScope(function () { + assertType(Some::class, $this); + }); + } + +} + +class BoundScopeClass +{ + public const X = 'bound'; +} + +class ClosureScopeOnly +{ + public const X = 'enclosing'; + + /** + * @param-closure-scope BoundScopeClass $cb + */ + public function withScope(callable $cb): void + { + } + + public function test(): void + { + $this->withScope(function () { + assertType(sprintf('$this(%s)', ClosureScopeOnly::class), $this); + }); + } + +} diff --git a/tests/PHPStan/Rules/Classes/ClassConstantRuleTest.php b/tests/PHPStan/Rules/Classes/ClassConstantRuleTest.php index e6e6d1837bf..5bdbeca467c 100644 --- a/tests/PHPStan/Rules/Classes/ClassConstantRuleTest.php +++ b/tests/PHPStan/Rules/Classes/ClassConstantRuleTest.php @@ -636,4 +636,14 @@ public function testClosureAttributeArguments(): void ]); } + public function testBug15197(): void + { + $this->analyse([__DIR__ . '/data/bug-15197.php'], [ + [ + 'Access to undefined constant Bug15197\BoundScope::MISSING.', + 61, + ], + ]); + } + } diff --git a/tests/PHPStan/Rules/Classes/data/bug-15197.php b/tests/PHPStan/Rules/Classes/data/bug-15197.php new file mode 100644 index 00000000000..11dff0e1092 --- /dev/null +++ b/tests/PHPStan/Rules/Classes/data/bug-15197.php @@ -0,0 +1,64 @@ += 8.0 + +namespace Bug15197; + +interface DiInterface +{ + /** + * @param-closure-this DiInterface $definition + */ + public function set(string $name, mixed $definition): void; + + public function get(string $service): object; +} + +class MyServiceProvider +{ + const SERVICE_FOO = 'foo'; + + public function provide(DiInterface $di): void { + $di->set('foobar', function () { + return $this->get(self::SERVICE_FOO); + }); + } +} + +class BoundScope +{ + public const X = 'bound'; +} + +class Enclosing +{ + public const X = 'enclosing'; + + /** + * @param-closure-scope BoundScope $cb + */ + public function withScope(callable $cb): void + { + } + + /** + * @param-closure-this BoundScope $cb + * @param-closure-scope BoundScope $cb + */ + public function withThisAndScope(callable $cb): void + { + } + + public function test(): void + { + $this->withScope(function () { + echo self::X; + }); + + $this->withThisAndScope(function () { + echo self::X; + }); + + $this->withScope(function () { + echo self::MISSING; + }); + } +} diff --git a/tests/PHPStan/Rules/Methods/data/bug-11010.php b/tests/PHPStan/Rules/Methods/data/bug-11010.php index 07c621cc96c..1e4ee993f65 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-11010.php +++ b/tests/PHPStan/Rules/Methods/data/bug-11010.php @@ -11,6 +11,7 @@ protected function sayHello(): void /** * @param-closure-this self $cb + * @param-closure-scope self $cb */ public static function cb(\Closure $cb): void { diff --git a/tests/PHPStan/Rules/PhpDoc/IncompatiblePhpDocTypeRuleTest.php b/tests/PHPStan/Rules/PhpDoc/IncompatiblePhpDocTypeRuleTest.php index a14c6819654..2216aa68b4e 100644 --- a/tests/PHPStan/Rules/PhpDoc/IncompatiblePhpDocTypeRuleTest.php +++ b/tests/PHPStan/Rules/PhpDoc/IncompatiblePhpDocTypeRuleTest.php @@ -454,6 +454,44 @@ public function testParamClosureThis(): void ]); } + public function testParamClosureScope(): void + { + $this->analyse([__DIR__ . '/data/param-closure-scope.php'], [ + [ + 'PHPDoc tag @param-closure-scope references unknown parameter: $b', + 20, + ], + [ + 'PHPDoc tag @param-closure-scope for parameter $i contains unresolvable type.', + 27, + ], + [ + 'PHPDoc tag @param-closure-scope for parameter $i contains unresolvable type.', + 34, + ], + [ + 'PHPDoc tag @param-closure-scope is for parameter $i with non-Closure type string.', + 41, + ], + [ + 'PHPDoc tag @param-closure-scope for parameter $i contains generic type Exception but class Exception is not generic.', + 48, + ], + [ + 'Generic type ParamClosureScopePhpDocRule\FooBar in PHPDoc tag @param-closure-scope for parameter $i does not specify all template types of class ParamClosureScopePhpDocRule\FooBar: T, TT', + 55, + ], + [ + 'Type mixed in generic type ParamClosureScopePhpDocRule\FooBar in PHPDoc tag @param-closure-scope for parameter $i is not subtype of template type T of int of class ParamClosureScopePhpDocRule\FooBar.', + 55, + ], + [ + 'Generic type ParamClosureScopePhpDocRule\FooBar in PHPDoc tag @param-closure-scope for parameter $i does not specify all template types of class ParamClosureScopePhpDocRule\FooBar: T, TT', + 62, + ], + ]); + } + public function testGenericStatic(): void { $this->analyse([__DIR__ . '/data/incompatible-phpdoc-generic-static.php'], [ diff --git a/tests/PHPStan/Rules/PhpDoc/data/param-closure-scope.php b/tests/PHPStan/Rules/PhpDoc/data/param-closure-scope.php new file mode 100644 index 00000000000..10857d1a50c --- /dev/null +++ b/tests/PHPStan/Rules/PhpDoc/data/param-closure-scope.php @@ -0,0 +1,72 @@ + $i + */ +function invalidParamClosureScopeGeneric(callable $i) { + +} + +/** + * @param-closure-scope FooBar $i + */ +function invalidParamClosureScopeWrongGenericParams(callable $i) { + +} + +/** + * @param-closure-scope FooBar $i + */ +function invalidParamClosureScopeNotAllGenericParams(callable $i) { + +} + +/** + * @template T of int + * @template TT of string + */ +class FooBar { + +} diff --git a/turbo-ext/src/ArgumentsHandler.cpp b/turbo-ext/src/ArgumentsHandler.cpp index 8551f011a8b..9759acebe42 100644 --- a/turbo-ext/src/ArgumentsHandler.cpp +++ b/turbo-ext/src/ArgumentsHandler.cpp @@ -1286,8 +1286,8 @@ class ArgumentsHandler return zv::Val::null(); } - /* Mirrors resolveClosureThisType() (the type or null) */ - zv::Val resolveClosureThisType(zval *call, zval *calleeReflection, zval *parameter, zval *scope) const + /* Mirrors resolveClosureThisTypeFromExtensions() (the type or null) */ + zv::Val resolveClosureThisTypeFromExtensions(zval *call, zval *calleeReflection, zval *parameter, zval *scope) const { bool found = false; zv::Val type; @@ -1311,10 +1311,6 @@ class ArgumentsHandler } if (UNEXPECTED(EG(exception))) return zv::Val(); if (found) return type; - - bool isExtended = false; - if (UNEXPECTED(!isA(parameter, PT_CLASS_EXTENDED_PARAMETER_REFLECTION, isExtended))) return zv::Val(); - if (isExtended) return parameterGetClosureThisType(parameter); return zv::Val::null(); } @@ -1830,9 +1826,10 @@ class ArgumentsHandler return stored; } - /* the closure $this binding and the parameter-type extensions ahead of a - * closure / arrow function body walk; restoreThisScope receives the scope - * before the binding (UNDEF when none); false = pending exception */ + /* the closure $this / scope binding (applyClosureThisAndScope()) and the + * parameter-type extensions ahead of a closure / arrow function body walk; + * restoreThisScope receives the scope before the binding (UNDEF when + * none); false = pending exception */ zend_never_inline bool prepareClosureArgScope(Walk &w, zval *value, ArgLocals &a, zv::Val *restoreThisScope) const { bool isExtended = false; @@ -1841,13 +1838,27 @@ class ArgumentsHandler zv::Val staticHold; zval *isStatic = readProperty(pt_ah_closure_static_site, value, PT_LC("static"), staticHold); if (UNEXPECTED(isStatic == NULL)) return false; + zv::Val closureThisType = zv::Val::null(); + zv::Val closureScopeType = pt_parameter_reflection_call(a.parameter, PT_PR_GET_CLOSURE_SCOPE_TYPE); + if (UNEXPECTED(closureScopeType.isUndef())) return false; if (!zend_is_true(isStatic)) { - zv::Val closureThisType = resolveClosureThisType(w.callLike, w.calleeReflection, a.parameter, a.scopeToPass.raw()); + closureThisType = resolveClosureThisTypeFromExtensions(w.callLike, w.calleeReflection, a.parameter, a.scopeToPass.raw()); if (UNEXPECTED(closureThisType.isUndef())) return false; if (!closureThisType.isNull()) { - if (restoreThisScope != NULL) { - *restoreThisScope = zv::Val::copyOf(zv::Ref(a.scopeToPass.raw())); + // an extension's $this also binds the scope (??=) + if (closureScopeType.isNull()) { + closureScopeType = zv::Val::copyOf(zv::Ref(closureThisType.raw())); } + } else { + closureThisType = parameterGetClosureThisType(a.parameter); + if (UNEXPECTED(closureThisType.isUndef())) return false; + } + } + if (!closureThisType.isNull() || !closureScopeType.isNull()) { + if (restoreThisScope != NULL) { + *restoreThisScope = zv::Val::copyOf(zv::Ref(a.scopeToPass.raw())); + } + if (!closureThisType.isNull()) { if (UNEXPECTED(Z_TYPE_P(a.scopeToPass.raw()) != IS_OBJECT)) { zend_throw_error(NULL, "Call to a member function assignVariable() on %s", zend_zval_value_name(a.scopeToPass.raw())); return false; @@ -1856,9 +1867,20 @@ class ArgumentsHandler if (UNEXPECTED(objectWithoutClassType.isUndef())) return false; zv::Val assigned = pt_mutating_scope_assign_variable(Z_OBJ_P(a.scopeToPass.raw()), pt_ah_this, closureThisType.raw(), objectWithoutClassType.raw(), pt_trinary_singleton(PT_TRI_YES)); if (UNEXPECTED(assigned.isUndef())) return false; - zv::Val classNames = pt_type_op(Z_OBJ_P(closureThisType.raw()), PT_OP_GET_OBJECT_CLASS_NAMES, 0, NULL); + a.scopeToPass = std::move(assigned); + } + if (!closureScopeType.isNull()) { + if (UNEXPECTED(Z_TYPE_P(a.scopeToPass.raw()) != IS_OBJECT)) { + zend_throw_error(NULL, "Call to a member function withClosureBindScopeClasses() on %s", zend_zval_value_name(a.scopeToPass.raw())); + return false; + } + if (UNEXPECTED(Z_TYPE_P(closureScopeType.raw()) != IS_OBJECT)) { + zend_throw_error(NULL, "Call to a member function getObjectClassNames() on %s", zend_zval_value_name(closureScopeType.raw())); + return false; + } + zv::Val classNames = pt_type_op(Z_OBJ_P(closureScopeType.raw()), PT_OP_GET_OBJECT_CLASS_NAMES, 0, NULL); if (UNEXPECTED(classNames.isUndef())) return false; - zv::Val bound = pt_mutating_scope_with_closure_bind_scope_classes(Z_OBJ_P(assigned.raw()), classNames.raw()); + zv::Val bound = pt_mutating_scope_with_closure_bind_scope_classes(Z_OBJ_P(a.scopeToPass.raw()), classNames.raw()); if (UNEXPECTED(bound.isUndef())) return false; a.scopeToPass = std::move(bound); } diff --git a/turbo-ext/src/ClassMethodHandler.cpp b/turbo-ext/src/ClassMethodHandler.cpp index 6a00411b6f9..dcdb12c145b 100644 --- a/turbo-ext/src/ClassMethodHandler.cpp +++ b/turbo-ext/src/ClassMethodHandler.cpp @@ -198,9 +198,10 @@ class ClassMethodHandler zv::Val attributeDependencies = ptsh::processAttributeGroups(OBJ_PROP_NUM(self, slots::attributesHandler), nodeScopeResolver, stmt, attrGroups, scope, storage, nodeCallback); if (UNEXPECTED(attributeDependencies.isUndef())) return zv::Val(); collect(dependencies, attributeDependencies.raw()); - /* [$templateTypeMap, ..., $phpDocParameterOutTypes, , , , $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters] */ + /* [$templateTypeMap, ..., $phpDocParameterOutTypes, , , , $pureUnlessCallableIsImpureParameters, $pureUnlessParameterPassedParameters, + * $phpDocClosureScopeTypeParameters] */ pt_php_docs phpDocs; - if (UNEXPECTED(!ptsh::getPhpDocs(OBJ_PROP_NUM(self, slots::phpDocsResolver), scope, stmt, 0x1FFFFu | (1u << 20) | (1u << 21), phpDocs))) return zv::Val(); + if (UNEXPECTED(!ptsh::getPhpDocs(OBJ_PROP_NUM(self, slots::phpDocsResolver), scope, stmt, 0x1FFFFu | (1u << 20) | (1u << 21) | (1u << 22), phpDocs))) return zv::Val(); zval *docs[PT_PHP_DOCS_COUNT]; for (uint32_t index = 0; index < PT_PHP_DOCS_COUNT; index++) docs[index] = &phpDocs.items[index]; zval *templateTypeMap = docs[0]; @@ -222,6 +223,7 @@ class ClassMethodHandler zval *phpDocParameterOutTypes = docs[16]; zval *pureUnlessCallableIsImpureParameters = docs[20]; zval *pureUnlessParameterPassedParameters = docs[21]; + zval *phpDocClosureScopeTypeParameters = docs[22]; zval *params = ptsh::readNodeProperty(pt_cmh_params_site, stmt, PT_LC("params")); if (UNEXPECTED(params == NULL)) return zv::Val(); @@ -261,7 +263,7 @@ class ClassMethodHandler isConstructor = Z_TYPE_P(identifier) == IS_STRING && zend_string_equals_literal_ci(Z_STR_P(identifier), "__construct"); } - zval enterArgv[21]; + zval enterArgv[22]; ZVAL_COPY_VALUE(&enterArgv[0], stmt); ZVAL_COPY_VALUE(&enterArgv[1], templateTypeMap); ZVAL_COPY_VALUE(&enterArgv[2], phpDocParameterTypes); @@ -283,6 +285,7 @@ class ClassMethodHandler ZVAL_NULL(&enterArgv[18]); ZVAL_COPY_VALUE(&enterArgv[19], pureUnlessCallableIsImpureParameters); ZVAL_COPY_VALUE(&enterArgv[20], pureUnlessParameterPassedParameters); + ZVAL_COPY_VALUE(&enterArgv[21], phpDocClosureScopeTypeParameters); zv::Val methodScope = pt_mutating_scope_enter_class_method(Z_OBJ_P(scope), enterArgv); if (UNEXPECTED(methodScope.isUndef())) return zv::Val(); diff --git a/turbo-ext/src/ExtendedDummyParameter.cpp b/turbo-ext/src/ExtendedDummyParameter.cpp index e6802d20f31..6a2c0fbaca1 100644 --- a/turbo-ext/src/ExtendedDummyParameter.cpp +++ b/turbo-ext/src/ExtendedDummyParameter.cpp @@ -2,7 +2,7 @@ * PHPStanTurbo\ExtendedDummyParameter — native implementation of * PHPStan\Reflection\Php\ExtendedDummyParameter. * - * Final, extending the shadowing DummyParameter: its nine promoted slots + * Final, extending the shadowing DummyParameter: its ten promoted slots * follow the parent's six (generated declarations), the constructor writes * them and runs the parent's constructor body directly * (pt_dummy_parameter_construct() — the parent method is native, nothing can @@ -30,9 +30,9 @@ class ExtendedDummyParameter explicit ExtendedDummyParameter(zend_object *self) : self(self) {} /* the promoted slots in parameter order, then parent::__construct() - * (argv: the constructor's fifteen arguments, NULL / IS_NULL for the + * (argv: the constructor's sixteen arguments, NULL / IS_NULL for the * nullable nulls); false = pending exception */ - [[nodiscard]] bool construct(zend_string *name, zval *type, bool optional, zval *passedByReference, bool variadic, zval *defaultValue, zval *nativeType, zval *phpDocType, zval *outType, zval *immediatelyInvokedCallable, zval *closureThisType, zval *attributes, zval *allowedConstants, zval *pureUnlessCallableIsImpureParameter, zval *pureUnlessParameterPassedParameter) const + [[nodiscard]] bool construct(zend_string *name, zval *type, bool optional, zval *passedByReference, bool variadic, zval *defaultValue, zval *nativeType, zval *phpDocType, zval *outType, zval *immediatelyInvokedCallable, zval *closureThisType, zval *attributes, zval *allowedConstants, zval *pureUnlessCallableIsImpureParameter, zval *pureUnlessParameterPassedParameter, zval *closureScopeType) const { write(slots::nativeType, nativeType); write(slots::phpDocType, phpDocType); @@ -43,6 +43,7 @@ class ExtendedDummyParameter write(slots::allowedConstants, allowedConstants); write(slots::pureUnlessCallableIsImpureParameter, pureUnlessCallableIsImpureParameter); write(slots::pureUnlessParameterPassedParameter, pureUnlessParameterPassedParameter); + write(slots::closureScopeType, closureScopeType); return pt_dummy_parameter_construct(self, name, type, optional, passedByReference, variadic, defaultValue); } @@ -55,6 +56,7 @@ class ExtendedDummyParameter zv::Val getAllowedConstants() const { return copyOf(slots::allowedConstants, "allowedConstants"); } zv::Val isPureUnlessCallableIsImpureParameter() const { return copyOf(slots::pureUnlessCallableIsImpureParameter, "pureUnlessCallableIsImpureParameter"); } zv::Val isPureUnlessParameterPassedParameter() const { return copyOf(slots::pureUnlessParameterPassedParameter, "pureUnlessParameterPassedParameter"); } + zv::Val getClosureScopeType() const { return copyOf(slots::closureScopeType, "closureScopeType"); } /* !$this->nativeType instanceof MixedType || $this->nativeType->isExplicitMixed(); * false = pending exception */ @@ -138,18 +140,21 @@ using phpstanturbo::ExtendedDummyParameter; zv::Val pt_extended_dummy_parameter_new(uint32_t argc, zval *argv) { - if (EXPECTED(argc == 15)) { + /* $closureScopeType is optional: fifteen arguments leave it null */ + if (EXPECTED(argc == 15 || argc == 16)) { zval *name = &argv[0], *optional = &argv[2], *passedByReference = &argv[3], *variadic = &argv[4], *defaultValue = &argv[5]; zval *outType = &argv[8], *closureThisType = &argv[10], *attributes = &argv[11], *allowedConstants = &argv[12]; + zval *closureScopeType = argc == 16 ? &argv[15] : NULL; auto isBool = [](zval *value) { return Z_TYPE_P(value) == IS_TRUE || Z_TYPE_P(value) == IS_FALSE; }; auto isObjectOrNull = [](zval *value) { return Z_TYPE_P(value) == IS_OBJECT || Z_TYPE_P(value) == IS_NULL; }; if (EXPECTED(Z_TYPE_P(name) == IS_STRING && Z_TYPE(argv[1]) == IS_OBJECT && isBool(optional) && isObjectOrNull(passedByReference) && isBool(variadic) && isObjectOrNull(defaultValue) && Z_TYPE(argv[6]) == IS_OBJECT && Z_TYPE(argv[7]) == IS_OBJECT && isObjectOrNull(outType) && Z_TYPE(argv[9]) == IS_OBJECT && isObjectOrNull(closureThisType) - && Z_TYPE_P(attributes) == IS_ARRAY && isObjectOrNull(allowedConstants) && Z_TYPE(argv[13]) == IS_OBJECT && Z_TYPE(argv[14]) == IS_OBJECT)) { + && Z_TYPE_P(attributes) == IS_ARRAY && isObjectOrNull(allowedConstants) && Z_TYPE(argv[13]) == IS_OBJECT && Z_TYPE(argv[14]) == IS_OBJECT + && (closureScopeType == NULL || isObjectOrNull(closureScopeType)))) { zval object; if (UNEXPECTED(object_init_ex(&object, pt_ce_extended_dummy_parameter) != SUCCESS)) return zv::Val(); zv::Val result = zv::Val::adopt(object); - if (UNEXPECTED(!ExtendedDummyParameter(Z_OBJ_P(result.raw())).construct(Z_STR_P(name), &argv[1], Z_TYPE_P(optional) == IS_TRUE, Z_TYPE_P(passedByReference) == IS_NULL ? NULL : passedByReference, Z_TYPE_P(variadic) == IS_TRUE, Z_TYPE_P(defaultValue) == IS_NULL ? NULL : defaultValue, &argv[6], &argv[7], outType, &argv[9], closureThisType, attributes, allowedConstants, &argv[13], &argv[14]))) return zv::Val(); + if (UNEXPECTED(!ExtendedDummyParameter(Z_OBJ_P(result.raw())).construct(Z_STR_P(name), &argv[1], Z_TYPE_P(optional) == IS_TRUE, Z_TYPE_P(passedByReference) == IS_NULL ? NULL : passedByReference, Z_TYPE_P(variadic) == IS_TRUE, Z_TYPE_P(defaultValue) == IS_NULL ? NULL : defaultValue, &argv[6], &argv[7], outType, &argv[9], closureThisType, attributes, allowedConstants, &argv[13], &argv[14], closureScopeType))) return zv::Val(); return result; } } @@ -174,9 +179,9 @@ PT_MINIT_REGISTRATION(pt_register_extended_dummy_parameter) cls.method(sigs::__construct, [](INTERNAL_FUNCTION_PARAMETERS) { zend_string *name; - zval *type, *passedByReference = NULL, *defaultValue = NULL, *nativeType, *phpDocType, *outType = NULL, *immediatelyInvokedCallable, *closureThisType = NULL, *attributes, *allowedConstants = NULL, *pureUnlessCallableIsImpureParameter, *pureUnlessParameterPassedParameter; + zval *type, *passedByReference = NULL, *defaultValue = NULL, *nativeType, *phpDocType, *outType = NULL, *immediatelyInvokedCallable, *closureThisType = NULL, *attributes, *allowedConstants = NULL, *pureUnlessCallableIsImpureParameter, *pureUnlessParameterPassedParameter, *closureScopeType = NULL; bool optional, variadic; - ZEND_PARSE_PARAMETERS_START(15, 15) + ZEND_PARSE_PARAMETERS_START(15, 16) Z_PARAM_STR(name) Z_PARAM_OBJECT(type) Z_PARAM_BOOL(optional) @@ -192,8 +197,10 @@ PT_MINIT_REGISTRATION(pt_register_extended_dummy_parameter) Z_PARAM_OBJECT_OR_NULL(allowedConstants) Z_PARAM_OBJECT(pureUnlessCallableIsImpureParameter) Z_PARAM_OBJECT(pureUnlessParameterPassedParameter) + Z_PARAM_OPTIONAL + Z_PARAM_OBJECT_OR_NULL(closureScopeType) ZEND_PARSE_PARAMETERS_END(); - if (UNEXPECTED(!PT_EDP_THIS.construct(name, type, optional, passedByReference, variadic, defaultValue, nativeType, phpDocType, outType, immediatelyInvokedCallable, closureThisType, attributes, allowedConstants, pureUnlessCallableIsImpureParameter, pureUnlessParameterPassedParameter))) RETURN_THROWS(); + if (UNEXPECTED(!PT_EDP_THIS.construct(name, type, optional, passedByReference, variadic, defaultValue, nativeType, phpDocType, outType, immediatelyInvokedCallable, closureThisType, attributes, allowedConstants, pureUnlessCallableIsImpureParameter, pureUnlessParameterPassedParameter, closureScopeType))) RETURN_THROWS(); }); cls.method<&ExtendedDummyParameter::getPhpDocType>(sigs::getPhpDocType); @@ -202,6 +209,7 @@ PT_MINIT_REGISTRATION(pt_register_extended_dummy_parameter) cls.method<&ExtendedDummyParameter::getOutType>(sigs::getOutType); cls.method<&ExtendedDummyParameter::isImmediatelyInvokedCallable>(sigs::isImmediatelyInvokedCallable); cls.method<&ExtendedDummyParameter::getClosureThisType>(sigs::getClosureThisType); + cls.method<&ExtendedDummyParameter::getClosureScopeType>(sigs::getClosureScopeType); cls.method<&ExtendedDummyParameter::getAttributes>(sigs::getAttributes); cls.method<&ExtendedDummyParameter::getAllowedConstants>(sigs::getAllowedConstants); diff --git a/turbo-ext/src/ExtendedNativeParameterReflection.cpp b/turbo-ext/src/ExtendedNativeParameterReflection.cpp index 5bb91e62362..dfdd6428308 100644 --- a/turbo-ext/src/ExtendedNativeParameterReflection.cpp +++ b/turbo-ext/src/ExtendedNativeParameterReflection.cpp @@ -2,7 +2,7 @@ * PHPStanTurbo\ExtendedNativeParameterReflection — native implementation of * PHPStan\Reflection\Native\ExtendedNativeParameterReflection. * - * A final value class over its fifteen promoted slots in the twin's order: + * A final value class over its sixteen promoted slots in the twin's order: * every getter returns its slot, hasNativeType() asks the native type * whether it is an explicit mixed, checkAllowedConstants() delegates to the * PHP ParameterAllowedConstants. Native callers read the getters through @@ -56,7 +56,7 @@ class ExtendedNativeParameterReflection /* the promoted slots in parameter order (borrowed; NULL for a nullable * null) */ - void construct(zend_string *name, bool optional, zval *type, zval *phpDocType, zval *nativeType, zval *passedByReference, bool variadic, zval *defaultValue, zval *outType, zval *immediatelyInvokedCallable, zval *closureThisType, zval *attributes, zval *allowedConstants, zval *pureUnlessCallableIsImpureParameter, zval *pureUnlessParameterPassedParameter) const + void construct(zend_string *name, bool optional, zval *type, zval *phpDocType, zval *nativeType, zval *passedByReference, bool variadic, zval *defaultValue, zval *outType, zval *immediatelyInvokedCallable, zval *closureThisType, zval *attributes, zval *allowedConstants, zval *pureUnlessCallableIsImpureParameter, zval *pureUnlessParameterPassedParameter, zval *closureScopeType) const { zval value; ZVAL_STR(&value, name); @@ -77,6 +77,7 @@ class ExtendedNativeParameterReflection writeNullable(slots::allowedConstants, allowedConstants); pt_write_slot(self, slots::pureUnlessCallableIsImpureParameter, pureUnlessCallableIsImpureParameter); pt_write_slot(self, slots::pureUnlessParameterPassedParameter, pureUnlessParameterPassedParameter); + writeNullable(slots::closureScopeType, closureScopeType); } zv::Val getName() const { return copyOf(slots::name, "name"); } @@ -128,6 +129,7 @@ class ExtendedNativeParameterReflection zv::Val isPureUnlessCallableIsImpureParameter() const { return copyOf(slots::pureUnlessCallableIsImpureParameter, "pureUnlessCallableIsImpureParameter"); } zv::Val isPureUnlessParameterPassedParameter() const { return copyOf(slots::pureUnlessParameterPassedParameter, "pureUnlessParameterPassedParameter"); } + zv::Val getClosureScopeType() const { return copyOf(slots::closureScopeType, "closureScopeType"); } private: zend_object *self; @@ -161,16 +163,18 @@ using phpstanturbo::ExtendedNativeParameterReflection; zv::Val pt_extended_native_parameter_reflection_new(uint32_t argc, zval *argv) { - if (EXPECTED(argc == 15)) { + /* $closureScopeType is optional: fifteen arguments leave it null */ + if (EXPECTED(argc == 15 || argc == 16)) { auto isBool = [](zval *value) { return Z_TYPE_P(value) == IS_TRUE || Z_TYPE_P(value) == IS_FALSE; }; auto isObjectOrNull = [](zval *value) { return Z_TYPE_P(value) == IS_OBJECT || Z_TYPE_P(value) == IS_NULL; }; if (EXPECTED(Z_TYPE(argv[0]) == IS_STRING && isBool(&argv[1]) && Z_TYPE(argv[2]) == IS_OBJECT && Z_TYPE(argv[3]) == IS_OBJECT && Z_TYPE(argv[4]) == IS_OBJECT && Z_TYPE(argv[5]) == IS_OBJECT && isBool(&argv[6]) && isObjectOrNull(&argv[7]) && isObjectOrNull(&argv[8]) && Z_TYPE(argv[9]) == IS_OBJECT - && isObjectOrNull(&argv[10]) && Z_TYPE(argv[11]) == IS_ARRAY && isObjectOrNull(&argv[12]) && Z_TYPE(argv[13]) == IS_OBJECT && Z_TYPE(argv[14]) == IS_OBJECT)) { + && isObjectOrNull(&argv[10]) && Z_TYPE(argv[11]) == IS_ARRAY && isObjectOrNull(&argv[12]) && Z_TYPE(argv[13]) == IS_OBJECT && Z_TYPE(argv[14]) == IS_OBJECT + && (argc == 15 || isObjectOrNull(&argv[15])))) { zval object; if (UNEXPECTED(object_init_ex(&object, pt_ce_extended_native_parameter_reflection) != SUCCESS)) return zv::Val(); auto orNull = [](zval *value) { return Z_TYPE_P(value) == IS_NULL ? NULL : value; }; - ExtendedNativeParameterReflection(Z_OBJ(object)).construct(Z_STR(argv[0]), Z_TYPE(argv[1]) == IS_TRUE, &argv[2], &argv[3], &argv[4], &argv[5], Z_TYPE(argv[6]) == IS_TRUE, orNull(&argv[7]), orNull(&argv[8]), &argv[9], orNull(&argv[10]), &argv[11], orNull(&argv[12]), &argv[13], &argv[14]); + ExtendedNativeParameterReflection(Z_OBJ(object)).construct(Z_STR(argv[0]), Z_TYPE(argv[1]) == IS_TRUE, &argv[2], &argv[3], &argv[4], &argv[5], Z_TYPE(argv[6]) == IS_TRUE, orNull(&argv[7]), orNull(&argv[8]), &argv[9], orNull(&argv[10]), &argv[11], orNull(&argv[12]), &argv[13], &argv[14], argc == 16 ? orNull(&argv[15]) : NULL); return zv::Val::adopt(object); } } @@ -203,6 +207,7 @@ zv::Val pt_extended_native_parameter_reflection_call(zend_object *parameter, pt_ case PT_PR_GET_ALLOWED_CONSTANTS: return reflection.getAllowedConstants(); case PT_PR_IS_PURE_UNLESS_CALLABLE_IS_IMPURE_PARAMETER: return reflection.isPureUnlessCallableIsImpureParameter(); case PT_PR_IS_PURE_UNLESS_PARAMETER_PASSED_PARAMETER: return reflection.isPureUnlessParameterPassedParameter(); + case PT_PR_GET_CLOSURE_SCOPE_TYPE: return reflection.getClosureScopeType(); case PT_PR_MEMBER_COUNT: break; } ZEND_UNREACHABLE(); @@ -226,8 +231,8 @@ PT_MINIT_REGISTRATION(pt_register_extended_native_parameter_reflection) cls.method(sigs::__construct, [](INTERNAL_FUNCTION_PARAMETERS) { zend_string *name; bool optional, variadic; - zval *type, *phpDocType, *nativeType, *passedByReference, *defaultValue = NULL, *outType = NULL, *immediatelyInvokedCallable, *closureThisType = NULL, *attributes, *allowedConstants = NULL, *pureUnlessCallableIsImpureParameter, *pureUnlessParameterPassedParameter; - ZEND_PARSE_PARAMETERS_START(15, 15) + zval *type, *phpDocType, *nativeType, *passedByReference, *defaultValue = NULL, *outType = NULL, *immediatelyInvokedCallable, *closureThisType = NULL, *attributes, *allowedConstants = NULL, *pureUnlessCallableIsImpureParameter, *pureUnlessParameterPassedParameter, *closureScopeType = NULL; + ZEND_PARSE_PARAMETERS_START(15, 16) Z_PARAM_STR(name) Z_PARAM_BOOL(optional) Z_PARAM_OBJECT(type) @@ -243,8 +248,10 @@ PT_MINIT_REGISTRATION(pt_register_extended_native_parameter_reflection) Z_PARAM_OBJECT_OR_NULL(allowedConstants) Z_PARAM_OBJECT(pureUnlessCallableIsImpureParameter) Z_PARAM_OBJECT(pureUnlessParameterPassedParameter) + Z_PARAM_OPTIONAL + Z_PARAM_OBJECT_OR_NULL(closureScopeType) ZEND_PARSE_PARAMETERS_END(); - PT_ENPR_THIS.construct(name, optional, type, phpDocType, nativeType, passedByReference, variadic, defaultValue, outType, immediatelyInvokedCallable, closureThisType, attributes, allowedConstants, pureUnlessCallableIsImpureParameter, pureUnlessParameterPassedParameter); + PT_ENPR_THIS.construct(name, optional, type, phpDocType, nativeType, passedByReference, variadic, defaultValue, outType, immediatelyInvokedCallable, closureThisType, attributes, allowedConstants, pureUnlessCallableIsImpureParameter, pureUnlessParameterPassedParameter, closureScopeType); }); cls.method<&ExtendedNativeParameterReflection::getName>(sigs::getName); @@ -278,6 +285,7 @@ PT_MINIT_REGISTRATION(pt_register_extended_native_parameter_reflection) cls.method<&ExtendedNativeParameterReflection::isPureUnlessCallableIsImpureParameter>(sigs::isPureUnlessCallableIsImpureParameter); cls.method<&ExtendedNativeParameterReflection::isPureUnlessParameterPassedParameter>(sigs::isPureUnlessParameterPassedParameter); + cls.method<&ExtendedNativeParameterReflection::getClosureScopeType>(sigs::getClosureScopeType); cls.shadow(&pt_ce_extended_native_parameter_reflection); } diff --git a/turbo-ext/src/FunctionHandler.cpp b/turbo-ext/src/FunctionHandler.cpp index a45072e6cf7..a29e0e07e03 100644 --- a/turbo-ext/src/FunctionHandler.cpp +++ b/turbo-ext/src/FunctionHandler.cpp @@ -120,8 +120,8 @@ class FunctionHandler collect(dependencies, attributeDependencies.raw()); /* [$templateTypeMap, ..., $isInternal, , $isPure, $acceptsNamedArguments, , * $phpDocComment, $asserts,, $phpDocParameterOutTypes, , , , $pureUnlessCallableIsImpureParameters, - * $pureUnlessParameterPassedParameters] */ - static constexpr uint32_t listIndexes[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 16, 20, 21 }; + * $pureUnlessParameterPassedParameters, $phpDocClosureScopeTypeParameters] */ + static constexpr uint32_t listIndexes[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 16, 20, 21, 22 }; uint32_t destructured = 0; for (uint32_t index : listIndexes) destructured |= 1u << index; pt_php_docs phpDocs; @@ -151,7 +151,7 @@ class FunctionHandler deprecatedDescription = attributeDeprecatedDescription.raw(); } - zval enterArgv[17]; + zval enterArgv[18]; ZVAL_COPY_VALUE(&enterArgv[0], stmt); ZVAL_COPY_VALUE(&enterArgv[1], docs[0]); ZVAL_COPY_VALUE(&enterArgv[2], docs[1]); @@ -169,6 +169,7 @@ class FunctionHandler ZVAL_COPY_VALUE(&enterArgv[14], docs[3]); ZVAL_COPY_VALUE(&enterArgv[15], docs[20]); ZVAL_COPY_VALUE(&enterArgv[16], docs[21]); + ZVAL_COPY_VALUE(&enterArgv[17], docs[22]); zv::Val functionScope = pt_mutating_scope_enter_function(Z_OBJ_P(scope), enterArgv); if (UNEXPECTED(functionScope.isUndef())) return zv::Val(); zv::Val functionReflection = pt_mutating_scope_get_function(Z_OBJ_P(functionScope.raw())); diff --git a/turbo-ext/src/MutatingScope.cpp b/turbo-ext/src/MutatingScope.cpp index 1138b46ed9a..13f84c8428e 100644 --- a/turbo-ext/src/MutatingScope.cpp +++ b/turbo-ext/src/MutatingScope.cpp @@ -4139,7 +4139,7 @@ class MutatingScope static zv::Val emptyAssertions() { return pt_assertions_create_empty(); } /** @api (twin 2012) */ - zv::Val enterClassMethod(zval *classMethod, zval *templateTypeMap, zval *phpDocParameterTypes, zval *phpDocReturnType, zval *throwType, zval *deprecatedDescription, bool isDeprecated, bool isInternal, bool isFinal, zval *isPure, bool acceptsNamedArguments, zval *asserts, zval *selfOutType, zval *phpDocComment, zval *parameterOutTypes, zval *immediatelyInvokedCallableParameters, zval *phpDocClosureThisTypeParameters, bool isConstructor, zval *resolvedPhpDocBlock, zval *phpDocPureUnlessCallableIsImpureParameters, zval *phpDocPureUnlessParameterPassedParameters) + zv::Val enterClassMethod(zval *classMethod, zval *templateTypeMap, zval *phpDocParameterTypes, zval *phpDocReturnType, zval *throwType, zval *deprecatedDescription, bool isDeprecated, bool isInternal, bool isFinal, zval *isPure, bool acceptsNamedArguments, zval *asserts, zval *selfOutType, zval *phpDocComment, zval *parameterOutTypes, zval *immediatelyInvokedCallableParameters, zval *phpDocClosureThisTypeParameters, bool isConstructor, zval *resolvedPhpDocBlock, zval *phpDocPureUnlessCallableIsImpureParameters, zval *phpDocPureUnlessParameterPassedParameters, zval *phpDocClosureScopeTypeParameters) { bool inClass; if (UNEXPECTED(!thisIsInClass(inClass))) return zv::Val(); @@ -4149,7 +4149,7 @@ class MutatingScope } zend_object *classMethodObject = Z_OBJ_P(classMethod); - Args<29> a; + Args<30> a; PT_MS_ARG_OWNED(a, thisGetClassReflection()); a.add(zv::Ref(classMethod)); a.addNull(); @@ -4201,6 +4201,7 @@ class MutatingScope } a.add(zv::Ref(phpDocPureUnlessCallableIsImpureParameters)); a.add(zv::Ref(phpDocPureUnlessParameterPassedParameters)); + PT_MS_ARG_OWNED(a, mapToArgument(phpDocClosureScopeTypeParameters, true)); zv::Val reflection = pt_type_new(PT_CLASS_PHP_METHOD_FROM_PARSER_NODE_REFLECTION, a.count, a.argv); if (UNEXPECTED(reflection.isUndef())) return zv::Val(); @@ -4373,7 +4374,7 @@ class MutatingScope } /** @api (twin 2237) */ - zv::Val enterFunction(zval *function, zval *templateTypeMap, zval *phpDocParameterTypes, zval *phpDocReturnType, zval *throwType, zval *deprecatedDescription, bool isDeprecated, bool isInternal, zval *isPure, bool acceptsNamedArguments, zval *asserts, zval *phpDocComment, zval *parameterOutTypes, zval *immediatelyInvokedCallableParameters, zval *phpDocClosureThisTypeParameters, zval *pureUnlessCallableIsImpureParameters, zval *pureUnlessParameterPassedParameters) + zv::Val enterFunction(zval *function, zval *templateTypeMap, zval *phpDocParameterTypes, zval *phpDocReturnType, zval *throwType, zval *deprecatedDescription, bool isDeprecated, bool isInternal, zval *isPure, bool acceptsNamedArguments, zval *asserts, zval *phpDocComment, zval *parameterOutTypes, zval *immediatelyInvokedCallableParameters, zval *phpDocClosureThisTypeParameters, zval *pureUnlessCallableIsImpureParameters, zval *pureUnlessParameterPassedParameters, zval *phpDocClosureScopeTypeParameters) { zend_object *functionObject = Z_OBJ_P(function); Args<28> a; @@ -4418,6 +4419,7 @@ class MutatingScope } a.add(zv::Ref(pureUnlessCallableIsImpureParameters)); a.add(zv::Ref(pureUnlessParameterPassedParameters)); + a.add(zv::Ref(phpDocClosureScopeTypeParameters)); zv::Val reflection = pt_type_new(PT_CLASS_PHP_FUNCTION_FROM_PARSER_NODE_REFLECTION, a.count, a.argv); if (UNEXPECTED(reflection.isUndef())) return zv::Val(); @@ -11830,10 +11832,10 @@ zv::Val pt_mutating_scope_enter_class_method(zend_object *scope, zval *argv) && msIsBool(&argv[6]) && msIsBool(&argv[7]) && msIsBool(&argv[8]) && msIsBoolOrNull(&argv[9]) && msIsBool(&argv[10]) && msIsObjectOrNull(&argv[11]) && msIsObjectOrNull(&argv[12]) && msIsStringOrNull(&argv[13]) && Z_TYPE(argv[14]) == IS_ARRAY && Z_TYPE(argv[15]) == IS_ARRAY && Z_TYPE(argv[16]) == IS_ARRAY - && msIsBool(&argv[17]) && msIsObjectOrNull(&argv[18]) && Z_TYPE(argv[19]) == IS_ARRAY && Z_TYPE(argv[20]) == IS_ARRAY)) { - return MutatingScope(scope).enterClassMethod(&argv[0], &argv[1], &argv[2], &argv[3], &argv[4], &argv[5], Z_TYPE(argv[6]) == IS_TRUE, Z_TYPE(argv[7]) == IS_TRUE, Z_TYPE(argv[8]) == IS_TRUE, &argv[9], Z_TYPE(argv[10]) == IS_TRUE, &argv[11], &argv[12], &argv[13], &argv[14], &argv[15], &argv[16], Z_TYPE(argv[17]) == IS_TRUE, &argv[18], &argv[19], &argv[20]); + && msIsBool(&argv[17]) && msIsObjectOrNull(&argv[18]) && Z_TYPE(argv[19]) == IS_ARRAY && Z_TYPE(argv[20]) == IS_ARRAY && Z_TYPE(argv[21]) == IS_ARRAY)) { + return MutatingScope(scope).enterClassMethod(&argv[0], &argv[1], &argv[2], &argv[3], &argv[4], &argv[5], Z_TYPE(argv[6]) == IS_TRUE, Z_TYPE(argv[7]) == IS_TRUE, Z_TYPE(argv[8]) == IS_TRUE, &argv[9], Z_TYPE(argv[10]) == IS_TRUE, &argv[11], &argv[12], &argv[13], &argv[14], &argv[15], &argv[16], Z_TYPE(argv[17]) == IS_TRUE, &argv[18], &argv[19], &argv[20], &argv[21]); } - return pt_type_call(scope, PT_LC("enterclassmethod"), 21, argv); + return pt_type_call(scope, PT_LC("enterclassmethod"), 22, argv); } zv::Val pt_mutating_scope_enter_function(zend_object *scope, zval *argv) @@ -11843,10 +11845,10 @@ zv::Val pt_mutating_scope_enter_function(zend_object *scope, zval *argv) && msIsObjectOrNull(&argv[3]) && msIsObjectOrNull(&argv[4]) && msIsStringOrNull(&argv[5]) && msIsBool(&argv[6]) && msIsBool(&argv[7]) && msIsBoolOrNull(&argv[8]) && msIsBool(&argv[9]) && msIsObjectOrNull(&argv[10]) && msIsStringOrNull(&argv[11]) - && Z_TYPE(argv[12]) == IS_ARRAY && Z_TYPE(argv[13]) == IS_ARRAY && Z_TYPE(argv[14]) == IS_ARRAY && Z_TYPE(argv[15]) == IS_ARRAY && Z_TYPE(argv[16]) == IS_ARRAY)) { - return MutatingScope(scope).enterFunction(&argv[0], &argv[1], &argv[2], &argv[3], &argv[4], &argv[5], Z_TYPE(argv[6]) == IS_TRUE, Z_TYPE(argv[7]) == IS_TRUE, &argv[8], Z_TYPE(argv[9]) == IS_TRUE, &argv[10], &argv[11], &argv[12], &argv[13], &argv[14], &argv[15], &argv[16]); + && Z_TYPE(argv[12]) == IS_ARRAY && Z_TYPE(argv[13]) == IS_ARRAY && Z_TYPE(argv[14]) == IS_ARRAY && Z_TYPE(argv[15]) == IS_ARRAY && Z_TYPE(argv[16]) == IS_ARRAY && Z_TYPE(argv[17]) == IS_ARRAY)) { + return MutatingScope(scope).enterFunction(&argv[0], &argv[1], &argv[2], &argv[3], &argv[4], &argv[5], Z_TYPE(argv[6]) == IS_TRUE, Z_TYPE(argv[7]) == IS_TRUE, &argv[8], Z_TYPE(argv[9]) == IS_TRUE, &argv[10], &argv[11], &argv[12], &argv[13], &argv[14], &argv[15], &argv[16], &argv[17]); } - return pt_type_call(scope, PT_LC("enterfunction"), 17, argv); + return pt_type_call(scope, PT_LC("enterfunction"), 18, argv); } zv::Val pt_mutating_scope_enter_class(zend_object *scope, zval *classReflection) @@ -12644,12 +12646,13 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) reg::withDefault(reg::obj("resolvedPhpDocBlock", resolvedPhpDocBlock, true), "null"), reg::withDefault(reg::arrayArg("phpDocPureUnlessCallableIsImpureParameters"), "[]"), reg::withDefault(reg::arrayArg("phpDocPureUnlessParameterPassedParameters"), "[]"), + reg::withDefault(reg::arrayArg("phpDocClosureScopeTypeParameters"), "[]"), }, [](INTERNAL_FUNCTION_PARAMETERS) { zval *classMethod, *templateTypeMapArg, *phpDocParameterTypes, *phpDocReturnType = NULL, *throwType = NULL, *asserts = NULL, *selfOutType = NULL, *resolvedPhpDocBlock = NULL; - zval *parameterOutTypes = NULL, *immediatelyInvokedCallableParameters = NULL, *phpDocClosureThisTypeParameters = NULL, *phpDocPureUnlessCallableIsImpureParameters = NULL, *phpDocPureUnlessParameterPassedParameters = NULL; + zval *parameterOutTypes = NULL, *immediatelyInvokedCallableParameters = NULL, *phpDocClosureThisTypeParameters = NULL, *phpDocPureUnlessCallableIsImpureParameters = NULL, *phpDocPureUnlessParameterPassedParameters = NULL, *phpDocClosureScopeTypeParameters = NULL; zend_string *deprecatedDescription = NULL, *phpDocComment = NULL; bool isDeprecated, isInternal, isFinal, isPure = false, isPureIsNull = true, acceptsNamedArguments = true, isConstructor = false; - ZEND_PARSE_PARAMETERS_START(9, 21) + ZEND_PARSE_PARAMETERS_START(9, 22) Z_PARAM_OBJECT(classMethod) Z_PARAM_OBJECT(templateTypeMapArg) Z_PARAM_ARRAY(phpDocParameterTypes) @@ -12672,6 +12675,7 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) Z_PARAM_OBJECT_OR_NULL(resolvedPhpDocBlock) Z_PARAM_ARRAY(phpDocPureUnlessCallableIsImpureParameters) Z_PARAM_ARRAY(phpDocPureUnlessParameterPassedParameters) + Z_PARAM_ARRAY(phpDocClosureScopeTypeParameters) ZEND_PARSE_PARAMETERS_END(); PT_MS_OBJ_ZVAL(phpDocReturnType); PT_MS_OBJ_ZVAL(throwType); @@ -12685,13 +12689,14 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) PT_MS_ARRAY_ZVAL(phpDocClosureThisTypeParameters); PT_MS_ARRAY_ZVAL(phpDocPureUnlessCallableIsImpureParameters); PT_MS_ARRAY_ZVAL(phpDocPureUnlessParameterPassedParameters); + PT_MS_ARRAY_ZVAL(phpDocClosureScopeTypeParameters); zval isPureZv; if (isPureIsNull) { ZVAL_NULL(&isPureZv); } else { ZVAL_BOOL(&isPureZv, isPure); } - PT_RETURN_VAL(PT_THIS.enterClassMethod(classMethod, templateTypeMapArg, phpDocParameterTypes, phpDocReturnType, throwType, &deprecatedDescriptionZv, isDeprecated, isInternal, isFinal, &isPureZv, acceptsNamedArguments, asserts, selfOutType, &phpDocCommentZv, parameterOutTypes, immediatelyInvokedCallableParameters, phpDocClosureThisTypeParameters, isConstructor, resolvedPhpDocBlock, phpDocPureUnlessCallableIsImpureParameters, phpDocPureUnlessParameterPassedParameters)); + PT_RETURN_VAL(PT_THIS.enterClassMethod(classMethod, templateTypeMapArg, phpDocParameterTypes, phpDocReturnType, throwType, &deprecatedDescriptionZv, isDeprecated, isInternal, isFinal, &isPureZv, acceptsNamedArguments, asserts, selfOutType, &phpDocCommentZv, parameterOutTypes, immediatelyInvokedCallableParameters, phpDocClosureThisTypeParameters, isConstructor, resolvedPhpDocBlock, phpDocPureUnlessCallableIsImpureParameters, phpDocPureUnlessParameterPassedParameters, phpDocClosureScopeTypeParameters)); }, &returnsSelf); cls.method("enterPropertyHook", reg::Public, 10, { @@ -12757,12 +12762,13 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) reg::withDefault(reg::arrayArg("phpDocClosureThisTypeParameters"), "[]"), reg::withDefault(reg::arrayArg("pureUnlessCallableIsImpureParameters"), "[]"), reg::withDefault(reg::arrayArg("pureUnlessParameterPassedParameters"), "[]"), + reg::withDefault(reg::arrayArg("phpDocClosureScopeTypeParameters"), "[]"), }, [](INTERNAL_FUNCTION_PARAMETERS) { zval *function = NULL, *templateTypeMapArg = NULL, *phpDocParameterTypes = NULL, *phpDocReturnType = NULL, *throwType = NULL, *asserts = NULL; - zval *parameterOutTypes = NULL, *immediatelyInvokedCallableParameters = NULL, *phpDocClosureThisTypeParameters = NULL, *pureUnlessCallableIsImpureParameters = NULL, *pureUnlessParameterPassedParameters = NULL; + zval *parameterOutTypes = NULL, *immediatelyInvokedCallableParameters = NULL, *phpDocClosureThisTypeParameters = NULL, *pureUnlessCallableIsImpureParameters = NULL, *pureUnlessParameterPassedParameters = NULL, *phpDocClosureScopeTypeParameters = NULL; zend_string *deprecatedDescription = NULL, *phpDocComment = NULL; bool isDeprecated = false, isInternal = false, isPure = false, isPureIsNull = true, acceptsNamedArguments = true; - ZEND_PARSE_PARAMETERS_START(8, 17) + ZEND_PARSE_PARAMETERS_START(8, 18) Z_PARAM_OBJECT(function) Z_PARAM_OBJECT(templateTypeMapArg) Z_PARAM_ARRAY(phpDocParameterTypes) @@ -12781,6 +12787,7 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) Z_PARAM_ARRAY(phpDocClosureThisTypeParameters) Z_PARAM_ARRAY(pureUnlessCallableIsImpureParameters) Z_PARAM_ARRAY(pureUnlessParameterPassedParameters) + Z_PARAM_ARRAY(phpDocClosureScopeTypeParameters) ZEND_PARSE_PARAMETERS_END(); PT_MS_OBJ_ZVAL(phpDocReturnType); PT_MS_OBJ_ZVAL(throwType); @@ -12792,13 +12799,14 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) PT_MS_ARRAY_ZVAL(phpDocClosureThisTypeParameters); PT_MS_ARRAY_ZVAL(pureUnlessCallableIsImpureParameters); PT_MS_ARRAY_ZVAL(pureUnlessParameterPassedParameters); + PT_MS_ARRAY_ZVAL(phpDocClosureScopeTypeParameters); zval isPureZv; if (isPureIsNull) { ZVAL_NULL(&isPureZv); } else { ZVAL_BOOL(&isPureZv, isPure); } - PT_RETURN_VAL(PT_THIS.enterFunction(function, templateTypeMapArg, phpDocParameterTypes, phpDocReturnType, throwType, &deprecatedDescriptionZv, isDeprecated, isInternal, &isPureZv, acceptsNamedArguments, asserts, &phpDocCommentZv, parameterOutTypes, immediatelyInvokedCallableParameters, phpDocClosureThisTypeParameters, pureUnlessCallableIsImpureParameters, pureUnlessParameterPassedParameters)); + PT_RETURN_VAL(PT_THIS.enterFunction(function, templateTypeMapArg, phpDocParameterTypes, phpDocReturnType, throwType, &deprecatedDescriptionZv, isDeprecated, isInternal, &isPureZv, acceptsNamedArguments, asserts, &phpDocCommentZv, parameterOutTypes, immediatelyInvokedCallableParameters, phpDocClosureThisTypeParameters, pureUnlessCallableIsImpureParameters, pureUnlessParameterPassedParameters, phpDocClosureScopeTypeParameters)); }, &returnsSelf); cls.method<&MutatingScope::enterNamespace, zp::Str>(sigs::enterNamespace); diff --git a/turbo-ext/src/ParameterValues.h b/turbo-ext/src/ParameterValues.h index ac98305ad68..70cb54f8377 100644 --- a/turbo-ext/src/ParameterValues.h +++ b/turbo-ext/src/ParameterValues.h @@ -70,7 +70,7 @@ inline constexpr int8_t dummySlots[PT_PR_MEMBER_COUNT] = { /* PT_PR_PASSED_BY_REFERENCE */ (int8_t) ptdecl::DummyParameter::slot::passedByReference, /* PT_PR_IS_VARIADIC */ (int8_t) ptdecl::DummyParameter::slot::variadic, /* PT_PR_GET_DEFAULT_VALUE */ (int8_t) ptdecl::DummyParameter::slot::defaultValue, - PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, + PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, }; inline constexpr int8_t extendedDummySlots[PT_PR_MEMBER_COUNT] = { @@ -90,6 +90,7 @@ inline constexpr int8_t extendedDummySlots[PT_PR_MEMBER_COUNT] = { /* PT_PR_GET_ALLOWED_CONSTANTS */ (int8_t) ptdecl::ExtendedDummyParameter::slot::allowedConstants, /* PT_PR_IS_PURE_UNLESS_CALLABLE_IS_IMPURE_PARAMETER */ (int8_t) ptdecl::ExtendedDummyParameter::slot::pureUnlessCallableIsImpureParameter, /* PT_PR_IS_PURE_UNLESS_PARAMETER_PASSED_PARAMETER */ (int8_t) ptdecl::ExtendedDummyParameter::slot::pureUnlessParameterPassedParameter, + /* PT_PR_GET_CLOSURE_SCOPE_TYPE */ (int8_t) ptdecl::ExtendedDummyParameter::slot::closureScopeType, }; inline constexpr int8_t nativeSlots[PT_PR_MEMBER_COUNT] = { @@ -99,7 +100,7 @@ inline constexpr int8_t nativeSlots[PT_PR_MEMBER_COUNT] = { (int8_t) ptdecl::NativeParameterReflection::slot::passedByReference, (int8_t) ptdecl::NativeParameterReflection::slot::variadic, (int8_t) ptdecl::NativeParameterReflection::slot::defaultValue, - PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, + PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, PT_PV_NONE, }; inline constexpr int8_t extendedNativeSlots[PT_PR_MEMBER_COUNT] = { @@ -119,6 +120,7 @@ inline constexpr int8_t extendedNativeSlots[PT_PR_MEMBER_COUNT] = { (int8_t) ptdecl::ExtendedNativeParameterReflection::slot::allowedConstants, (int8_t) ptdecl::ExtendedNativeParameterReflection::slot::pureUnlessCallableIsImpureParameter, (int8_t) ptdecl::ExtendedNativeParameterReflection::slot::pureUnlessParameterPassedParameter, + (int8_t) ptdecl::ExtendedNativeParameterReflection::slot::closureScopeType, }; #undef PT_PV_NONE diff --git a/turbo-ext/src/ParametersAcceptorSelector.cpp b/turbo-ext/src/ParametersAcceptorSelector.cpp index c1869f628bd..f31b84f2515 100644 --- a/turbo-ext/src/ParametersAcceptorSelector.cpp +++ b/turbo-ext/src/ParametersAcceptorSelector.cpp @@ -253,6 +253,7 @@ enum ParameterGetter PG_ALLOWED_CONSTANTS, PG_PURE_UNLESS_CALLABLE_IS_IMPURE, PG_PURE_UNLESS_PARAMETER_PASSED, + PG_CLOSURE_SCOPE_TYPE, PG_COUNT, }; @@ -273,6 +274,7 @@ const pt_parameter_reflection_member pt_pas_parameter_members[PG_COUNT] = { PT_PR_GET_ALLOWED_CONSTANTS, PT_PR_IS_PURE_UNLESS_CALLABLE_IS_IMPURE_PARAMETER, PT_PR_IS_PURE_UNLESS_PARAMETER_PASSED_PARAMETER, + PT_PR_GET_CLOSURE_SCOPE_TYPE, }; /* $parameter->getX() (ParameterValues.h) */ @@ -749,6 +751,11 @@ class ParametersAcceptorSelector out = true; return true; } + if (UNEXPECTED(!optionalTypeHasTemplate(parameter, PG_CLOSURE_SCOPE_TYPE, has))) return false; + if (has) { + out = true; + return true; + } } zv::Val type = parameterGet(parameter, PG_TYPE); @@ -1130,14 +1137,14 @@ class ParametersAcceptorSelector return zv::Val(std::move(values)); } - /* new ExtendedDummyParameter(...$argv) over fifteen owned values */ + /* new ExtendedDummyParameter(...$argv) over sixteen owned values */ static zv::Val newExtendedDummyParameter(zv::Val *values) { - zval argv[15]; - for (int k = 0; k < 15; k++) { + zval argv[16]; + for (int k = 0; k < 16; k++) { ZVAL_COPY_VALUE(&argv[k], values[k].raw()); } - return pt_extended_dummy_parameter_new(15, argv); + return pt_extended_dummy_parameter_new(16, argv); } /* `$parameter instanceof ExtendedParameterReflection ? $parameter->getX() @@ -1158,7 +1165,7 @@ class ParametersAcceptorSelector * over its getters ($i + 1 > $minimumNumberOfParameters as optional) */ static zv::Val firstCombinedParameter(zval *parameter, bool isExtended, bool optional) { - zv::Val values[15]; + zv::Val values[16]; values[0] = parameterGet(parameter, PG_NAME); if (UNEXPECTED(values[0].isUndef())) return zv::Val(); values[1] = parameterGet(parameter, PG_TYPE); @@ -1174,7 +1181,7 @@ class ParametersAcceptorSelector { ParameterGetter getter; zv::Val (*fallback)(); - } extended[9] = { + } extended[10] = { { PG_NATIVE_TYPE, mixedDefault }, { PG_PHPDOC_TYPE, mixedDefault }, { PG_OUT_TYPE, nullDefault }, @@ -1184,8 +1191,9 @@ class ParametersAcceptorSelector { PG_ALLOWED_CONSTANTS, nullDefault }, { PG_PURE_UNLESS_CALLABLE_IS_IMPURE, noDefault }, { PG_PURE_UNLESS_PARAMETER_PASSED, noDefault }, + { PG_CLOSURE_SCOPE_TYPE, nullDefault }, }; - for (int k = 0; k < 9; k++) { + for (int k = 0; k < 10; k++) { values[6 + k] = extendedOr(parameter, isExtended, extended[k].getter, extended[k].fallback); if (UNEXPECTED(values[6 + k].isUndef())) return zv::Val(); } @@ -1229,6 +1237,8 @@ class ParametersAcceptorSelector if (UNEXPECTED(immediatelyInvokedCallable.isUndef())) return zv::Val(); zv::Val closureThisType = parameterGet(existing, PG_CLOSURE_THIS_TYPE); if (UNEXPECTED(closureThisType.isUndef())) return zv::Val(); + zv::Val closureScopeType = parameterGet(existing, PG_CLOSURE_SCOPE_TYPE); + if (UNEXPECTED(closureScopeType.isUndef())) return zv::Val(); zv::Val attributes = parameterGet(existing, PG_ATTRIBUTES); if (UNEXPECTED(attributes.isUndef())) return zv::Val(); if (isExtended) { @@ -1265,6 +1275,17 @@ class ParametersAcceptorSelector closureThisType = zv::Val::null(); } + zv::Val parameterClosureScopeType = parameterGet(parameter, PG_CLOSURE_SCOPE_TYPE); + if (UNEXPECTED(parameterClosureScopeType.isUndef())) return zv::Val(); + if (!parameterClosureScopeType.isNull() && !closureScopeType.isNull()) { + zv::Val again = parameterGet(parameter, PG_CLOSURE_SCOPE_TYPE); + if (UNEXPECTED(again.isUndef())) return zv::Val(); + closureScopeType = union2(closureScopeType.raw(), again.raw()); + if (UNEXPECTED(closureScopeType.isUndef())) return zv::Val(); + } else { + closureScopeType = zv::Val::null(); + } + zv::Val parameterImmediately = parameterGet(parameter, PG_IMMEDIATELY_INVOKED_CALLABLE); zend_long left = trinaryOf(parameterImmediately); if (UNEXPECTED(left < 0)) return zv::Val(); @@ -1283,6 +1304,7 @@ class ParametersAcceptorSelector outType = zv::Val::null(); immediatelyInvokedCallable = trinary(PT_TRI_MAYBE); closureThisType = zv::Val::null(); + closureScopeType = zv::Val::null(); } if (isParameterVariadic) { @@ -1363,7 +1385,7 @@ class ParametersAcceptorSelector if (UNEXPECTED(rightPassed < 0)) return zv::Val(); zv::Val pureUnlessParameterPassedParameter = leftPassed == rightPassed ? std::move(leftPureUnlessParameterPassed) : trinary(PT_TRI_MAYBE); - zv::Val values[15]; + zv::Val values[16]; { zv::Val existingName = parameterGet(existing, PG_NAME); if (UNEXPECTED(existingName.isUndef())) return zv::Val(); @@ -1405,6 +1427,7 @@ class ParametersAcceptorSelector values[12] = std::move(allowedConstants); values[13] = std::move(pureUnlessCallableIsImpureParameter); values[14] = std::move(pureUnlessParameterPassedParameter); + values[15] = std::move(closureScopeType); return newExtendedDummyParameter(values); } @@ -1474,7 +1497,7 @@ class ParametersAcceptorSelector if (UNEXPECTED(!isA(parameter, PT_CLASS_EXTENDED_PARAMETER_REFLECTION, isExtended))) return zv::Val(); if (isExtended) return zv::Val::copyOf(zv::Ref(parameter)); - zv::Val values[15]; + zv::Val values[16]; static const ParameterGetter getters[6] = { PG_NAME, PG_TYPE, PG_OPTIONAL, PG_PASSED_BY_REFERENCE, PG_VARIADIC, PG_DEFAULT_VALUE }; for (int k = 0; k < 6; k++) { values[k] = parameterGet(parameter, getters[k]); @@ -1491,6 +1514,7 @@ class ParametersAcceptorSelector values[12] = zv::Val::null(); values[13] = trinary(PT_TRI_NO); values[14] = trinary(PT_TRI_NO); + values[15] = zv::Val::null(); return newExtendedDummyParameter(values); } @@ -1499,7 +1523,7 @@ class ParametersAcceptorSelector { zv::Val wrapped = wrapParameter(original); if (UNEXPECTED(wrapped.isUndef())) return zv::Val(); - zv::Val values[15]; + zv::Val values[16]; values[0] = parameterGet(wrapped.raw(), PG_NAME); if (UNEXPECTED(values[0].isUndef())) return zv::Val(); values[1] = zv::Val::copyOf(zv::Ref(type)); @@ -1507,10 +1531,11 @@ class ParametersAcceptorSelector { int index; ParameterGetter getter; - } getters[11] = { + } getters[12] = { { 2, PG_OPTIONAL }, { 3, PG_PASSED_BY_REFERENCE }, { 4, PG_VARIADIC }, { 5, PG_DEFAULT_VALUE }, { 8, PG_OUT_TYPE }, { 9, PG_IMMEDIATELY_INVOKED_CALLABLE }, { 10, PG_CLOSURE_THIS_TYPE }, { 11, PG_ATTRIBUTES }, { 12, PG_ALLOWED_CONSTANTS }, { 13, PG_PURE_UNLESS_CALLABLE_IS_IMPURE }, { 14, PG_PURE_UNLESS_PARAMETER_PASSED }, + { 15, PG_CLOSURE_SCOPE_TYPE }, }; values[6] = zv::Val::copyOf(zv::Ref(nativeType)); values[7] = zv::Val::copyOf(zv::Ref(type)); diff --git a/turbo-ext/src/PhpClassReflectionExtension.cpp b/turbo-ext/src/PhpClassReflectionExtension.cpp index 89b432c2f41..50eacc617f9 100644 --- a/turbo-ext/src/PhpClassReflectionExtension.cpp +++ b/turbo-ext/src/PhpClassReflectionExtension.cpp @@ -1664,6 +1664,7 @@ class PhpClassReflectionExtension zv::Arr phpDocParameterOutTypes = zv::Arr::create(0); zv::Val immediatelyInvokedCallableParameters = zv::Val(zv::Arr::empty()); zv::Val closureThisParameters = zv::Val(zv::Arr::empty()); + zv::Val closureScopeParameters = zv::Val(zv::Arr::empty()); zv::Val currentResolvedPhpDoc = zv::Val::null(); zv::Val phpDocDeclaringClass = zv::Val::copyOf(zv::Ref(declaringClass)); bool phpDocFromStubs = false; @@ -1741,6 +1742,10 @@ class PhpClassReflectionExtension if (UNEXPECTED(closureThisTags.isUndef())) return zv::Val(); closureThisParameters = tagTypeMapOf(closureThisTags.raw()); if (UNEXPECTED(closureThisParameters.isUndef())) return zv::Val(); + zv::Val closureScopeTags = pt_resolved_php_doc_block_call(currentResolvedPhpDoc.raw(), PT_RPD_GET_PARAM_CLOSURE_SCOPE_TAGS); + if (UNEXPECTED(closureScopeTags.isUndef())) return zv::Val(); + closureScopeParameters = tagTypeMapOf(closureScopeTags.raw()); + if (UNEXPECTED(closureScopeParameters.isUndef())) return zv::Val(); zv::Val paramTags = pt_resolved_php_doc_block_call(currentResolvedPhpDoc.raw(), PT_RPD_GET_PARAM_TAGS); if (UNEXPECTED(paramTags.isUndef())) return zv::Val(); @@ -1825,7 +1830,7 @@ class PhpClassReflectionExtension } } - zv::Val variant = createNativeMethodVariant(declaringClassNameArg, methodNameArg, methodSignature, phpDocParameterTypes.raw(), phpDocReturnType.raw(), phpDocParameterNameMapping.raw(), phpDocParameterOutTypes.raw(), immediatelyInvokedCallableParameters.raw(), closureThisParameters.raw(), phpDocFromStubs, !isNamed); + zv::Val variant = createNativeMethodVariant(declaringClassNameArg, methodNameArg, methodSignature, phpDocParameterTypes.raw(), phpDocReturnType.raw(), phpDocParameterNameMapping.raw(), phpDocParameterOutTypes.raw(), immediatelyInvokedCallableParameters.raw(), closureThisParameters.raw(), phpDocFromStubs, !isNamed, closureScopeParameters.raw()); if (UNEXPECTED(variant.isUndef())) return zv::Val(); variants.push(std::move(variant)); lastResolvedPhpDoc = std::move(currentResolvedPhpDoc); @@ -1934,7 +1939,7 @@ class PhpClassReflectionExtension } /* Mirrors createNativeMethodVariant(). */ - zv::Val createNativeMethodVariant(zval *declaringClassName, zval *methodName, zval *methodSignature, zval *phpDocParameterTypes, zval *phpDocReturnType, zval *phpDocParameterNameMapping, zval *phpDocParameterOutTypes, zval *immediatelyInvokedCallableParameters, zval *closureThisParameters, bool phpDocFromStubs, bool usePhpDocParameterNames) + zv::Val createNativeMethodVariant(zval *declaringClassName, zval *methodName, zval *methodSignature, zval *phpDocParameterTypes, zval *phpDocReturnType, zval *phpDocParameterNameMapping, zval *phpDocParameterOutTypes, zval *immediatelyInvokedCallableParameters, zval *closureThisParameters, bool phpDocFromStubs, bool usePhpDocParameterNames, zval *closureScopeParameters) { bool ok; zv::Val signatureParameters = call(methodSignature, PT_LC("getparameters")); @@ -1986,6 +1991,12 @@ class PhpClassReflectionExtension closureThisType = zv::Val::copyOf(zv::Ref(storedClosureThis)); } + zv::Val closureScopeType = zv::Val::null(); + zval *storedClosureScope = issetIn(closureScopeParameters, phpDocParameterName.get()); + if (storedClosureScope != NULL) { + closureScopeType = zv::Val::copyOf(zv::Ref(storedClosureScope)); + } + bool isOptional = callBool(parameterSignature, PT_LC("isoptional"), 0, NULL, ok); if (UNEXPECTED(!ok)) return zv::Val(); zv::Val nativeType = call(parameterSignature, PT_LC("getnativetype")); @@ -2011,7 +2022,7 @@ class PhpClassReflectionExtension if (UNEXPECTED(mixedPhpDocType.isUndef())) return zv::Val(); } - zval args[15]; + zval args[16]; if (usePhpDocParameterNames) { ZVAL_STR(&args[0], phpDocParameterName.get()); } else { @@ -2031,7 +2042,8 @@ class PhpClassReflectionExtension ZVAL_COPY_VALUE(&args[12], allowedConstants.raw()); ZVAL_COPY_VALUE(&args[13], pureUnlessCallableIsImpure.raw()); ZVAL_COPY_VALUE(&args[14], pureUnlessParameterPassed.raw()); - zv::Val parameter = pt_extended_native_parameter_reflection_new(15, args); + ZVAL_COPY_VALUE(&args[15], closureScopeType.raw()); + zv::Val parameter = pt_extended_native_parameter_reflection_new(16, args); if (UNEXPECTED(parameter.isUndef())) return zv::Val(); parameters.push(std::move(parameter)); } @@ -2295,6 +2307,7 @@ class PhpClassReflectionExtension if (UNEXPECTED(templateTypeMap.isUndef())) return zv::Val(); zv::Val immediatelyInvokedCallableParameters = zv::Val(zv::Arr::empty()); zv::Val closureThisParameters = zv::Val(zv::Arr::empty()); + zv::Val closureScopeParameters = zv::Val(zv::Arr::empty()); zv::Val phpDocThrowType = zv::Val::null(); bool isInternal = false; bool isFinal = false; @@ -2315,6 +2328,10 @@ class PhpClassReflectionExtension if (UNEXPECTED(closureThisTags.isUndef())) return zv::Val(); closureThisParameters = tagTypeMapOf(closureThisTags.raw()); if (UNEXPECTED(closureThisParameters.isUndef())) return zv::Val(); + zv::Val closureScopeTags = pt_resolved_php_doc_block_call(resolvedPhpDoc.raw(), PT_RPD_GET_PARAM_CLOSURE_SCOPE_TAGS); + if (UNEXPECTED(closureScopeTags.isUndef())) return zv::Val(); + closureScopeParameters = tagTypeMapOf(closureScopeTags.raw()); + if (UNEXPECTED(closureScopeParameters.isUndef())) return zv::Val(); zv::Val pureUnless = pt_resolved_php_doc_block_call(resolvedPhpDoc.raw(), PT_RPD_GET_PARAMS_PURE_UNLESS_CALLABLE_IS_IMPURE); if (UNEXPECTED(pureUnless.isUndef())) return zv::Val(); if (Z_TYPE_P(pureUnless.raw()) == IS_ARRAY) { @@ -2485,7 +2502,7 @@ class PhpClassReflectionExtension zv::Val attributes = attributesOf(methodReflection, context.raw()); if (UNEXPECTED(attributes.isUndef())) return zv::Val(); - zval args[23]; + zval args[24]; ZVAL_COPY_VALUE(&args[0], actualDeclaringClass); ZVAL_COPY_VALUE(&args[1], declaringTrait.raw()); ZVAL_COPY_VALUE(&args[2], methodReflection); @@ -2513,7 +2530,8 @@ class PhpClassReflectionExtension ZVAL_COPY_VALUE(&args[20], attributes.raw()); ZVAL_COPY_VALUE(&args[21], pureUnlessCallableIsImpureParameters.raw()); ZVAL_COPY_VALUE(&args[22], pureUnlessParameterPassedParameters.raw()); - return call(slot(slots::methodReflectionFactory), PT_LC("create"), 23, args); + ZVAL_COPY_VALUE(&args[23], closureScopeParameters.raw()); + return call(slot(slots::methodReflectionFactory), PT_LC("create"), 24, args); } /* Mirrors getPhpDocReturnType(). */ @@ -2689,13 +2707,13 @@ class PhpClassReflectionExtension /* [$templateTypeMap, ..., $acceptsNamedArguments, , $phpDocComment, ..., * $phpDocParameterOutTypes, , , , $phpDocPureUnlessCallableIsImpureParameters, - * $phpDocPureUnlessParameterPassedParameters] */ + * $phpDocPureUnlessParameterPassedParameters, $phpDocClosureScopeTypeParameters] */ pt_php_docs phpDocs; - if (UNEXPECTED(!pt_php_docs_resolver_get_php_docs(slot(slots::phpDocsResolver), classScope.raw(), methodNode.raw(), 0x1EFFFu | (1u << 20) | (1u << 21), phpDocs))) return zv::Val(); + if (UNEXPECTED(!pt_php_docs_resolver_get_php_docs(slot(slots::phpDocsResolver), classScope.raw(), methodNode.raw(), 0x1EFFFu | (1u << 20) | (1u << 21) | (1u << 22), phpDocs))) return zv::Val(); zval *docs[PT_PHP_DOCS_COUNT]; for (uint32_t i = 0; i < PT_PHP_DOCS_COUNT; i++) docs[i] = &phpDocs.items[i]; - zval enterArgs[21]; + zval enterArgs[22]; ZVAL_COPY_VALUE(&enterArgs[0], methodNode.raw()); ZVAL_COPY_VALUE(&enterArgs[1], docs[0]); /* templateTypeMap */ ZVAL_COPY_VALUE(&enterArgs[2], docs[1]); /* phpDocParameterTypes */ @@ -2717,7 +2735,8 @@ class PhpClassReflectionExtension ZVAL_NULL(&enterArgs[18]); ZVAL_COPY_VALUE(&enterArgs[19], docs[20]); /* pureUnlessCallableIsImpureParameters */ ZVAL_COPY_VALUE(&enterArgs[20], docs[21]); /* pureUnlessParameterPassedParameters */ - zv::Val methodScope = call(classScope.raw(), PT_LC("enterclassmethod"), 21, enterArgs); + ZVAL_COPY_VALUE(&enterArgs[21], docs[22]); /* phpDocClosureScopeTypeParameters */ + zv::Val methodScope = call(classScope.raw(), PT_LC("enterclassmethod"), 22, enterArgs); if (UNEXPECTED(methodScope.isUndef())) return zv::Val(); zend_class_entry *expressionStmtCe = pt_class(PT_CLASS_EXPRESSION_STMT); diff --git a/turbo-ext/src/PhpDocsResolver.cpp b/turbo-ext/src/PhpDocsResolver.cpp index 61d43a60333..061594a1369 100644 --- a/turbo-ext/src/PhpDocsResolver.cpp +++ b/turbo-ext/src/PhpDocsResolver.cpp @@ -6,7 +6,7 @@ * arginfo so Nette autowires it. getPhpDocs() — asked by ClassMethodHandler, * FunctionHandler, PropertyHandler, PropertyHooksProcessor and * PhpClassReflectionExtension for every declaration — is exported as - * pt_php_docs_resolver_get_php_docs(), which hands the 22 values over + * pt_php_docs_resolver_get_php_docs(), which hands the 23 values over * without building the twin's array; the PHP method builds it. * * FileTypeMapper, PhpDocInheritanceResolver, ResolvedPhpDocBlock, the PHPDoc @@ -42,6 +42,7 @@ pt_method_site pt_pdr_resolve_php_doc_for_method_site; pt_method_site pt_pdr_var_tag_get_type_site; pt_method_site pt_pdr_param_tag_get_type_site; pt_method_site pt_pdr_param_closure_this_tag_get_type_site; +pt_method_site pt_pdr_param_closure_scope_tag_get_type_site; pt_method_site pt_pdr_param_out_tag_get_type_site; pt_method_site pt_pdr_return_tag_get_type_site; pt_method_site pt_pdr_return_tag_is_explicit_site; @@ -270,6 +271,7 @@ class PhpDocsResolver zv::Arr phpDocParameterTypes = zv::Arr::empty(); zv::Arr phpDocImmediatelyInvokedCallableParameters = zv::Arr::empty(); zv::Arr phpDocClosureThisTypeParameters = zv::Arr::empty(); + zv::Arr phpDocClosureScopeTypeParameters = zv::Arr::empty(); zv::Val phpDocReturnType = zv::Val::null(); zv::Val phpDocThrowType = zv::Val::null(); zv::Val deprecatedDescription = zv::Val::null(); @@ -419,6 +421,7 @@ class PhpDocsResolver } if (UNEXPECTED(!collectTagTypes(pt_resolved_php_doc_block_call(doc, PT_RPD_GET_PARAM_TAGS), pt_pdr_param_tag_get_type_site, true, scope, classReflection, phpDocParameterTypes))) return false; if (UNEXPECTED(!collectTagTypes(pt_resolved_php_doc_block_call(doc, PT_RPD_GET_PARAM_CLOSURE_THIS_TAGS), pt_pdr_param_closure_this_tag_get_type_site, true, scope, classReflection, phpDocClosureThisTypeParameters))) return false; + if (UNEXPECTED(!collectTagTypes(pt_resolved_php_doc_block_call(doc, PT_RPD_GET_PARAM_CLOSURE_SCOPE_TAGS), pt_pdr_param_closure_scope_tag_get_type_site, true, scope, classReflection, phpDocClosureScopeTypeParameters))) return false; if (UNEXPECTED(!collectTagTypes(pt_resolved_php_doc_block_call(doc, PT_RPD_GET_PARAM_OUT_TAGS), pt_pdr_param_out_tag_get_type_site, false, scope, classReflection, phpDocParameterOutTypes))) return false; if (isFunctionLike) { zv::Val returnTypeNode = nodeReturnType(node); @@ -517,6 +520,7 @@ class PhpDocsResolver moveInto(items[PT_PHP_DOCS_RESOLVED_PHP_DOC], resolvedPhpDoc); moveInto(items[PT_PHP_DOCS_PURE_UNLESS_CALLABLE_IS_IMPURE_PARAMETERS], phpDocPureUnlessCallableIsImpureParameters); moveInto(items[PT_PHP_DOCS_PURE_UNLESS_PARAMETER_PASSED_PARAMETERS], phpDocPureUnlessParameterPassedParameters); + moveInto(items[PT_PHP_DOCS_CLOSURE_SCOPE_TYPE_PARAMETERS], phpDocClosureScopeTypeParameters); return true; } @@ -728,7 +732,8 @@ class PhpDocsResolver } /* foreach ($tags as $paramName => $tag) — $types[$paramName] = - * $tag->getType(); for the @param / @param-closure-this tags (`paramTypes`) + * $tag->getType(); for the @param / @param-closure-this / + * @param-closure-scope tags (`paramTypes`) * an existing key is kept and a static type transformed in a class */ [[nodiscard]] bool collectTagTypes(zv::Val tags, pt_method_site &getTypeSite, bool paramTypes, zval *scope, zv::Val &classReflection, zv::Arr &types) const { diff --git a/turbo-ext/src/PhpParameterReflection.cpp b/turbo-ext/src/PhpParameterReflection.cpp index 8e66fe4e2cb..d5f3be23338 100644 --- a/turbo-ext/src/PhpParameterReflection.cpp +++ b/turbo-ext/src/PhpParameterReflection.cpp @@ -79,7 +79,7 @@ class PhpParameterReflection /* the promoted slots in parameter order (borrowed; NULL for a nullable * null) */ - void construct(zval *initializerExprTypeResolver, zval *reflection, zval *phpDocType, zval *declaringClass, zval *outType, zval *immediatelyInvokedCallable, zval *closureThisType, zval *attributes, zval *allowedConstants, zval *pureUnlessCallableIsImpureParameter, zval *pureUnlessParameterPassedParameter) const + void construct(zval *initializerExprTypeResolver, zval *reflection, zval *phpDocType, zval *declaringClass, zval *outType, zval *immediatelyInvokedCallable, zval *closureThisType, zval *attributes, zval *allowedConstants, zval *pureUnlessCallableIsImpureParameter, zval *pureUnlessParameterPassedParameter, zval *closureScopeType) const { pt_write_slot(self, slots::initializerExprTypeResolver, initializerExprTypeResolver); pt_write_slot(self, slots::reflection, reflection); @@ -92,6 +92,7 @@ class PhpParameterReflection writeNullable(slots::allowedConstants, allowedConstants); pt_write_slot(self, slots::pureUnlessCallableIsImpureParameter, pureUnlessCallableIsImpureParameter); pt_write_slot(self, slots::pureUnlessParameterPassedParameter, pureUnlessParameterPassedParameter); + writeNullable(slots::closureScopeType, closureScopeType); } /* $this->reflection->isOptional() */ @@ -251,6 +252,7 @@ class PhpParameterReflection zv::Val isPureUnlessCallableIsImpureParameter() const { return copyOf(slots::pureUnlessCallableIsImpureParameter, "pureUnlessCallableIsImpureParameter"); } zv::Val isPureUnlessParameterPassedParameter() const { return copyOf(slots::pureUnlessParameterPassedParameter, "pureUnlessParameterPassedParameter"); } + zv::Val getClosureScopeType() const { return copyOf(slots::closureScopeType, "closureScopeType"); } private: zend_object *self; @@ -333,6 +335,7 @@ const MemberName memberNames[PT_PR_MEMBER_COUNT] = { /* PT_PR_GET_ALLOWED_CONSTANTS */ PT_PPR_MEMBER("getallowedconstants", "getAllowedConstants"), /* PT_PR_IS_PURE_UNLESS_CALLABLE_IS_IMPURE_PARAMETER */ PT_PPR_MEMBER("ispureunlesscallableisimpureparameter", "isPureUnlessCallableIsImpureParameter"), /* PT_PR_IS_PURE_UNLESS_PARAMETER_PASSED_PARAMETER */ PT_PPR_MEMBER("ispureunlessparameterpassedparameter", "isPureUnlessParameterPassedParameter"), + /* PT_PR_GET_CLOSURE_SCOPE_TYPE */ PT_PPR_MEMBER("getclosurescopetype", "getClosureScopeType"), }; #undef PT_PPR_MEMBER @@ -378,6 +381,7 @@ zv::Val pt_php_parameter_reflection_call(zend_object *parameter, pt_parameter_re case PT_PR_GET_ALLOWED_CONSTANTS: return reflection.getAllowedConstants(); case PT_PR_IS_PURE_UNLESS_CALLABLE_IS_IMPURE_PARAMETER: return reflection.isPureUnlessCallableIsImpureParameter(); case PT_PR_IS_PURE_UNLESS_PARAMETER_PASSED_PARAMETER: return reflection.isPureUnlessParameterPassedParameter(); + case PT_PR_GET_CLOSURE_SCOPE_TYPE: return reflection.getClosureScopeType(); case PT_PR_MEMBER_COUNT: break; } ZEND_UNREACHABLE(); @@ -399,8 +403,8 @@ PT_MINIT_REGISTRATION(pt_register_php_parameter_reflection) ptdecl::PhpParameterReflection::declareProperties(cls); cls.method(sigs::__construct, [](INTERNAL_FUNCTION_PARAMETERS) { - zval *initializerExprTypeResolver, *reflection, *phpDocType = NULL, *declaringClass = NULL, *outType = NULL, *immediatelyInvokedCallable, *closureThisType = NULL, *attributes, *allowedConstants = NULL, *pureUnlessCallableIsImpureParameter, *pureUnlessParameterPassedParameter; - ZEND_PARSE_PARAMETERS_START(11, 11) + zval *initializerExprTypeResolver, *reflection, *phpDocType = NULL, *declaringClass = NULL, *outType = NULL, *immediatelyInvokedCallable, *closureThisType = NULL, *attributes, *allowedConstants = NULL, *pureUnlessCallableIsImpureParameter, *pureUnlessParameterPassedParameter, *closureScopeType = NULL; + ZEND_PARSE_PARAMETERS_START(11, 12) Z_PARAM_OBJECT(initializerExprTypeResolver) Z_PARAM_OBJECT(reflection) Z_PARAM_OBJECT_OR_NULL(phpDocType) @@ -412,8 +416,10 @@ PT_MINIT_REGISTRATION(pt_register_php_parameter_reflection) Z_PARAM_OBJECT_OR_NULL(allowedConstants) Z_PARAM_OBJECT(pureUnlessCallableIsImpureParameter) Z_PARAM_OBJECT(pureUnlessParameterPassedParameter) + Z_PARAM_OPTIONAL + Z_PARAM_OBJECT_OR_NULL(closureScopeType) ZEND_PARSE_PARAMETERS_END(); - PT_PPR_THIS.construct(initializerExprTypeResolver, reflection, phpDocType, declaringClass, outType, immediatelyInvokedCallable, closureThisType, attributes, allowedConstants, pureUnlessCallableIsImpureParameter, pureUnlessParameterPassedParameter); + PT_PPR_THIS.construct(initializerExprTypeResolver, reflection, phpDocType, declaringClass, outType, immediatelyInvokedCallable, closureThisType, attributes, allowedConstants, pureUnlessCallableIsImpureParameter, pureUnlessParameterPassedParameter, closureScopeType); }); cls.method<&PhpParameterReflection::isOptional>(sigs::isOptional); @@ -447,6 +453,7 @@ PT_MINIT_REGISTRATION(pt_register_php_parameter_reflection) cls.method<&PhpParameterReflection::isPureUnlessCallableIsImpureParameter>(sigs::isPureUnlessCallableIsImpureParameter); cls.method<&PhpParameterReflection::isPureUnlessParameterPassedParameter>(sigs::isPureUnlessParameterPassedParameter); + cls.method<&PhpParameterReflection::getClosureScopeType>(sigs::getClosureScopeType); cls.shadow(&pt_ce_php_parameter_reflection); } diff --git a/turbo-ext/src/ResolvedFunctionVariantWithOriginal.cpp b/turbo-ext/src/ResolvedFunctionVariantWithOriginal.cpp index 1bffe1006fa..b4952cf833c 100644 --- a/turbo-ext/src/ResolvedFunctionVariantWithOriginal.cpp +++ b/turbo-ext/src/ResolvedFunctionVariantWithOriginal.cpp @@ -566,6 +566,13 @@ class ResolvedFunctionVariantWithOriginal if (UNEXPECTED(closureThisType.isUndef())) return zv::Val(); } + zv::Val closureScopeType = pt_parameter_reflection_call(param, PT_PR_GET_CLOSURE_SCOPE_TYPE); + if (UNEXPECTED(closureScopeType.isUndef())) return zv::Val(); + if (!closureScopeType.isNull()) { + closureScopeType = resolveParameterType(closureScopeType.raw(), PT_TEMPLATE_TYPE_VARIANCE_COVARIANT); + if (UNEXPECTED(closureScopeType.isUndef())) return zv::Val(); + } + /* new ExtendedDummyParameter($param->getName(), $paramType, ...) — the * getters in argument order */ static constexpr pt_parameter_reflection_member getters[12] = { @@ -579,7 +586,7 @@ class ResolvedFunctionVariantWithOriginal values[i] = pt_parameter_reflection_call(param, getters[i]); if (UNEXPECTED(values[i].isUndef())) return zv::Val(); } - zval args[15]; + zval args[16]; ZVAL_COPY_VALUE(&args[0], values[0].raw()); ZVAL_COPY_VALUE(&args[1], paramType.raw()); ZVAL_COPY_VALUE(&args[2], values[1].raw()); @@ -595,7 +602,8 @@ class ResolvedFunctionVariantWithOriginal ZVAL_COPY_VALUE(&args[12], values[9].raw()); ZVAL_COPY_VALUE(&args[13], values[10].raw()); ZVAL_COPY_VALUE(&args[14], values[11].raw()); - return pt_extended_dummy_parameter_new(15, args); + ZVAL_COPY_VALUE(&args[15], closureScopeType.raw()); + return pt_extended_dummy_parameter_new(16, args); } /* TypeUtils::resolveLateResolvableTypes(TemplateTypeHelper::resolveTemplateTypes( diff --git a/turbo-ext/src/ResolvedPhpDocBlockAccess.cpp b/turbo-ext/src/ResolvedPhpDocBlockAccess.cpp index ebd87bc163b..1a9427f4ba0 100644 --- a/turbo-ext/src/ResolvedPhpDocBlockAccess.cpp +++ b/turbo-ext/src/ResolvedPhpDocBlockAccess.cpp @@ -56,6 +56,7 @@ const MemberInfo pt_rpd_members[PT_RPD_MEMBER_COUNT] = { /* PT_RPD_GET_PARAMS_PURE_UNLESS_CALLABLE_IS_IMPURE */ {"paramsPureUnlessCallableIsImpure", PT_LC("getparamspureunlesscallableisimpure"), "getParamsPureUnlessCallableIsImpure", PT_RPD_ARRAY_FALSE}, /* PT_RPD_GET_PARAMS_PURE_UNLESS_PARAMETER_PASSED */ {"paramsPureUnlessParameterPassed", PT_LC("getparamspureunlessparameterpassed"), "getParamsPureUnlessParameterPassed", PT_RPD_ARRAY_FALSE}, /* PT_RPD_GET_PARAM_CLOSURE_THIS_TAGS */ {"paramClosureThisTags", PT_LC("getparamclosurethistags"), "getParamClosureThisTags", PT_RPD_ARRAY_FALSE}, + /* PT_RPD_GET_PARAM_CLOSURE_SCOPE_TAGS */ {"paramClosureScopeTags", PT_LC("getparamclosurescopetags"), "getParamClosureScopeTags", PT_RPD_ARRAY_FALSE}, /* PT_RPD_GET_RETURN_TAG */ {"returnTag", PT_LC("getreturntag"), "getReturnTag", PT_RPD_TAG_BOOL}, /* PT_RPD_GET_THROWS_TAG */ {"throwsTag", PT_LC("getthrowstag"), "getThrowsTag", PT_RPD_TAG_BOOL}, /* PT_RPD_GET_MIXIN_TAGS */ {"mixinTags", PT_LC("getmixintags"), "getMixinTags", PT_RPD_ARRAY_FALSE}, diff --git a/turbo-ext/src/TypeTraits.cpp b/turbo-ext/src/TypeTraits.cpp index 58b93068057..457e3e0aafb 100644 --- a/turbo-ext/src/TypeTraits.cpp +++ b/turbo-ext/src/TypeTraits.cpp @@ -2975,7 +2975,7 @@ static int pt_callable_type_has_template(zval *type) return pt_callable_call_bool(object, PT_LC("hastemplateorlateresolvabletype"), 0, NULL); } -/* $parameter->getOutType() / getClosureThisType() !== null && ->hasTemplateOrLateResolvableType() */ +/* $parameter->getOutType() / getClosureThisType() / getClosureScopeType() !== null && ->hasTemplateOrLateResolvableType() */ static int pt_callable_nullable_type_has_template(zend_object *parameter, const char *lcname, size_t len) { zv::Val type = pt_type_call(parameter, lcname, len, 0, NULL); @@ -3016,6 +3016,12 @@ bool pt_callable_parameters_or_asserts_have_template(zval *parameters, zval *ass out = true; return true; } + has = pt_callable_nullable_type_has_template(parameter, PT_LC("getclosurescopetype")); + if (UNEXPECTED(has < 0)) return false; + if (has == 1) { + out = true; + return true; + } } zv::Val assertTags = pt_callable_assertions_all(assertions); if (UNEXPECTED(assertTags.isUndef())) return false; @@ -5177,8 +5183,9 @@ zv::Val protoMap(zval *array, const char *what, F fn) /* the parameter callback of the twins' array_map(): new * ExtendedDummyParameter($parameter->getName(), transform($parameter->getType()), - * ...) — each getter called once (the twins call getOutType() and - * getClosureThisType() twice; pure getters); UNDEF = pending exception */ + * ...) — each getter called once (the twins call getOutType(), + * getClosureThisType() and getClosureScopeType() twice; pure getters); + * UNDEF = pending exception */ zv::Val protoParameter(PrototypeKind kind, const PrototypeTransformer &transformer, zend_object *parameter) { zv::Val name = protoParameterCall(parameter, PT_PR_GET_NAME, "getname", PROTO_ANY); @@ -5219,7 +5226,11 @@ zv::Val protoParameter(PrototypeKind kind, const PrototypeTransformer &transform if (UNEXPECTED(pureUnlessCallableIsImpure.isUndef())) return zv::Val(); zv::Val pureUnlessParameterPassed = protoParameterCall(parameter, PT_PR_IS_PURE_UNLESS_PARAMETER_PASSED_PARAMETER, "ispureunlessparameterpassedparameter", PROTO_ANY); if (UNEXPECTED(pureUnlessParameterPassed.isUndef())) return zv::Val(); - zval args[15]; + zv::Val closureScopeType = protoParameterCall(parameter, PT_PR_GET_CLOSURE_SCOPE_TYPE, "getclosurescopetype", PROTO_OBJECT_OR_NULL); + if (UNEXPECTED(closureScopeType.isUndef())) return zv::Val(); + zv::Val transformedClosureScopeType = protoTransformNullable(transformer, closureScopeType.raw()); + if (UNEXPECTED(transformedClosureScopeType.isUndef())) return zv::Val(); + zval args[16]; ZVAL_COPY_VALUE(&args[0], name.raw()); ZVAL_COPY_VALUE(&args[1], transformedType.raw()); ZVAL_COPY_VALUE(&args[2], optional.raw()); @@ -5235,7 +5246,8 @@ zv::Val protoParameter(PrototypeKind kind, const PrototypeTransformer &transform ZVAL_COPY_VALUE(&args[12], allowedConstants.raw()); ZVAL_COPY_VALUE(&args[13], pureUnlessCallableIsImpure.raw()); ZVAL_COPY_VALUE(&args[14], pureUnlessParameterPassed.raw()); - return pt_extended_dummy_parameter_new(15, args); + ZVAL_COPY_VALUE(&args[15], transformedClosureScopeType.raw()); + return pt_extended_dummy_parameter_new(16, args); } /* the twins' $variantFn: new ExtendedFunctionVariant(...) over $acceptor; diff --git a/turbo-ext/src/generated/ArgumentsHandler.h b/turbo-ext/src/generated/ArgumentsHandler.h index d8e3af1f82b..a86c57962be 100644 --- a/turbo-ext/src/generated/ArgumentsHandler.h +++ b/turbo-ext/src/generated/ArgumentsHandler.h @@ -139,18 +139,21 @@ inline constexpr char strings[] = "currentParameter\0" /* 1862 */ "getParameterOutExtensionsType\0" /* 1879 */ "call\0" /* 1909 */ - "resolveClosureThisType\0" /* 1914 */ - "position\0" /* 1937 */ - "unpackedType\0" /* 1946 */ - "isPure\0" /* 1959 */ - "observeUnpackedArgument\0" /* 1966 */ - "valueType\0" /* 1990 */ - "observeArgumentValue\0" /* 2000 */ - "findOriginalParameterType\0" /* 2021 */ - "argResults\0" /* 2047 */ - "argValue\0" /* 2058 */ - "PHPStan\\Analyser\\ExpressionResult\0" /* 2067 */ - "readArgResult"; /* 2101 */ + "resolveClosureThisTypeFromExtensions\0" /* 1914 */ + "scopeToPass\0" /* 1951 */ + "isStatic\0" /* 1963 */ + "applyClosureThisAndScope\0" /* 1972 */ + "position\0" /* 1997 */ + "unpackedType\0" /* 2006 */ + "isPure\0" /* 2019 */ + "observeUnpackedArgument\0" /* 2026 */ + "valueType\0" /* 2050 */ + "observeArgumentValue\0" /* 2060 */ + "findOriginalParameterType\0" /* 2081 */ + "argResults\0" /* 2107 */ + "argValue\0" /* 2118 */ + "PHPStan\\Analyser\\ExpressionResult\0" /* 2127 */ + "readArgResult"; /* 2161 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 25), /* __construct $templateArgumentObserver */ reg::packed(76, 0, 100), /* __construct $expressionResultFactory */ @@ -244,29 +247,35 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1862, 0, 1564), /* getParameterOutExtensionsType $currentParameter */ reg::packed(1074, 0, 1080), /* getParameterOutExtensionsType $scope */ reg::packed(1245, MAY_BE_NULL, 1345), /* getParameterOutExtensionsType return */ - reg::packed(1909, MAY_BE_NULL, 1045), /* resolveClosureThisType $call */ - reg::packed(910, 0), /* resolveClosureThisType $calleeReflection */ - reg::packed(1728, 0, 1564), /* resolveClosureThisType $parameter */ - reg::packed(1074, 0, 1080), /* resolveClosureThisType $scope */ - reg::packed(1245, MAY_BE_NULL, 1345), /* resolveClosureThisType return */ + reg::packed(1909, MAY_BE_NULL, 1045), /* resolveClosureThisTypeFromExtensions $call */ + reg::packed(910, 0), /* resolveClosureThisTypeFromExtensions $calleeReflection */ + reg::packed(1728, 0, 1564), /* resolveClosureThisTypeFromExtensions $parameter */ + reg::packed(1074, 0, 1080), /* resolveClosureThisTypeFromExtensions $scope */ + reg::packed(1245, MAY_BE_NULL, 1345), /* resolveClosureThisTypeFromExtensions return */ + reg::packed(1951, 0, 1080), /* applyClosureThisAndScope $scopeToPass */ + reg::packed(1909, MAY_BE_NULL, 1045), /* applyClosureThisAndScope $call */ + reg::packed(910, 0), /* applyClosureThisAndScope $calleeReflection */ + reg::packed(1728, 0, 1564), /* applyClosureThisAndScope $parameter */ + reg::packed(1963, MAY_BE_BOOL), /* applyClosureThisAndScope $isStatic */ + reg::packed(1245, MAY_BE_ARRAY), /* applyClosureThisAndScope return */ reg::packed(1074, 0, 1080), /* observeUnpackedArgument $scope */ reg::packed(1551, 0, 1479), /* observeUnpackedArgument $acceptor */ - reg::packed(1937, MAY_BE_LONG), /* observeUnpackedArgument $position */ - reg::packed(1946, 0, 1345), /* observeUnpackedArgument $unpackedType */ - reg::packed(1959, MAY_BE_BOOL), /* observeUnpackedArgument $isPure */ + reg::packed(1997, MAY_BE_LONG), /* observeUnpackedArgument $position */ + reg::packed(2006, 0, 1345), /* observeUnpackedArgument $unpackedType */ + reg::packed(2019, MAY_BE_BOOL), /* observeUnpackedArgument $isPure */ reg::packed(1245, 0, 1080), /* observeUnpackedArgument return */ reg::packed(1074, 0, 1080), /* observeArgumentValue $scope */ reg::packed(1551, 0, 1479), /* observeArgumentValue $acceptor */ reg::packed(1728, 0, 1564), /* observeArgumentValue $parameter */ - reg::packed(1990, 0, 1345), /* observeArgumentValue $valueType */ - reg::packed(1959, MAY_BE_BOOL), /* observeArgumentValue $isPure */ + reg::packed(2050, 0, 1345), /* observeArgumentValue $valueType */ + reg::packed(2019, MAY_BE_BOOL), /* observeArgumentValue $isPure */ reg::packed(1245, 0, 1080), /* observeArgumentValue return */ reg::packed(1551, 0, 1479), /* findOriginalParameterType $acceptor */ reg::packed(1728, 0, 1564), /* findOriginalParameterType $parameter */ reg::packed(1245, MAY_BE_NULL, 1345), /* findOriginalParameterType return */ - reg::packed(2047, MAY_BE_ARRAY), /* readArgResult $argResults */ - reg::packed(2058, 0, 1388), /* readArgResult $argValue */ - reg::packed(1245, 0, 2067), /* readArgResult return */ + reg::packed(2107, MAY_BE_ARRAY), /* readArgResult $argResults */ + reg::packed(2118, 0, 1388), /* readArgResult $argValue */ + reg::packed(1245, 0, 2127), /* readArgResult return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -287,11 +296,12 @@ inline constexpr sigtab::Sig callCallbackImmediately = { { 1752 /* callCallbackI inline constexpr sigtab::Sig shouldInvalidateCallbackExpressions = { { 1776 /* shouldInvalidateCallbackExpressions */, 1, 80, 1, 81, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig getParameterTypeFromParameterClosureTypeExtension = { { 1812 /* getParameterTypeFromParameterClosureTypeExtension */, 4, 82, 4, 86, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig getParameterOutExtensionsType = { { 1879 /* getParameterOutExtensionsType */, 4, 87, 4, 91, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveClosureThisType = { { 1914 /* resolveClosureThisType */, 4, 92, 4, 96, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeUnpackedArgument = { { 1966 /* observeUnpackedArgument */, 5, 97, 5, 102, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeArgumentValue = { { 2000 /* observeArgumentValue */, 5, 103, 5, 108, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig findOriginalParameterType = { { 2021 /* findOriginalParameterType */, 2, 109, 2, 111, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig readArgResult = { { 2101 /* readArgResult */, 2, 112, 2, 114, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveClosureThisTypeFromExtensions = { { 1914 /* resolveClosureThisTypeFromExtensions */, 4, 92, 4, 96, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig applyClosureThisAndScope = { { 1972 /* applyClosureThisAndScope */, 5, 97, 5, 102, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeUnpackedArgument = { { 2026 /* observeUnpackedArgument */, 5, 103, 5, 108, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeArgumentValue = { { 2060 /* observeArgumentValue */, 5, 109, 5, 114, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig findOriginalParameterType = { { 2081 /* findOriginalParameterType */, 2, 115, 2, 117, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig readArgResult = { { 2161 /* readArgResult */, 2, 118, 2, 120, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::ArgumentsHandler diff --git a/turbo-ext/src/generated/ExtendedDummyParameter.h b/turbo-ext/src/generated/ExtendedDummyParameter.h index 79546e54a5c..d6f43ff5f1c 100644 --- a/turbo-ext/src/generated/ExtendedDummyParameter.h +++ b/turbo-ext/src/generated/ExtendedDummyParameter.h @@ -19,6 +19,7 @@ inline constexpr uint32_t attributes = 11; inline constexpr uint32_t allowedConstants = 12; inline constexpr uint32_t pureUnlessCallableIsImpureParameter = 13; inline constexpr uint32_t pureUnlessParameterPassedParameter = 14; +inline constexpr uint32_t closureScopeType = 15; } // namespace slot inline void declareClass(reg::Class &cls) @@ -40,6 +41,7 @@ inline void declareProperties(reg::Class &cls) cls.property("allowedConstants", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, MAY_BE_NULL, "PHPStan\\Reflection\\ParameterAllowedConstants"); cls.property("pureUnlessCallableIsImpureParameter", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, 0, "PHPStan\\TrinaryLogic"); cls.property("pureUnlessParameterPassedParameter", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, 0, "PHPStan\\TrinaryLogic"); + cls.property("closureScopeType", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, MAY_BE_NULL, "PHPStan\\Type\\Type"); } /* the string and parameter tables the signatures below index into (see reg::Sig) */ @@ -64,21 +66,24 @@ inline constexpr char strings[] = "PHPStan\\Reflection\\ParameterAllowedConstants\0" /* 236 */ "pureUnlessCallableIsImpureParameter\0" /* 281 */ "pureUnlessParameterPassedParameter\0" /* 317 */ - "__construct\0" /* 352 */ - "\0" /* 364 */ - "getPhpDocType\0" /* 365 */ - "hasNativeType\0" /* 379 */ - "getNativeType\0" /* 393 */ - "getOutType\0" /* 407 */ - "isImmediatelyInvokedCallable\0" /* 418 */ - "getClosureThisType\0" /* 447 */ - "getAttributes\0" /* 466 */ - "getAllowedConstants\0" /* 480 */ - "constants\0" /* 500 */ - "PHPStan\\Reflection\\AllowedConstantsResult\0" /* 510 */ - "checkAllowedConstants\0" /* 552 */ - "isPureUnlessCallableIsImpureParameter\0" /* 574 */ - "isPureUnlessParameterPassedParameter"; /* 612 */ + "closureScopeType\0" /* 352 */ + "null\0" /* 369 */ + "__construct\0" /* 374 */ + "\0" /* 386 */ + "getPhpDocType\0" /* 387 */ + "hasNativeType\0" /* 401 */ + "getNativeType\0" /* 415 */ + "getOutType\0" /* 429 */ + "isImmediatelyInvokedCallable\0" /* 440 */ + "getClosureThisType\0" /* 469 */ + "getClosureScopeType\0" /* 488 */ + "getAttributes\0" /* 508 */ + "getAllowedConstants\0" /* 522 */ + "constants\0" /* 542 */ + "PHPStan\\Reflection\\AllowedConstantsResult\0" /* 552 */ + "checkAllowedConstants\0" /* 594 */ + "isPureUnlessCallableIsImpureParameter\0" /* 616 */ + "isPureUnlessParameterPassedParameter"; /* 654 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $name */ reg::packed(5, 0, 10), /* __construct $type */ @@ -95,36 +100,39 @@ inline constexpr reg::PackedArg args[] = { reg::packed(219, MAY_BE_NULL, 236), /* __construct $allowedConstants */ reg::packed(281, 0, 171), /* __construct $pureUnlessCallableIsImpureParameter */ reg::packed(317, 0, 171), /* __construct $pureUnlessParameterPassedParameter */ - reg::packed(364, 0, 10), /* getPhpDocType return */ - reg::packed(364, MAY_BE_BOOL), /* hasNativeType return */ - reg::packed(364, 0, 10), /* getNativeType return */ - reg::packed(364, MAY_BE_NULL, 10), /* getOutType return */ - reg::packed(364, 0, 171), /* isImmediatelyInvokedCallable return */ - reg::packed(364, MAY_BE_NULL, 10), /* getClosureThisType return */ - reg::packed(364, MAY_BE_ARRAY), /* getAttributes return */ - reg::packed(364, MAY_BE_NULL, 236), /* getAllowedConstants return */ - reg::packed(500, MAY_BE_ARRAY), /* checkAllowedConstants $constants */ - reg::packed(364, 0, 510), /* checkAllowedConstants return */ - reg::packed(364, 0, 171), /* isPureUnlessCallableIsImpureParameter return */ - reg::packed(364, 0, 171), /* isPureUnlessParameterPassedParameter return */ + reg::packed(352, MAY_BE_NULL, 10, false, false, 369), /* __construct $closureScopeType */ + reg::packed(386, 0, 10), /* getPhpDocType return */ + reg::packed(386, MAY_BE_BOOL), /* hasNativeType return */ + reg::packed(386, 0, 10), /* getNativeType return */ + reg::packed(386, MAY_BE_NULL, 10), /* getOutType return */ + reg::packed(386, 0, 171), /* isImmediatelyInvokedCallable return */ + reg::packed(386, MAY_BE_NULL, 10), /* getClosureThisType return */ + reg::packed(386, MAY_BE_NULL, 10), /* getClosureScopeType return */ + reg::packed(386, MAY_BE_ARRAY), /* getAttributes return */ + reg::packed(386, MAY_BE_NULL, 236), /* getAllowedConstants return */ + reg::packed(542, MAY_BE_ARRAY), /* checkAllowedConstants $constants */ + reg::packed(386, 0, 552), /* checkAllowedConstants return */ + reg::packed(386, 0, 171), /* isPureUnlessCallableIsImpureParameter return */ + reg::packed(386, 0, 171), /* isPureUnlessParameterPassedParameter return */ }; using Sig = reg::Sig; } // namespace sigtab /* the signatures of the methods the class declares itself (a used trait's are in the trait's header) */ namespace sig { -inline constexpr sigtab::Sig __construct = { { 352 /* __construct */, 15, 0, 15, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPhpDocType = { { 365 /* getPhpDocType */, 0, 15, 0, 15, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasNativeType = { { 379 /* hasNativeType */, 0, 16, 0, 16, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getNativeType = { { 393 /* getNativeType */, 0, 17, 0, 17, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getOutType = { { 407 /* getOutType */, 0, 18, 0, 18, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isImmediatelyInvokedCallable = { { 418 /* isImmediatelyInvokedCallable */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getClosureThisType = { { 447 /* getClosureThisType */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getAttributes = { { 466 /* getAttributes */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getAllowedConstants = { { 480 /* getAllowedConstants */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig checkAllowedConstants = { { 552 /* checkAllowedConstants */, 1, 23, 1, 24, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isPureUnlessCallableIsImpureParameter = { { 574 /* isPureUnlessCallableIsImpureParameter */, 0, 25, 0, 25, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isPureUnlessParameterPassedParameter = { { 612 /* isPureUnlessParameterPassedParameter */, 0, 26, 0, 26, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 374 /* __construct */, 15, 0, 16, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPhpDocType = { { 387 /* getPhpDocType */, 0, 16, 0, 16, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasNativeType = { { 401 /* hasNativeType */, 0, 17, 0, 17, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getNativeType = { { 415 /* getNativeType */, 0, 18, 0, 18, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getOutType = { { 429 /* getOutType */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isImmediatelyInvokedCallable = { { 440 /* isImmediatelyInvokedCallable */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureThisType = { { 469 /* getClosureThisType */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureScopeType = { { 488 /* getClosureScopeType */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getAttributes = { { 508 /* getAttributes */, 0, 23, 0, 23, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getAllowedConstants = { { 522 /* getAllowedConstants */, 0, 24, 0, 24, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig checkAllowedConstants = { { 594 /* checkAllowedConstants */, 1, 25, 1, 26, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isPureUnlessCallableIsImpureParameter = { { 616 /* isPureUnlessCallableIsImpureParameter */, 0, 27, 0, 27, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isPureUnlessParameterPassedParameter = { { 654 /* isPureUnlessParameterPassedParameter */, 0, 28, 0, 28, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ExtendedDummyParameter diff --git a/turbo-ext/src/generated/ExtendedNativeParameterReflection.h b/turbo-ext/src/generated/ExtendedNativeParameterReflection.h index 133894afabe..cded3a90231 100644 --- a/turbo-ext/src/generated/ExtendedNativeParameterReflection.h +++ b/turbo-ext/src/generated/ExtendedNativeParameterReflection.h @@ -25,6 +25,7 @@ inline constexpr uint32_t attributes = 11; inline constexpr uint32_t allowedConstants = 12; inline constexpr uint32_t pureUnlessCallableIsImpureParameter = 13; inline constexpr uint32_t pureUnlessParameterPassedParameter = 14; +inline constexpr uint32_t closureScopeType = 15; } // namespace slot inline void declareClass(reg::Class &cls) @@ -51,6 +52,7 @@ inline void declareProperties(reg::Class &cls) cls.property("allowedConstants", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, MAY_BE_NULL, "PHPStan\\Reflection\\ParameterAllowedConstants"); cls.property("pureUnlessCallableIsImpureParameter", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, 0, "PHPStan\\TrinaryLogic"); cls.property("pureUnlessParameterPassedParameter", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, 0, "PHPStan\\TrinaryLogic"); + cls.property("closureScopeType", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, MAY_BE_NULL, "PHPStan\\Type\\Type"); } /* the string and parameter tables the signatures below index into (see reg::Sig) */ @@ -75,26 +77,29 @@ inline constexpr char strings[] = "PHPStan\\Reflection\\ParameterAllowedConstants\0" /* 236 */ "pureUnlessCallableIsImpureParameter\0" /* 281 */ "pureUnlessParameterPassedParameter\0" /* 317 */ - "__construct\0" /* 352 */ - "\0" /* 364 */ - "getName\0" /* 365 */ - "isOptional\0" /* 373 */ - "getType\0" /* 384 */ - "getPhpDocType\0" /* 392 */ - "hasNativeType\0" /* 406 */ - "getNativeType\0" /* 420 */ - "isVariadic\0" /* 434 */ - "getDefaultValue\0" /* 445 */ - "getOutType\0" /* 461 */ - "isImmediatelyInvokedCallable\0" /* 472 */ - "getClosureThisType\0" /* 501 */ - "getAttributes\0" /* 520 */ - "getAllowedConstants\0" /* 534 */ - "constants\0" /* 554 */ - "PHPStan\\Reflection\\AllowedConstantsResult\0" /* 564 */ - "checkAllowedConstants\0" /* 606 */ - "isPureUnlessCallableIsImpureParameter\0" /* 628 */ - "isPureUnlessParameterPassedParameter"; /* 666 */ + "closureScopeType\0" /* 352 */ + "null\0" /* 369 */ + "__construct\0" /* 374 */ + "\0" /* 386 */ + "getName\0" /* 387 */ + "isOptional\0" /* 395 */ + "getType\0" /* 406 */ + "getPhpDocType\0" /* 414 */ + "hasNativeType\0" /* 428 */ + "getNativeType\0" /* 442 */ + "isVariadic\0" /* 456 */ + "getDefaultValue\0" /* 467 */ + "getOutType\0" /* 483 */ + "isImmediatelyInvokedCallable\0" /* 494 */ + "getClosureThisType\0" /* 523 */ + "getClosureScopeType\0" /* 542 */ + "getAttributes\0" /* 562 */ + "getAllowedConstants\0" /* 576 */ + "constants\0" /* 596 */ + "PHPStan\\Reflection\\AllowedConstantsResult\0" /* 606 */ + "checkAllowedConstants\0" /* 648 */ + "isPureUnlessCallableIsImpureParameter\0" /* 670 */ + "isPureUnlessParameterPassedParameter"; /* 708 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $name */ reg::packed(5, MAY_BE_BOOL), /* __construct $optional */ @@ -111,48 +116,51 @@ inline constexpr reg::PackedArg args[] = { reg::packed(219, MAY_BE_NULL, 236), /* __construct $allowedConstants */ reg::packed(281, 0, 171), /* __construct $pureUnlessCallableIsImpureParameter */ reg::packed(317, 0, 171), /* __construct $pureUnlessParameterPassedParameter */ - reg::packed(364, MAY_BE_STRING), /* getName return */ - reg::packed(364, MAY_BE_BOOL), /* isOptional return */ - reg::packed(364, 0, 19), /* getType return */ - reg::packed(364, 0, 19), /* getPhpDocType return */ - reg::packed(364, MAY_BE_BOOL), /* hasNativeType return */ - reg::packed(364, 0, 19), /* getNativeType return */ - reg::packed(364, 0, 77), /* passedByReference return */ - reg::packed(364, MAY_BE_BOOL), /* isVariadic return */ - reg::packed(364, MAY_BE_NULL, 19), /* getDefaultValue return */ - reg::packed(364, MAY_BE_NULL, 19), /* getOutType return */ - reg::packed(364, 0, 171), /* isImmediatelyInvokedCallable return */ - reg::packed(364, MAY_BE_NULL, 19), /* getClosureThisType return */ - reg::packed(364, MAY_BE_ARRAY), /* getAttributes return */ - reg::packed(364, MAY_BE_NULL, 236), /* getAllowedConstants return */ - reg::packed(554, MAY_BE_ARRAY), /* checkAllowedConstants $constants */ - reg::packed(364, 0, 564), /* checkAllowedConstants return */ - reg::packed(364, 0, 171), /* isPureUnlessCallableIsImpureParameter return */ - reg::packed(364, 0, 171), /* isPureUnlessParameterPassedParameter return */ + reg::packed(352, MAY_BE_NULL, 19, false, false, 369), /* __construct $closureScopeType */ + reg::packed(386, MAY_BE_STRING), /* getName return */ + reg::packed(386, MAY_BE_BOOL), /* isOptional return */ + reg::packed(386, 0, 19), /* getType return */ + reg::packed(386, 0, 19), /* getPhpDocType return */ + reg::packed(386, MAY_BE_BOOL), /* hasNativeType return */ + reg::packed(386, 0, 19), /* getNativeType return */ + reg::packed(386, 0, 77), /* passedByReference return */ + reg::packed(386, MAY_BE_BOOL), /* isVariadic return */ + reg::packed(386, MAY_BE_NULL, 19), /* getDefaultValue return */ + reg::packed(386, MAY_BE_NULL, 19), /* getOutType return */ + reg::packed(386, 0, 171), /* isImmediatelyInvokedCallable return */ + reg::packed(386, MAY_BE_NULL, 19), /* getClosureThisType return */ + reg::packed(386, MAY_BE_NULL, 19), /* getClosureScopeType return */ + reg::packed(386, MAY_BE_ARRAY), /* getAttributes return */ + reg::packed(386, MAY_BE_NULL, 236), /* getAllowedConstants return */ + reg::packed(596, MAY_BE_ARRAY), /* checkAllowedConstants $constants */ + reg::packed(386, 0, 606), /* checkAllowedConstants return */ + reg::packed(386, 0, 171), /* isPureUnlessCallableIsImpureParameter return */ + reg::packed(386, 0, 171), /* isPureUnlessParameterPassedParameter return */ }; using Sig = reg::Sig; } // namespace sigtab /* the signatures of the methods the class declares itself (a used trait's are in the trait's header) */ namespace sig { -inline constexpr sigtab::Sig __construct = { { 352 /* __construct */, 15, 0, 15, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getName = { { 365 /* getName */, 0, 15, 0, 15, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isOptional = { { 373 /* isOptional */, 0, 16, 0, 16, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getType = { { 384 /* getType */, 0, 17, 0, 17, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPhpDocType = { { 392 /* getPhpDocType */, 0, 18, 0, 18, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasNativeType = { { 406 /* hasNativeType */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getNativeType = { { 420 /* getNativeType */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig passedByReference = { { 59 /* passedByReference */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isVariadic = { { 434 /* isVariadic */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getDefaultValue = { { 445 /* getDefaultValue */, 0, 23, 0, 23, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getOutType = { { 461 /* getOutType */, 0, 24, 0, 24, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isImmediatelyInvokedCallable = { { 472 /* isImmediatelyInvokedCallable */, 0, 25, 0, 25, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getClosureThisType = { { 501 /* getClosureThisType */, 0, 26, 0, 26, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getAttributes = { { 520 /* getAttributes */, 0, 27, 0, 27, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getAllowedConstants = { { 534 /* getAllowedConstants */, 0, 28, 0, 28, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig checkAllowedConstants = { { 606 /* checkAllowedConstants */, 1, 29, 1, 30, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isPureUnlessCallableIsImpureParameter = { { 628 /* isPureUnlessCallableIsImpureParameter */, 0, 31, 0, 31, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isPureUnlessParameterPassedParameter = { { 666 /* isPureUnlessParameterPassedParameter */, 0, 32, 0, 32, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 374 /* __construct */, 15, 0, 16, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getName = { { 387 /* getName */, 0, 16, 0, 16, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isOptional = { { 395 /* isOptional */, 0, 17, 0, 17, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getType = { { 406 /* getType */, 0, 18, 0, 18, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPhpDocType = { { 414 /* getPhpDocType */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasNativeType = { { 428 /* hasNativeType */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getNativeType = { { 442 /* getNativeType */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig passedByReference = { { 59 /* passedByReference */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isVariadic = { { 456 /* isVariadic */, 0, 23, 0, 23, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getDefaultValue = { { 467 /* getDefaultValue */, 0, 24, 0, 24, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getOutType = { { 483 /* getOutType */, 0, 25, 0, 25, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isImmediatelyInvokedCallable = { { 494 /* isImmediatelyInvokedCallable */, 0, 26, 0, 26, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureThisType = { { 523 /* getClosureThisType */, 0, 27, 0, 27, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureScopeType = { { 542 /* getClosureScopeType */, 0, 28, 0, 28, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getAttributes = { { 562 /* getAttributes */, 0, 29, 0, 29, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getAllowedConstants = { { 576 /* getAllowedConstants */, 0, 30, 0, 30, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig checkAllowedConstants = { { 648 /* checkAllowedConstants */, 1, 31, 1, 32, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isPureUnlessCallableIsImpureParameter = { { 670 /* isPureUnlessCallableIsImpureParameter */, 0, 33, 0, 33, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isPureUnlessParameterPassedParameter = { { 708 /* isPureUnlessParameterPassedParameter */, 0, 34, 0, 34, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ExtendedNativeParameterReflection diff --git a/turbo-ext/src/generated/MutatingScope.h b/turbo-ext/src/generated/MutatingScope.h index e01ebcdf60c..adf831b9347 100644 --- a/turbo-ext/src/generated/MutatingScope.h +++ b/turbo-ext/src/generated/MutatingScope.h @@ -253,246 +253,247 @@ inline constexpr char strings[] = "PHPStan\\PhpDoc\\ResolvedPhpDocBlock\0" /* 3558 */ "phpDocPureUnlessCallableIsImpureParameters\0" /* 3593 */ "phpDocPureUnlessParameterPassedParameters\0" /* 3636 */ - "enterClassMethod\0" /* 3678 */ - "hook\0" /* 3695 */ - "PhpParser\\Node\\PropertyHook\0" /* 3700 */ - "propertyName\0" /* 3728 */ - "nativePropertyTypeNode\0" /* 3741 */ - "PhpParser\\Node\\Identifier|PhpParser\\Node\\Name|PhpParser\\Node\\ComplexType\0" /* 3764 */ - "phpDocPropertyType\0" /* 3837 */ - "enterPropertyHook\0" /* 3856 */ - "type\0" /* 3874 */ - "transformStaticType\0" /* 3879 */ - "functionLike\0" /* 3899 */ - "PhpParser\\Node\\FunctionLike\0" /* 3912 */ - "getRealParameterTypes\0" /* 3940 */ - "getRealParameterDefaultValues\0" /* 3962 */ - "PhpParser\\Node\\Stmt\\ClassMethod|PhpParser\\Node\\Stmt\\Function_|PhpParser\\Node\\PropertyHook\0" /* 3992 */ - "getParameterAttributes\0" /* 4082 */ - "PhpParser\\Node\\Stmt\\Function_\0" /* 4105 */ - "pureUnlessCallableIsImpureParameters\0" /* 4135 */ - "pureUnlessParameterPassedParameters\0" /* 4172 */ - "enterFunction\0" /* 4208 */ - "functionReflection\0" /* 4222 */ - "preserveConstructorScope\0" /* 4241 */ - "enterFunctionLike\0" /* 4266 */ - "namespaceName\0" /* 4284 */ - "enterNamespace\0" /* 4298 */ - "thisType\0" /* 4313 */ - "nativeThisType\0" /* 4322 */ - "scopeClasses\0" /* 4337 */ - "enterClosureBind\0" /* 4350 */ - "originalScope\0" /* 4367 */ - "restoreOriginalScopeAfterClosureBind\0" /* 4381 */ - "restoreThisScope\0" /* 4418 */ - "restoreThis\0" /* 4435 */ - "enterClosureCall\0" /* 4447 */ - "isInClosureBind\0" /* 4464 */ - "withClosureBindScopeClasses\0" /* 4480 */ - "closure\0" /* 4508 */ - "PhpParser\\Node\\Expr\\Closure\0" /* 4516 */ - "callableParameters\0" /* 4544 */ - "nativeCallableParameters\0" /* 4563 */ - "enterAnonymousFunction\0" /* 4588 */ - "enterAnonymousFunctionWithoutReflection\0" /* 4611 */ - "typeHolder\0" /* 4651 */ - "PHPStan\\Analyser\\ExpressionTypeHolder\0" /* 4662 */ - "expressionTypeIsUnchangeable\0" /* 4700 */ - "invalidateStaticExpressions\0" /* 4729 */ - "arrowFunction\0" /* 4757 */ - "PhpParser\\Node\\Expr\\ArrowFunction\0" /* 4771 */ - "enterArrowFunction\0" /* 4805 */ - "enterArrowFunctionWithoutReflection\0" /* 4824 */ - "PhpParser\\Node\\Param\0" /* 4860 */ - "isParameterValueNullable\0" /* 4881 */ - "isNullable\0" /* 4906 */ - "isVariadic\0" /* 4917 */ - "getFunctionType\0" /* 4928 */ - "index\0" /* 4944 */ - "getCallableParameterType\0" /* 4950 */ - "startIndex\0" /* 4975 */ - "buildVariadicArrayTypeFromCallableParameters\0" /* 4986 */ - "nativeType\0" /* 5031 */ - "inferredType\0" /* 5042 */ - "intersectButNotNever\0" /* 5055 */ - "PhpParser\\Node\\Expr\\Match_\0" /* 5076 */ - "condType\0" /* 5103 */ - "condNativeType\0" /* 5112 */ - "enterMatch\0" /* 5127 */ - "iteratee\0" /* 5138 */ - "iterateeType\0" /* 5147 */ - "nativeIterateeType\0" /* 5160 */ - "valueName\0" /* 5179 */ - "keyName\0" /* 5189 */ - "valueByRef\0" /* 5197 */ - "enterForeach\0" /* 5208 */ - "enterForeachKey\0" /* 5221 */ - "catchType\0" /* 5237 */ - "enterCatchType\0" /* 5247 */ - "isPlainWrite\0" /* 5262 */ - "enterExpressionAssign\0" /* 5275 */ - "exitExpressionAssign\0" /* 5297 */ - "isInExpressionAssign\0" /* 5318 */ - "isInWriteExpressionAssign\0" /* 5339 */ - "setAllowedUndefinedExpression\0" /* 5365 */ - "unsetAllowedUndefinedExpression\0" /* 5395 */ - "isUndefinedExpressionAllowed\0" /* 5427 */ - "certainty\0" /* 5456 */ - "intertwinedPropagatedFrom\0" /* 5466 */ - "assignVariable\0" /* 5492 */ - "overwriteExpression\0" /* 5507 */ - "scope\0" /* 5527 */ - "rootType\0" /* 5533 */ - "assignedExpr\0" /* 5542 */ - "rootVariableName\0" /* 5555 */ - "native\0" /* 5572 */ - "resolveIntertwinedAssignedType\0" /* 5579 */ - "dimFetch\0" /* 5610 */ - "PhpParser\\Node\\Expr\\ArrayDimFetch\0" /* 5619 */ - "isDimFetchPathReachable\0" /* 5653 */ - "unsetExpression\0" /* 5677 */ - "getStateType\0" /* 5693 */ - "getScopeStateType\0" /* 5706 */ - "getScopeStateNativeType\0" /* 5724 */ - "resolveScopeStateType\0" /* 5748 */ - "specifyExpressionType\0" /* 5770 */ - "openSpecificationScope\0" /* 5792 */ - "isSpecifyExpressionTypeNoop\0" /* 5815 */ - "specifyExpressionTypeInPlace\0" /* 5843 */ - "assignExpression\0" /* 5872 */ - "fetchedOnType\0" /* 5889 */ - "assignInitializedProperty\0" /* 5903 */ - "expressionToInvalidate\0" /* 5929 */ - "requireMoreCharacters\0" /* 5952 */ - "invalidatingClass\0" /* 5974 */ - "keepPropertyFetches\0" /* 5992 */ - "invalidateExpression\0" /* 6012 */ - "isPrivatePropertyOfDifferentClass\0" /* 6033 */ - "invalidateMethodsOnExpression\0" /* 6067 */ - "setExpressionCertaintyKeepingType\0" /* 6097 */ - "isComplexUnionType\0" /* 6131 */ - "addTypeToExpression\0" /* 6150 */ - "typeToRemove\0" /* 6170 */ - "removeTypeFromExpression\0" /* 6183 */ - "filterByTruthyValue\0" /* 6208 */ - "filterByFalseyValue\0" /* 6228 */ - "specifiedTypes\0" /* 6248 */ - "applySpecifiedTypes\0" /* 6263 */ - "specifiedExpressions\0" /* 6283 */ - "processConditionalExpressionsAfterSpecifying\0" /* 6304 */ - "getConditionalExpressions\0" /* 6349 */ - "conditionalExpressionHolders\0" /* 6375 */ - "addConditionalExpressions\0" /* 6404 */ - "exitFirstLevelStatements\0" /* 6430 */ - "isInFirstLevelStatement\0" /* 6455 */ - "otherScope\0" /* 6479 */ - "preserveVacuousConditionals\0" /* 6490 */ - "mergeWith\0" /* 6518 */ - "ours\0" /* 6528 */ - "theirs\0" /* 6533 */ - "collectAbsorbedClosures\0" /* 6540 */ - "mergeWithVariableState\0" /* 6564 */ - "differingExpressionKeys\0" /* 6587 */ - "ourExpressionTypes\0" /* 6611 */ - "theirExpressionTypes\0" /* 6630 */ - "withoutPreciseClassConstantFetches\0" /* 6651 */ - "currentConditionalExpressions\0" /* 6686 */ - "sourceConditionalExpressions\0" /* 6716 */ - "otherExpressionTypes\0" /* 6745 */ - "preserveVacuousConditionalExpressions\0" /* 6766 */ - "ourConditionalExpressions\0" /* 6804 */ - "theirConditionalExpressions\0" /* 6830 */ - "mergeSameGuardConditionalExpressions\0" /* 6858 */ - "newConditionalExpressions\0" /* 6895 */ - "existingConditionalExpressions\0" /* 6921 */ - "mergeConditionalExpressions\0" /* 6952 */ - "calledMethodScope\0" /* 6980 */ - "mergeInitializedProperties\0" /* 6998 */ - "finallyScope\0" /* 7025 */ - "originalFinallyScope\0" /* 7038 */ - "processFinallyScope\0" /* 7059 */ - "ourVariableTypeHolders\0" /* 7079 */ - "finallyVariableTypeHolders\0" /* 7102 */ - "originalVariableTypeHolders\0" /* 7129 */ - "processFinallyScopeVariableTypeHolders\0" /* 7157 */ - "closureScope\0" /* 7196 */ - "prevScope\0" /* 7209 */ - "byRefUses\0" /* 7219 */ - "processClosureScope\0" /* 7229 */ - "finalScope\0" /* 7249 */ - "processAlwaysIterableForeachScopeWithoutPollute\0" /* 7260 */ - "writableVariableNames\0" /* 7308 */ - "generalizeWith\0" /* 7330 */ - "generalizeWithVariableState\0" /* 7345 */ - "variableTypeHolders\0" /* 7373 */ - "otherVariableTypeHolders\0" /* 7393 */ - "generalizeVariableTypeHolders\0" /* 7418 */ - "flattenUnionForGeneralization\0" /* 7448 */ - "a\0" /* 7478 */ - "b\0" /* 7480 */ - "depth\0" /* 7482 */ - "generalizeType\0" /* 7488 */ - "getArrayDepth\0" /* 7503 */ - "equals\0" /* 7517 */ - "otherConditionalExpressions\0" /* 7524 */ - "compareConditionalExpressions\0" /* 7552 */ - "compareVariableTypeHolders\0" /* 7582 */ - "propertyReflection\0" /* 7609 */ - "PHPStan\\Reflection\\PropertyReflection\0" /* 7628 */ - "canAccessProperty\0" /* 7666 */ - "PHPStan\\Reflection\\ExtendedPropertyReflection\0" /* 7684 */ - "canReadProperty\0" /* 7730 */ - "canWriteProperty\0" /* 7746 */ - "methodReflection\0" /* 7763 */ - "PHPStan\\Reflection\\MethodReflection\0" /* 7780 */ - "canCallMethod\0" /* 7816 */ - "constantReflection\0" /* 7830 */ - "PHPStan\\Reflection\\ClassConstantReflection\0" /* 7849 */ - "canAccessConstant\0" /* 7892 */ - "classMemberReflection\0" /* 7910 */ - "PHPStan\\Reflection\\ClassMemberReflection\0" /* 7932 */ - "canAccessClassMember\0" /* 7973 */ - "debug\0" /* 7994 */ - "typeWithMethod\0" /* 8000 */ - "methodName\0" /* 8015 */ - "filterTypeWithMethod\0" /* 8026 */ - "PHPStan\\Reflection\\ExtendedMethodReflection\0" /* 8047 */ - "getMethodReflection\0" /* 8091 */ - "getNakedMethod\0" /* 8111 */ - "typeWithProperty\0" /* 8126 */ - "getPropertyReflection\0" /* 8143 */ - "getInstancePropertyReflection\0" /* 8165 */ - "getStaticPropertyReflection\0" /* 8195 */ - "typeWithConstant\0" /* 8223 */ - "constantName\0" /* 8240 */ - "getConstantReflection\0" /* 8253 */ - "constantType\0" /* 8275 */ - "getConstantExplicitTypeFromConfig\0" /* 8288 */ - "getConstantTypes\0" /* 8322 */ - "getGlobalConstantType\0" /* 8339 */ - "nameString\0" /* 8361 */ - "createGlobalConstantFetches\0" /* 8372 */ - "getNativeConstantTypes\0" /* 8400 */ - "getIterableKeyType\0" /* 8423 */ - "getIterableValueType\0" /* 8442 */ - "PHPStan\\Php\\PhpVersions\0" /* 8463 */ - "getPhpVersion\0" /* 8487 */ - "getConfiguredPhpVersionRange\0" /* 8501 */ - "isOverallPhpVersionRange\0" /* 8530 */ - "PhpParser\\Node\0" /* 8555 */ - "invokeNodeCallback\0" /* 8570 */ - "collectorType\0" /* 8589 */ - "data\0" /* 8603 */ - "emitCollectedData\0" /* 8608 */ - "extensionClass\0" /* 8626 */ - "trackValueDependency\0" /* 8641 */ - "file\0" /* 8662 */ - "trackFileDependency\0" /* 8667 */ - "directory\0" /* 8687 */ - "pattern\0" /* 8697 */ - "'*'\0" /* 8705 */ - "trackDirectoryDependency\0" /* 8709 */ - "trackClassDependency"; /* 8734 */ + "phpDocClosureScopeTypeParameters\0" /* 3678 */ + "enterClassMethod\0" /* 3711 */ + "hook\0" /* 3728 */ + "PhpParser\\Node\\PropertyHook\0" /* 3733 */ + "propertyName\0" /* 3761 */ + "nativePropertyTypeNode\0" /* 3774 */ + "PhpParser\\Node\\Identifier|PhpParser\\Node\\Name|PhpParser\\Node\\ComplexType\0" /* 3797 */ + "phpDocPropertyType\0" /* 3870 */ + "enterPropertyHook\0" /* 3889 */ + "type\0" /* 3907 */ + "transformStaticType\0" /* 3912 */ + "functionLike\0" /* 3932 */ + "PhpParser\\Node\\FunctionLike\0" /* 3945 */ + "getRealParameterTypes\0" /* 3973 */ + "getRealParameterDefaultValues\0" /* 3995 */ + "PhpParser\\Node\\Stmt\\ClassMethod|PhpParser\\Node\\Stmt\\Function_|PhpParser\\Node\\PropertyHook\0" /* 4025 */ + "getParameterAttributes\0" /* 4115 */ + "PhpParser\\Node\\Stmt\\Function_\0" /* 4138 */ + "pureUnlessCallableIsImpureParameters\0" /* 4168 */ + "pureUnlessParameterPassedParameters\0" /* 4205 */ + "enterFunction\0" /* 4241 */ + "functionReflection\0" /* 4255 */ + "preserveConstructorScope\0" /* 4274 */ + "enterFunctionLike\0" /* 4299 */ + "namespaceName\0" /* 4317 */ + "enterNamespace\0" /* 4331 */ + "thisType\0" /* 4346 */ + "nativeThisType\0" /* 4355 */ + "scopeClasses\0" /* 4370 */ + "enterClosureBind\0" /* 4383 */ + "originalScope\0" /* 4400 */ + "restoreOriginalScopeAfterClosureBind\0" /* 4414 */ + "restoreThisScope\0" /* 4451 */ + "restoreThis\0" /* 4468 */ + "enterClosureCall\0" /* 4480 */ + "isInClosureBind\0" /* 4497 */ + "withClosureBindScopeClasses\0" /* 4513 */ + "closure\0" /* 4541 */ + "PhpParser\\Node\\Expr\\Closure\0" /* 4549 */ + "callableParameters\0" /* 4577 */ + "nativeCallableParameters\0" /* 4596 */ + "enterAnonymousFunction\0" /* 4621 */ + "enterAnonymousFunctionWithoutReflection\0" /* 4644 */ + "typeHolder\0" /* 4684 */ + "PHPStan\\Analyser\\ExpressionTypeHolder\0" /* 4695 */ + "expressionTypeIsUnchangeable\0" /* 4733 */ + "invalidateStaticExpressions\0" /* 4762 */ + "arrowFunction\0" /* 4790 */ + "PhpParser\\Node\\Expr\\ArrowFunction\0" /* 4804 */ + "enterArrowFunction\0" /* 4838 */ + "enterArrowFunctionWithoutReflection\0" /* 4857 */ + "PhpParser\\Node\\Param\0" /* 4893 */ + "isParameterValueNullable\0" /* 4914 */ + "isNullable\0" /* 4939 */ + "isVariadic\0" /* 4950 */ + "getFunctionType\0" /* 4961 */ + "index\0" /* 4977 */ + "getCallableParameterType\0" /* 4983 */ + "startIndex\0" /* 5008 */ + "buildVariadicArrayTypeFromCallableParameters\0" /* 5019 */ + "nativeType\0" /* 5064 */ + "inferredType\0" /* 5075 */ + "intersectButNotNever\0" /* 5088 */ + "PhpParser\\Node\\Expr\\Match_\0" /* 5109 */ + "condType\0" /* 5136 */ + "condNativeType\0" /* 5145 */ + "enterMatch\0" /* 5160 */ + "iteratee\0" /* 5171 */ + "iterateeType\0" /* 5180 */ + "nativeIterateeType\0" /* 5193 */ + "valueName\0" /* 5212 */ + "keyName\0" /* 5222 */ + "valueByRef\0" /* 5230 */ + "enterForeach\0" /* 5241 */ + "enterForeachKey\0" /* 5254 */ + "catchType\0" /* 5270 */ + "enterCatchType\0" /* 5280 */ + "isPlainWrite\0" /* 5295 */ + "enterExpressionAssign\0" /* 5308 */ + "exitExpressionAssign\0" /* 5330 */ + "isInExpressionAssign\0" /* 5351 */ + "isInWriteExpressionAssign\0" /* 5372 */ + "setAllowedUndefinedExpression\0" /* 5398 */ + "unsetAllowedUndefinedExpression\0" /* 5428 */ + "isUndefinedExpressionAllowed\0" /* 5460 */ + "certainty\0" /* 5489 */ + "intertwinedPropagatedFrom\0" /* 5499 */ + "assignVariable\0" /* 5525 */ + "overwriteExpression\0" /* 5540 */ + "scope\0" /* 5560 */ + "rootType\0" /* 5566 */ + "assignedExpr\0" /* 5575 */ + "rootVariableName\0" /* 5588 */ + "native\0" /* 5605 */ + "resolveIntertwinedAssignedType\0" /* 5612 */ + "dimFetch\0" /* 5643 */ + "PhpParser\\Node\\Expr\\ArrayDimFetch\0" /* 5652 */ + "isDimFetchPathReachable\0" /* 5686 */ + "unsetExpression\0" /* 5710 */ + "getStateType\0" /* 5726 */ + "getScopeStateType\0" /* 5739 */ + "getScopeStateNativeType\0" /* 5757 */ + "resolveScopeStateType\0" /* 5781 */ + "specifyExpressionType\0" /* 5803 */ + "openSpecificationScope\0" /* 5825 */ + "isSpecifyExpressionTypeNoop\0" /* 5848 */ + "specifyExpressionTypeInPlace\0" /* 5876 */ + "assignExpression\0" /* 5905 */ + "fetchedOnType\0" /* 5922 */ + "assignInitializedProperty\0" /* 5936 */ + "expressionToInvalidate\0" /* 5962 */ + "requireMoreCharacters\0" /* 5985 */ + "invalidatingClass\0" /* 6007 */ + "keepPropertyFetches\0" /* 6025 */ + "invalidateExpression\0" /* 6045 */ + "isPrivatePropertyOfDifferentClass\0" /* 6066 */ + "invalidateMethodsOnExpression\0" /* 6100 */ + "setExpressionCertaintyKeepingType\0" /* 6130 */ + "isComplexUnionType\0" /* 6164 */ + "addTypeToExpression\0" /* 6183 */ + "typeToRemove\0" /* 6203 */ + "removeTypeFromExpression\0" /* 6216 */ + "filterByTruthyValue\0" /* 6241 */ + "filterByFalseyValue\0" /* 6261 */ + "specifiedTypes\0" /* 6281 */ + "applySpecifiedTypes\0" /* 6296 */ + "specifiedExpressions\0" /* 6316 */ + "processConditionalExpressionsAfterSpecifying\0" /* 6337 */ + "getConditionalExpressions\0" /* 6382 */ + "conditionalExpressionHolders\0" /* 6408 */ + "addConditionalExpressions\0" /* 6437 */ + "exitFirstLevelStatements\0" /* 6463 */ + "isInFirstLevelStatement\0" /* 6488 */ + "otherScope\0" /* 6512 */ + "preserveVacuousConditionals\0" /* 6523 */ + "mergeWith\0" /* 6551 */ + "ours\0" /* 6561 */ + "theirs\0" /* 6566 */ + "collectAbsorbedClosures\0" /* 6573 */ + "mergeWithVariableState\0" /* 6597 */ + "differingExpressionKeys\0" /* 6620 */ + "ourExpressionTypes\0" /* 6644 */ + "theirExpressionTypes\0" /* 6663 */ + "withoutPreciseClassConstantFetches\0" /* 6684 */ + "currentConditionalExpressions\0" /* 6719 */ + "sourceConditionalExpressions\0" /* 6749 */ + "otherExpressionTypes\0" /* 6778 */ + "preserveVacuousConditionalExpressions\0" /* 6799 */ + "ourConditionalExpressions\0" /* 6837 */ + "theirConditionalExpressions\0" /* 6863 */ + "mergeSameGuardConditionalExpressions\0" /* 6891 */ + "newConditionalExpressions\0" /* 6928 */ + "existingConditionalExpressions\0" /* 6954 */ + "mergeConditionalExpressions\0" /* 6985 */ + "calledMethodScope\0" /* 7013 */ + "mergeInitializedProperties\0" /* 7031 */ + "finallyScope\0" /* 7058 */ + "originalFinallyScope\0" /* 7071 */ + "processFinallyScope\0" /* 7092 */ + "ourVariableTypeHolders\0" /* 7112 */ + "finallyVariableTypeHolders\0" /* 7135 */ + "originalVariableTypeHolders\0" /* 7162 */ + "processFinallyScopeVariableTypeHolders\0" /* 7190 */ + "closureScope\0" /* 7229 */ + "prevScope\0" /* 7242 */ + "byRefUses\0" /* 7252 */ + "processClosureScope\0" /* 7262 */ + "finalScope\0" /* 7282 */ + "processAlwaysIterableForeachScopeWithoutPollute\0" /* 7293 */ + "writableVariableNames\0" /* 7341 */ + "generalizeWith\0" /* 7363 */ + "generalizeWithVariableState\0" /* 7378 */ + "variableTypeHolders\0" /* 7406 */ + "otherVariableTypeHolders\0" /* 7426 */ + "generalizeVariableTypeHolders\0" /* 7451 */ + "flattenUnionForGeneralization\0" /* 7481 */ + "a\0" /* 7511 */ + "b\0" /* 7513 */ + "depth\0" /* 7515 */ + "generalizeType\0" /* 7521 */ + "getArrayDepth\0" /* 7536 */ + "equals\0" /* 7550 */ + "otherConditionalExpressions\0" /* 7557 */ + "compareConditionalExpressions\0" /* 7585 */ + "compareVariableTypeHolders\0" /* 7615 */ + "propertyReflection\0" /* 7642 */ + "PHPStan\\Reflection\\PropertyReflection\0" /* 7661 */ + "canAccessProperty\0" /* 7699 */ + "PHPStan\\Reflection\\ExtendedPropertyReflection\0" /* 7717 */ + "canReadProperty\0" /* 7763 */ + "canWriteProperty\0" /* 7779 */ + "methodReflection\0" /* 7796 */ + "PHPStan\\Reflection\\MethodReflection\0" /* 7813 */ + "canCallMethod\0" /* 7849 */ + "constantReflection\0" /* 7863 */ + "PHPStan\\Reflection\\ClassConstantReflection\0" /* 7882 */ + "canAccessConstant\0" /* 7925 */ + "classMemberReflection\0" /* 7943 */ + "PHPStan\\Reflection\\ClassMemberReflection\0" /* 7965 */ + "canAccessClassMember\0" /* 8006 */ + "debug\0" /* 8027 */ + "typeWithMethod\0" /* 8033 */ + "methodName\0" /* 8048 */ + "filterTypeWithMethod\0" /* 8059 */ + "PHPStan\\Reflection\\ExtendedMethodReflection\0" /* 8080 */ + "getMethodReflection\0" /* 8124 */ + "getNakedMethod\0" /* 8144 */ + "typeWithProperty\0" /* 8159 */ + "getPropertyReflection\0" /* 8176 */ + "getInstancePropertyReflection\0" /* 8198 */ + "getStaticPropertyReflection\0" /* 8228 */ + "typeWithConstant\0" /* 8256 */ + "constantName\0" /* 8273 */ + "getConstantReflection\0" /* 8286 */ + "constantType\0" /* 8308 */ + "getConstantExplicitTypeFromConfig\0" /* 8321 */ + "getConstantTypes\0" /* 8355 */ + "getGlobalConstantType\0" /* 8372 */ + "nameString\0" /* 8394 */ + "createGlobalConstantFetches\0" /* 8405 */ + "getNativeConstantTypes\0" /* 8433 */ + "getIterableKeyType\0" /* 8456 */ + "getIterableValueType\0" /* 8475 */ + "PHPStan\\Php\\PhpVersions\0" /* 8496 */ + "getPhpVersion\0" /* 8520 */ + "getConfiguredPhpVersionRange\0" /* 8534 */ + "isOverallPhpVersionRange\0" /* 8563 */ + "PhpParser\\Node\0" /* 8588 */ + "invokeNodeCallback\0" /* 8603 */ + "collectorType\0" /* 8622 */ + "data\0" /* 8636 */ + "emitCollectedData\0" /* 8641 */ + "extensionClass\0" /* 8659 */ + "trackValueDependency\0" /* 8674 */ + "file\0" /* 8695 */ + "trackFileDependency\0" /* 8700 */ + "directory\0" /* 8720 */ + "pattern\0" /* 8730 */ + "'*'\0" /* 8738 */ + "trackDirectoryDependency\0" /* 8742 */ + "trackClassDependency"; /* 8767 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 9), /* __construct $services */ reg::packed(40, 0, 53), /* __construct $scopeFactory */ @@ -674,11 +675,12 @@ inline constexpr reg::PackedArg args[] = { reg::packed(3538, MAY_BE_NULL, 3558, false, false, 222), /* enterClassMethod $resolvedPhpDocBlock */ reg::packed(3593, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterClassMethod $phpDocPureUnlessCallableIsImpureParameters */ reg::packed(3636, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterClassMethod $phpDocPureUnlessParameterPassedParameters */ + reg::packed(3678, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterClassMethod $phpDocClosureScopeTypeParameters */ reg::packed(738, 0, 523), /* enterClassMethod return */ - reg::packed(3695, 0, 3700), /* enterPropertyHook $hook */ - reg::packed(3728, MAY_BE_STRING), /* enterPropertyHook $propertyName */ - reg::packed(3741, MAY_BE_NULL, 3764), /* enterPropertyHook $nativePropertyTypeNode */ - reg::packed(3837, MAY_BE_NULL, 1424), /* enterPropertyHook $phpDocPropertyType */ + reg::packed(3728, 0, 3733), /* enterPropertyHook $hook */ + reg::packed(3761, MAY_BE_STRING), /* enterPropertyHook $propertyName */ + reg::packed(3774, MAY_BE_NULL, 3797), /* enterPropertyHook $nativePropertyTypeNode */ + reg::packed(3870, MAY_BE_NULL, 1424), /* enterPropertyHook $phpDocPropertyType */ reg::packed(3242, MAY_BE_ARRAY), /* enterPropertyHook $phpDocParameterTypes */ reg::packed(3280, MAY_BE_NULL, 1424), /* enterPropertyHook $throwType */ reg::packed(3290, MAY_BE_NULL | MAY_BE_STRING), /* enterPropertyHook $deprecatedDescription */ @@ -687,15 +689,15 @@ inline constexpr reg::PackedArg args[] = { reg::packed(3423, MAY_BE_NULL | MAY_BE_STRING), /* enterPropertyHook $phpDocComment */ reg::packed(3538, MAY_BE_NULL, 3558, false, false, 222), /* enterPropertyHook $resolvedPhpDocBlock */ reg::packed(738, 0, 523), /* enterPropertyHook return */ - reg::packed(3874, 0, 1424), /* transformStaticType $type */ + reg::packed(3907, 0, 1424), /* transformStaticType $type */ reg::packed(738, 0, 1424), /* transformStaticType return */ - reg::packed(3899, 0, 3912), /* getRealParameterTypes $functionLike */ + reg::packed(3932, 0, 3945), /* getRealParameterTypes $functionLike */ reg::packed(738, MAY_BE_ARRAY), /* getRealParameterTypes return */ - reg::packed(3899, 0, 3912), /* getRealParameterDefaultValues $functionLike */ + reg::packed(3932, 0, 3945), /* getRealParameterDefaultValues $functionLike */ reg::packed(738, MAY_BE_ARRAY), /* getRealParameterDefaultValues return */ - reg::packed(3899, 0, 3992), /* getParameterAttributes $functionLike */ + reg::packed(3932, 0, 4025), /* getParameterAttributes $functionLike */ reg::packed(738, MAY_BE_ARRAY), /* getParameterAttributes return */ - reg::packed(154, 0, 4105), /* enterFunction $function */ + reg::packed(154, 0, 4138), /* enterFunction $function */ reg::packed(3189, 0, 3205), /* enterFunction $templateTypeMap */ reg::packed(3242, MAY_BE_ARRAY), /* enterFunction $phpDocParameterTypes */ reg::packed(3263, MAY_BE_NULL, 1424), /* enterFunction $phpDocReturnType */ @@ -710,87 +712,88 @@ inline constexpr reg::PackedArg args[] = { reg::packed(3437, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterFunction $parameterOutTypes */ reg::packed(3455, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterFunction $immediatelyInvokedCallableParameters */ reg::packed(3492, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterFunction $phpDocClosureThisTypeParameters */ - reg::packed(4135, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterFunction $pureUnlessCallableIsImpureParameters */ - reg::packed(4172, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterFunction $pureUnlessParameterPassedParameters */ + reg::packed(4168, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterFunction $pureUnlessCallableIsImpureParameters */ + reg::packed(4205, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterFunction $pureUnlessParameterPassedParameters */ + reg::packed(3678, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* enterFunction $phpDocClosureScopeTypeParameters */ reg::packed(738, 0, 523), /* enterFunction return */ - reg::packed(4222, 0, 163), /* enterFunctionLike $functionReflection */ - reg::packed(4241, MAY_BE_BOOL), /* enterFunctionLike $preserveConstructorScope */ + reg::packed(4255, 0, 163), /* enterFunctionLike $functionReflection */ + reg::packed(4274, MAY_BE_BOOL), /* enterFunctionLike $preserveConstructorScope */ reg::packed(738, 0, 523), /* enterFunctionLike return */ - reg::packed(4284, MAY_BE_STRING), /* enterNamespace $namespaceName */ + reg::packed(4317, MAY_BE_STRING), /* enterNamespace $namespaceName */ reg::packed(738, 0, 523), /* enterNamespace return */ - reg::packed(4313, MAY_BE_NULL, 1424), /* enterClosureBind $thisType */ - reg::packed(4322, MAY_BE_NULL, 1424), /* enterClosureBind $nativeThisType */ - reg::packed(4337, MAY_BE_ARRAY), /* enterClosureBind $scopeClasses */ + reg::packed(4346, MAY_BE_NULL, 1424), /* enterClosureBind $thisType */ + reg::packed(4355, MAY_BE_NULL, 1424), /* enterClosureBind $nativeThisType */ + reg::packed(4370, MAY_BE_ARRAY), /* enterClosureBind $scopeClasses */ reg::packed(738, 0, 523), /* enterClosureBind return */ - reg::packed(4367, 0, 523), /* restoreOriginalScopeAfterClosureBind $originalScope */ + reg::packed(4400, 0, 523), /* restoreOriginalScopeAfterClosureBind $originalScope */ reg::packed(738, 0, 523), /* restoreOriginalScopeAfterClosureBind return */ - reg::packed(4418, 0, 523), /* restoreThis $restoreThisScope */ + reg::packed(4451, 0, 523), /* restoreThis $restoreThisScope */ reg::packed(738, 0, 523), /* restoreThis return */ - reg::packed(4313, 0, 1424), /* enterClosureCall $thisType */ - reg::packed(4322, 0, 1424), /* enterClosureCall $nativeThisType */ + reg::packed(4346, 0, 1424), /* enterClosureCall $thisType */ + reg::packed(4355, 0, 1424), /* enterClosureCall $nativeThisType */ reg::packed(738, 0, 523), /* enterClosureCall return */ reg::packed(738, MAY_BE_BOOL), /* isInClosureBind return */ - reg::packed(4337, MAY_BE_ARRAY), /* withClosureBindScopeClasses $scopeClasses */ + reg::packed(4370, MAY_BE_ARRAY), /* withClosureBindScopeClasses $scopeClasses */ reg::packed(738, 0, 523), /* withClosureBindScopeClasses return */ - reg::packed(4508, 0, 4516), /* enterAnonymousFunction $closure */ - reg::packed(4544, MAY_BE_NULL | MAY_BE_ARRAY), /* enterAnonymousFunction $callableParameters */ - reg::packed(4563, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 222), /* enterAnonymousFunction $nativeCallableParameters */ + reg::packed(4541, 0, 4549), /* enterAnonymousFunction $closure */ + reg::packed(4577, MAY_BE_NULL | MAY_BE_ARRAY), /* enterAnonymousFunction $callableParameters */ + reg::packed(4596, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 222), /* enterAnonymousFunction $nativeCallableParameters */ reg::packed(738, 0, 523), /* enterAnonymousFunction return */ - reg::packed(4508, 0, 4516), /* enterAnonymousFunctionWithoutReflection $closure */ - reg::packed(4544, MAY_BE_NULL | MAY_BE_ARRAY), /* enterAnonymousFunctionWithoutReflection $callableParameters */ - reg::packed(4563, MAY_BE_NULL | MAY_BE_ARRAY), /* enterAnonymousFunctionWithoutReflection $nativeCallableParameters */ + reg::packed(4541, 0, 4549), /* enterAnonymousFunctionWithoutReflection $closure */ + reg::packed(4577, MAY_BE_NULL | MAY_BE_ARRAY), /* enterAnonymousFunctionWithoutReflection $callableParameters */ + reg::packed(4596, MAY_BE_NULL | MAY_BE_ARRAY), /* enterAnonymousFunctionWithoutReflection $nativeCallableParameters */ reg::packed(738, 0, 523), /* enterAnonymousFunctionWithoutReflection return */ - reg::packed(4651, 0, 4662), /* expressionTypeIsUnchangeable $typeHolder */ + reg::packed(4684, 0, 4695), /* expressionTypeIsUnchangeable $typeHolder */ reg::packed(738, MAY_BE_BOOL), /* expressionTypeIsUnchangeable return */ reg::packed(237, MAY_BE_ARRAY), /* invalidateStaticExpressions $expressionTypes */ reg::packed(738, MAY_BE_ARRAY), /* invalidateStaticExpressions return */ - reg::packed(4757, 0, 4771), /* enterArrowFunction $arrowFunction */ - reg::packed(4544, MAY_BE_NULL | MAY_BE_ARRAY), /* enterArrowFunction $callableParameters */ - reg::packed(4563, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 222), /* enterArrowFunction $nativeCallableParameters */ + reg::packed(4790, 0, 4804), /* enterArrowFunction $arrowFunction */ + reg::packed(4577, MAY_BE_NULL | MAY_BE_ARRAY), /* enterArrowFunction $callableParameters */ + reg::packed(4596, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 222), /* enterArrowFunction $nativeCallableParameters */ reg::packed(738, 0, 523), /* enterArrowFunction return */ - reg::packed(4757, 0, 4771), /* enterArrowFunctionWithoutReflection $arrowFunction */ - reg::packed(4544, MAY_BE_NULL | MAY_BE_ARRAY), /* enterArrowFunctionWithoutReflection $callableParameters */ - reg::packed(4563, MAY_BE_NULL | MAY_BE_ARRAY), /* enterArrowFunctionWithoutReflection $nativeCallableParameters */ + reg::packed(4790, 0, 4804), /* enterArrowFunctionWithoutReflection $arrowFunction */ + reg::packed(4577, MAY_BE_NULL | MAY_BE_ARRAY), /* enterArrowFunctionWithoutReflection $callableParameters */ + reg::packed(4596, MAY_BE_NULL | MAY_BE_ARRAY), /* enterArrowFunctionWithoutReflection $nativeCallableParameters */ reg::packed(738, 0, 523), /* enterArrowFunctionWithoutReflection return */ - reg::packed(2877, 0, 4860), /* isParameterValueNullable $parameter */ + reg::packed(2877, 0, 4893), /* isParameterValueNullable $parameter */ reg::packed(738, MAY_BE_BOOL), /* isParameterValueNullable return */ - reg::packed(3874, 0), /* getFunctionType $type */ - reg::packed(4906, MAY_BE_BOOL), /* getFunctionType $isNullable */ - reg::packed(4917, MAY_BE_BOOL), /* getFunctionType $isVariadic */ + reg::packed(3907, 0), /* getFunctionType $type */ + reg::packed(4939, MAY_BE_BOOL), /* getFunctionType $isNullable */ + reg::packed(4950, MAY_BE_BOOL), /* getFunctionType $isVariadic */ reg::packed(738, 0, 1424), /* getFunctionType return */ - reg::packed(2877, 0, 4860), /* getCallableParameterType $parameter */ - reg::packed(4544, MAY_BE_ARRAY), /* getCallableParameterType $callableParameters */ - reg::packed(4944, MAY_BE_LONG), /* getCallableParameterType $index */ + reg::packed(2877, 0, 4893), /* getCallableParameterType $parameter */ + reg::packed(4577, MAY_BE_ARRAY), /* getCallableParameterType $callableParameters */ + reg::packed(4977, MAY_BE_LONG), /* getCallableParameterType $index */ reg::packed(738, 0, 1424), /* getCallableParameterType return */ - reg::packed(4544, MAY_BE_ARRAY), /* buildVariadicArrayTypeFromCallableParameters $callableParameters */ - reg::packed(4975, MAY_BE_LONG), /* buildVariadicArrayTypeFromCallableParameters $startIndex */ + reg::packed(4577, MAY_BE_ARRAY), /* buildVariadicArrayTypeFromCallableParameters $callableParameters */ + reg::packed(5008, MAY_BE_LONG), /* buildVariadicArrayTypeFromCallableParameters $startIndex */ reg::packed(738, 0, 1424), /* buildVariadicArrayTypeFromCallableParameters return */ - reg::packed(5031, 0, 1424), /* intersectButNotNever $nativeType */ - reg::packed(5042, 0, 1424), /* intersectButNotNever $inferredType */ + reg::packed(5064, 0, 1424), /* intersectButNotNever $nativeType */ + reg::packed(5075, 0, 1424), /* intersectButNotNever $inferredType */ reg::packed(738, 0, 1424), /* intersectButNotNever return */ - reg::packed(966, 0, 5076), /* enterMatch $expr */ - reg::packed(5103, 0, 1424), /* enterMatch $condType */ - reg::packed(5112, 0, 1424), /* enterMatch $condNativeType */ + reg::packed(966, 0, 5109), /* enterMatch $expr */ + reg::packed(5136, 0, 1424), /* enterMatch $condType */ + reg::packed(5145, 0, 1424), /* enterMatch $condNativeType */ reg::packed(738, 0, 523), /* enterMatch return */ - reg::packed(4367, 0, 523), /* enterForeach $originalScope */ - reg::packed(5138, 0, 1712), /* enterForeach $iteratee */ - reg::packed(5147, 0, 1424), /* enterForeach $iterateeType */ - reg::packed(5160, 0, 1424), /* enterForeach $nativeIterateeType */ - reg::packed(5179, MAY_BE_STRING), /* enterForeach $valueName */ - reg::packed(5189, MAY_BE_NULL | MAY_BE_STRING), /* enterForeach $keyName */ - reg::packed(5197, MAY_BE_BOOL), /* enterForeach $valueByRef */ + reg::packed(4400, 0, 523), /* enterForeach $originalScope */ + reg::packed(5171, 0, 1712), /* enterForeach $iteratee */ + reg::packed(5180, 0, 1424), /* enterForeach $iterateeType */ + reg::packed(5193, 0, 1424), /* enterForeach $nativeIterateeType */ + reg::packed(5212, MAY_BE_STRING), /* enterForeach $valueName */ + reg::packed(5222, MAY_BE_NULL | MAY_BE_STRING), /* enterForeach $keyName */ + reg::packed(5230, MAY_BE_BOOL), /* enterForeach $valueByRef */ reg::packed(738, 0, 523), /* enterForeach return */ - reg::packed(4367, 0, 523), /* enterForeachKey $originalScope */ - reg::packed(5138, 0, 1712), /* enterForeachKey $iteratee */ - reg::packed(5147, 0, 1424), /* enterForeachKey $iterateeType */ - reg::packed(5160, 0, 1424), /* enterForeachKey $nativeIterateeType */ - reg::packed(5189, MAY_BE_STRING), /* enterForeachKey $keyName */ + reg::packed(4400, 0, 523), /* enterForeachKey $originalScope */ + reg::packed(5171, 0, 1712), /* enterForeachKey $iteratee */ + reg::packed(5180, 0, 1424), /* enterForeachKey $iterateeType */ + reg::packed(5193, 0, 1424), /* enterForeachKey $nativeIterateeType */ + reg::packed(5222, MAY_BE_STRING), /* enterForeachKey $keyName */ reg::packed(738, 0, 523), /* enterForeachKey return */ - reg::packed(5237, 0, 1424), /* enterCatchType $catchType */ + reg::packed(5270, 0, 1424), /* enterCatchType $catchType */ reg::packed(1374, MAY_BE_NULL | MAY_BE_STRING), /* enterCatchType $variableName */ reg::packed(738, 0, 523), /* enterCatchType return */ reg::packed(966, 0, 1712), /* enterExpressionAssign $expr */ - reg::packed(5262, MAY_BE_BOOL, reg::NoString, false, false, 402), /* enterExpressionAssign $isPlainWrite */ + reg::packed(5295, MAY_BE_BOOL, reg::NoString, false, false, 402), /* enterExpressionAssign $isPlainWrite */ reg::packed(738, 0, 523), /* enterExpressionAssign return */ reg::packed(966, 0, 1712), /* exitExpressionAssign $expr */ reg::packed(738, 0, 523), /* exitExpressionAssign return */ @@ -805,23 +808,23 @@ inline constexpr reg::PackedArg args[] = { reg::packed(966, 0, 1712), /* isUndefinedExpressionAllowed $expr */ reg::packed(738, MAY_BE_BOOL), /* isUndefinedExpressionAllowed return */ reg::packed(1374, MAY_BE_STRING), /* assignVariable $variableName */ - reg::packed(3874, 0, 1424), /* assignVariable $type */ - reg::packed(5031, 0, 1424), /* assignVariable $nativeType */ - reg::packed(5456, 0, 1387), /* assignVariable $certainty */ - reg::packed(5466, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* assignVariable $intertwinedPropagatedFrom */ + reg::packed(3907, 0, 1424), /* assignVariable $type */ + reg::packed(5064, 0, 1424), /* assignVariable $nativeType */ + reg::packed(5489, 0, 1387), /* assignVariable $certainty */ + reg::packed(5499, MAY_BE_ARRAY, reg::NoString, false, false, 253), /* assignVariable $intertwinedPropagatedFrom */ reg::packed(738, 0, 523), /* assignVariable return */ reg::packed(966, 0, 1712), /* overwriteExpression $expr */ - reg::packed(3874, 0, 1424), /* overwriteExpression $type */ - reg::packed(5031, 0, 1424), /* overwriteExpression $nativeType */ + reg::packed(3907, 0, 1424), /* overwriteExpression $type */ + reg::packed(5064, 0, 1424), /* overwriteExpression $nativeType */ reg::packed(738, 0, 523), /* overwriteExpression return */ - reg::packed(5527, 0, 523), /* resolveIntertwinedAssignedType $scope */ - reg::packed(5533, 0, 1424), /* resolveIntertwinedAssignedType $rootType */ - reg::packed(5542, 0, 1712), /* resolveIntertwinedAssignedType $assignedExpr */ - reg::packed(5555, MAY_BE_STRING), /* resolveIntertwinedAssignedType $rootVariableName */ - reg::packed(5572, MAY_BE_BOOL), /* resolveIntertwinedAssignedType $native */ + reg::packed(5560, 0, 523), /* resolveIntertwinedAssignedType $scope */ + reg::packed(5566, 0, 1424), /* resolveIntertwinedAssignedType $rootType */ + reg::packed(5575, 0, 1712), /* resolveIntertwinedAssignedType $assignedExpr */ + reg::packed(5588, MAY_BE_STRING), /* resolveIntertwinedAssignedType $rootVariableName */ + reg::packed(5605, MAY_BE_BOOL), /* resolveIntertwinedAssignedType $native */ reg::packed(738, 0, 1424), /* resolveIntertwinedAssignedType return */ - reg::packed(5527, 0, 523), /* isDimFetchPathReachable $scope */ - reg::packed(5610, 0, 5619), /* isDimFetchPathReachable $dimFetch */ + reg::packed(5560, 0, 523), /* isDimFetchPathReachable $scope */ + reg::packed(5643, 0, 5652), /* isDimFetchPathReachable $dimFetch */ reg::packed(738, MAY_BE_BOOL), /* isDimFetchPathReachable return */ reg::packed(966, 0, 1712), /* unsetExpression $expr */ reg::packed(738, 0, 523), /* unsetExpression return */ @@ -832,194 +835,194 @@ inline constexpr reg::PackedArg args[] = { reg::packed(966, 0, 1712), /* getScopeStateNativeType $expr */ reg::packed(738, 0, 1424), /* getScopeStateNativeType return */ reg::packed(966, 0, 1712), /* resolveScopeStateType $expr */ - reg::packed(5572, MAY_BE_BOOL), /* resolveScopeStateType $native */ + reg::packed(5605, MAY_BE_BOOL), /* resolveScopeStateType $native */ reg::packed(738, 0, 1424), /* resolveScopeStateType return */ reg::packed(966, 0, 1712), /* specifyExpressionType $expr */ - reg::packed(3874, 0, 1424), /* specifyExpressionType $type */ - reg::packed(5031, 0, 1424), /* specifyExpressionType $nativeType */ - reg::packed(5456, 0, 1387), /* specifyExpressionType $certainty */ + reg::packed(3907, 0, 1424), /* specifyExpressionType $type */ + reg::packed(5064, 0, 1424), /* specifyExpressionType $nativeType */ + reg::packed(5489, 0, 1387), /* specifyExpressionType $certainty */ reg::packed(738, 0, 523), /* specifyExpressionType return */ reg::packed(738, 0, 523), /* openSpecificationScope return */ reg::packed(966, 0, 1712), /* isSpecifyExpressionTypeNoop $expr */ - reg::packed(3874, 0, 1424), /* isSpecifyExpressionTypeNoop $type */ + reg::packed(3907, 0, 1424), /* isSpecifyExpressionTypeNoop $type */ reg::packed(738, MAY_BE_BOOL), /* isSpecifyExpressionTypeNoop return */ reg::packed(966, 0, 1712), /* specifyExpressionTypeInPlace $expr */ - reg::packed(3874, 0, 1424), /* specifyExpressionTypeInPlace $type */ - reg::packed(5031, 0, 1424), /* specifyExpressionTypeInPlace $nativeType */ - reg::packed(5456, 0, 1387), /* specifyExpressionTypeInPlace $certainty */ + reg::packed(3907, 0, 1424), /* specifyExpressionTypeInPlace $type */ + reg::packed(5064, 0, 1424), /* specifyExpressionTypeInPlace $nativeType */ + reg::packed(5489, 0, 1387), /* specifyExpressionTypeInPlace $certainty */ reg::packed(738, MAY_BE_VOID), /* specifyExpressionTypeInPlace return */ reg::packed(966, 0, 1712), /* assignExpression $expr */ - reg::packed(3874, 0, 1424), /* assignExpression $type */ - reg::packed(5031, 0, 1424), /* assignExpression $nativeType */ + reg::packed(3907, 0, 1424), /* assignExpression $type */ + reg::packed(5064, 0, 1424), /* assignExpression $nativeType */ reg::packed(738, 0, 523), /* assignExpression return */ - reg::packed(5889, 0, 1424), /* assignInitializedProperty $fetchedOnType */ - reg::packed(3728, MAY_BE_STRING), /* assignInitializedProperty $propertyName */ + reg::packed(5922, 0, 1424), /* assignInitializedProperty $fetchedOnType */ + reg::packed(3761, MAY_BE_STRING), /* assignInitializedProperty $propertyName */ reg::packed(738, 0, 523), /* assignInitializedProperty return */ - reg::packed(5929, 0, 1712), /* invalidateExpression $expressionToInvalidate */ - reg::packed(5952, MAY_BE_BOOL, reg::NoString, false, false, 148), /* invalidateExpression $requireMoreCharacters */ - reg::packed(5974, MAY_BE_NULL, 1065, false, false, 222), /* invalidateExpression $invalidatingClass */ - reg::packed(5992, MAY_BE_BOOL, reg::NoString, false, false, 148), /* invalidateExpression $keepPropertyFetches */ + reg::packed(5962, 0, 1712), /* invalidateExpression $expressionToInvalidate */ + reg::packed(5985, MAY_BE_BOOL, reg::NoString, false, false, 148), /* invalidateExpression $requireMoreCharacters */ + reg::packed(6007, MAY_BE_NULL, 1065, false, false, 222), /* invalidateExpression $invalidatingClass */ + reg::packed(6025, MAY_BE_BOOL, reg::NoString, false, false, 148), /* invalidateExpression $keepPropertyFetches */ reg::packed(738, 0, 523), /* invalidateExpression return */ reg::packed(966, 0, 1712), /* isPrivatePropertyOfDifferentClass $expr */ - reg::packed(5974, 0, 1065), /* isPrivatePropertyOfDifferentClass $invalidatingClass */ + reg::packed(6007, 0, 1065), /* isPrivatePropertyOfDifferentClass $invalidatingClass */ reg::packed(738, MAY_BE_BOOL), /* isPrivatePropertyOfDifferentClass return */ - reg::packed(5929, 0, 1712), /* invalidateMethodsOnExpression $expressionToInvalidate */ + reg::packed(5962, 0, 1712), /* invalidateMethodsOnExpression $expressionToInvalidate */ reg::packed(738, 0, 523), /* invalidateMethodsOnExpression return */ reg::packed(966, 0, 1712), /* setExpressionCertaintyKeepingType $expr */ - reg::packed(5456, 0, 1387), /* setExpressionCertaintyKeepingType $certainty */ + reg::packed(5489, 0, 1387), /* setExpressionCertaintyKeepingType $certainty */ reg::packed(738, 0, 523), /* setExpressionCertaintyKeepingType return */ - reg::packed(3874, 0, 1424), /* isComplexUnionType $type */ + reg::packed(3907, 0, 1424), /* isComplexUnionType $type */ reg::packed(738, MAY_BE_BOOL), /* isComplexUnionType return */ reg::packed(966, 0, 1712), /* addTypeToExpression $expr */ - reg::packed(3874, 0, 1424), /* addTypeToExpression $type */ + reg::packed(3907, 0, 1424), /* addTypeToExpression $type */ reg::packed(738, 0, 523), /* addTypeToExpression return */ reg::packed(966, 0, 1712), /* removeTypeFromExpression $expr */ - reg::packed(6170, 0, 1424), /* removeTypeFromExpression $typeToRemove */ + reg::packed(6203, 0, 1424), /* removeTypeFromExpression $typeToRemove */ reg::packed(738, 0, 523), /* removeTypeFromExpression return */ reg::packed(966, 0, 1712), /* filterByTruthyValue $expr */ reg::packed(738, 0, 523), /* filterByTruthyValue return */ reg::packed(966, 0, 1712), /* filterByFalseyValue $expr */ reg::packed(738, 0, 523), /* filterByFalseyValue return */ - reg::packed(6248, 0, 2035), /* applySpecifiedTypes $specifiedTypes */ + reg::packed(6281, 0, 2035), /* applySpecifiedTypes $specifiedTypes */ reg::packed(738, 0, 523), /* applySpecifiedTypes return */ - reg::packed(6283, MAY_BE_ARRAY), /* processConditionalExpressionsAfterSpecifying $specifiedExpressions */ + reg::packed(6316, MAY_BE_ARRAY), /* processConditionalExpressionsAfterSpecifying $specifiedExpressions */ reg::packed(738, 0, 523), /* processConditionalExpressionsAfterSpecifying return */ reg::packed(738, MAY_BE_ARRAY), /* getConditionalExpressions return */ reg::packed(1883, MAY_BE_STRING), /* addConditionalExpressions $exprString */ - reg::packed(6375, MAY_BE_ARRAY), /* addConditionalExpressions $conditionalExpressionHolders */ + reg::packed(6408, MAY_BE_ARRAY), /* addConditionalExpressions $conditionalExpressionHolders */ reg::packed(738, 0, 523), /* addConditionalExpressions return */ reg::packed(738, 0, 523), /* exitFirstLevelStatements return */ reg::packed(738, MAY_BE_BOOL), /* isInFirstLevelStatement return */ - reg::packed(6479, MAY_BE_NULL, 523), /* mergeWith $otherScope */ - reg::packed(6490, MAY_BE_BOOL, reg::NoString, false, false, 148), /* mergeWith $preserveVacuousConditionals */ + reg::packed(6512, MAY_BE_NULL, 523), /* mergeWith $otherScope */ + reg::packed(6523, MAY_BE_BOOL, reg::NoString, false, false, 148), /* mergeWith $preserveVacuousConditionals */ reg::packed(738, 0, 523), /* mergeWith return */ - reg::packed(6528, 0, 523), /* collectAbsorbedClosures $ours */ - reg::packed(6533, 0, 523), /* collectAbsorbedClosures $theirs */ + reg::packed(6561, 0, 523), /* collectAbsorbedClosures $ours */ + reg::packed(6566, 0, 523), /* collectAbsorbedClosures $theirs */ reg::packed(738, MAY_BE_NULL, 672), /* collectAbsorbedClosures return */ - reg::packed(6479, MAY_BE_NULL, 523), /* mergeWithVariableState $otherScope */ - reg::packed(6490, MAY_BE_BOOL, reg::NoString, false, false, 148), /* mergeWithVariableState $preserveVacuousConditionals */ + reg::packed(6512, MAY_BE_NULL, 523), /* mergeWithVariableState $otherScope */ + reg::packed(6523, MAY_BE_BOOL, reg::NoString, false, false, 148), /* mergeWithVariableState $preserveVacuousConditionals */ reg::packed(738, 0, 523), /* mergeWithVariableState return */ - reg::packed(6587, MAY_BE_ARRAY), /* withoutPreciseClassConstantFetches $differingExpressionKeys */ - reg::packed(6611, MAY_BE_ARRAY), /* withoutPreciseClassConstantFetches $ourExpressionTypes */ - reg::packed(6630, MAY_BE_ARRAY), /* withoutPreciseClassConstantFetches $theirExpressionTypes */ + reg::packed(6620, MAY_BE_ARRAY), /* withoutPreciseClassConstantFetches $differingExpressionKeys */ + reg::packed(6644, MAY_BE_ARRAY), /* withoutPreciseClassConstantFetches $ourExpressionTypes */ + reg::packed(6663, MAY_BE_ARRAY), /* withoutPreciseClassConstantFetches $theirExpressionTypes */ reg::packed(738, MAY_BE_ARRAY), /* withoutPreciseClassConstantFetches return */ - reg::packed(6686, MAY_BE_ARRAY), /* preserveVacuousConditionalExpressions $currentConditionalExpressions */ - reg::packed(6716, MAY_BE_ARRAY), /* preserveVacuousConditionalExpressions $sourceConditionalExpressions */ - reg::packed(6745, MAY_BE_ARRAY), /* preserveVacuousConditionalExpressions $otherExpressionTypes */ + reg::packed(6719, MAY_BE_ARRAY), /* preserveVacuousConditionalExpressions $currentConditionalExpressions */ + reg::packed(6749, MAY_BE_ARRAY), /* preserveVacuousConditionalExpressions $sourceConditionalExpressions */ + reg::packed(6778, MAY_BE_ARRAY), /* preserveVacuousConditionalExpressions $otherExpressionTypes */ reg::packed(738, MAY_BE_ARRAY), /* preserveVacuousConditionalExpressions return */ - reg::packed(6686, MAY_BE_ARRAY), /* mergeSameGuardConditionalExpressions $currentConditionalExpressions */ - reg::packed(6804, MAY_BE_ARRAY), /* mergeSameGuardConditionalExpressions $ourConditionalExpressions */ - reg::packed(6830, MAY_BE_ARRAY), /* mergeSameGuardConditionalExpressions $theirConditionalExpressions */ + reg::packed(6719, MAY_BE_ARRAY), /* mergeSameGuardConditionalExpressions $currentConditionalExpressions */ + reg::packed(6837, MAY_BE_ARRAY), /* mergeSameGuardConditionalExpressions $ourConditionalExpressions */ + reg::packed(6863, MAY_BE_ARRAY), /* mergeSameGuardConditionalExpressions $theirConditionalExpressions */ reg::packed(738, MAY_BE_ARRAY), /* mergeSameGuardConditionalExpressions return */ - reg::packed(6895, MAY_BE_ARRAY), /* mergeConditionalExpressions $newConditionalExpressions */ - reg::packed(6921, MAY_BE_ARRAY), /* mergeConditionalExpressions $existingConditionalExpressions */ + reg::packed(6928, MAY_BE_ARRAY), /* mergeConditionalExpressions $newConditionalExpressions */ + reg::packed(6954, MAY_BE_ARRAY), /* mergeConditionalExpressions $existingConditionalExpressions */ reg::packed(738, MAY_BE_ARRAY), /* mergeConditionalExpressions return */ - reg::packed(6980, 0, 523), /* mergeInitializedProperties $calledMethodScope */ + reg::packed(7013, 0, 523), /* mergeInitializedProperties $calledMethodScope */ reg::packed(738, 0, 523), /* mergeInitializedProperties return */ - reg::packed(7025, 0, 523), /* processFinallyScope $finallyScope */ - reg::packed(7038, 0, 523), /* processFinallyScope $originalFinallyScope */ + reg::packed(7058, 0, 523), /* processFinallyScope $finallyScope */ + reg::packed(7071, 0, 523), /* processFinallyScope $originalFinallyScope */ reg::packed(738, 0, 523), /* processFinallyScope return */ - reg::packed(7079, MAY_BE_ARRAY), /* processFinallyScopeVariableTypeHolders $ourVariableTypeHolders */ - reg::packed(7102, MAY_BE_ARRAY), /* processFinallyScopeVariableTypeHolders $finallyVariableTypeHolders */ - reg::packed(7129, MAY_BE_ARRAY), /* processFinallyScopeVariableTypeHolders $originalVariableTypeHolders */ + reg::packed(7112, MAY_BE_ARRAY), /* processFinallyScopeVariableTypeHolders $ourVariableTypeHolders */ + reg::packed(7135, MAY_BE_ARRAY), /* processFinallyScopeVariableTypeHolders $finallyVariableTypeHolders */ + reg::packed(7162, MAY_BE_ARRAY), /* processFinallyScopeVariableTypeHolders $originalVariableTypeHolders */ reg::packed(738, MAY_BE_ARRAY), /* processFinallyScopeVariableTypeHolders return */ - reg::packed(7196, 0, 523), /* processClosureScope $closureScope */ - reg::packed(7209, MAY_BE_NULL, 523), /* processClosureScope $prevScope */ - reg::packed(7219, MAY_BE_ARRAY), /* processClosureScope $byRefUses */ + reg::packed(7229, 0, 523), /* processClosureScope $closureScope */ + reg::packed(7242, MAY_BE_NULL, 523), /* processClosureScope $prevScope */ + reg::packed(7252, MAY_BE_ARRAY), /* processClosureScope $byRefUses */ reg::packed(738, 0, 523), /* processClosureScope return */ - reg::packed(7249, 0, 523), /* processAlwaysIterableForeachScopeWithoutPollute $finalScope */ + reg::packed(7282, 0, 523), /* processAlwaysIterableForeachScopeWithoutPollute $finalScope */ reg::packed(738, 0, 523), /* processAlwaysIterableForeachScopeWithoutPollute return */ - reg::packed(6479, 0, 523), /* generalizeWith $otherScope */ - reg::packed(7308, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 222), /* generalizeWith $writableVariableNames */ + reg::packed(6512, 0, 523), /* generalizeWith $otherScope */ + reg::packed(7341, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 222), /* generalizeWith $writableVariableNames */ reg::packed(738, 0, 523), /* generalizeWith return */ - reg::packed(6479, 0, 523), /* generalizeWithVariableState $otherScope */ - reg::packed(7308, MAY_BE_NULL | MAY_BE_ARRAY), /* generalizeWithVariableState $writableVariableNames */ + reg::packed(6512, 0, 523), /* generalizeWithVariableState $otherScope */ + reg::packed(7341, MAY_BE_NULL | MAY_BE_ARRAY), /* generalizeWithVariableState $writableVariableNames */ reg::packed(738, 0, 523), /* generalizeWithVariableState return */ - reg::packed(7373, MAY_BE_ARRAY), /* generalizeVariableTypeHolders $variableTypeHolders */ - reg::packed(7393, MAY_BE_ARRAY), /* generalizeVariableTypeHolders $otherVariableTypeHolders */ - reg::packed(7308, MAY_BE_NULL | MAY_BE_ARRAY), /* generalizeVariableTypeHolders $writableVariableNames */ + reg::packed(7406, MAY_BE_ARRAY), /* generalizeVariableTypeHolders $variableTypeHolders */ + reg::packed(7426, MAY_BE_ARRAY), /* generalizeVariableTypeHolders $otherVariableTypeHolders */ + reg::packed(7341, MAY_BE_NULL | MAY_BE_ARRAY), /* generalizeVariableTypeHolders $writableVariableNames */ reg::packed(738, MAY_BE_ARRAY), /* generalizeVariableTypeHolders return */ - reg::packed(3874, 0, 1424), /* flattenUnionForGeneralization $type */ + reg::packed(3907, 0, 1424), /* flattenUnionForGeneralization $type */ reg::packed(738, MAY_BE_ARRAY), /* flattenUnionForGeneralization return */ - reg::packed(7478, 0, 1424), /* generalizeType $a */ - reg::packed(7480, 0, 1424), /* generalizeType $b */ - reg::packed(7482, MAY_BE_LONG), /* generalizeType $depth */ + reg::packed(7511, 0, 1424), /* generalizeType $a */ + reg::packed(7513, 0, 1424), /* generalizeType $b */ + reg::packed(7515, MAY_BE_LONG), /* generalizeType $depth */ reg::packed(738, 0, 1424), /* generalizeType return */ - reg::packed(3874, 0, 1424), /* getArrayDepth $type */ + reg::packed(3907, 0, 1424), /* getArrayDepth $type */ reg::packed(738, MAY_BE_LONG), /* getArrayDepth return */ - reg::packed(6479, 0, 523), /* equals $otherScope */ + reg::packed(6512, 0, 523), /* equals $otherScope */ reg::packed(738, MAY_BE_BOOL), /* equals return */ reg::packed(278, MAY_BE_ARRAY), /* compareConditionalExpressions $conditionalExpressions */ - reg::packed(7524, MAY_BE_ARRAY), /* compareConditionalExpressions $otherConditionalExpressions */ + reg::packed(7557, MAY_BE_ARRAY), /* compareConditionalExpressions $otherConditionalExpressions */ reg::packed(738, MAY_BE_BOOL), /* compareConditionalExpressions return */ - reg::packed(7373, MAY_BE_ARRAY), /* compareVariableTypeHolders $variableTypeHolders */ - reg::packed(7393, MAY_BE_ARRAY), /* compareVariableTypeHolders $otherVariableTypeHolders */ + reg::packed(7406, MAY_BE_ARRAY), /* compareVariableTypeHolders $variableTypeHolders */ + reg::packed(7426, MAY_BE_ARRAY), /* compareVariableTypeHolders $otherVariableTypeHolders */ reg::packed(738, MAY_BE_BOOL), /* compareVariableTypeHolders return */ - reg::packed(7609, 0, 7628), /* canAccessProperty $propertyReflection */ + reg::packed(7642, 0, 7661), /* canAccessProperty $propertyReflection */ reg::packed(738, MAY_BE_BOOL), /* canAccessProperty return */ - reg::packed(7609, 0, 7684), /* canReadProperty $propertyReflection */ + reg::packed(7642, 0, 7717), /* canReadProperty $propertyReflection */ reg::packed(738, MAY_BE_BOOL), /* canReadProperty return */ - reg::packed(7609, 0, 7684), /* canWriteProperty $propertyReflection */ + reg::packed(7642, 0, 7717), /* canWriteProperty $propertyReflection */ reg::packed(738, MAY_BE_BOOL), /* canWriteProperty return */ - reg::packed(7763, 0, 7780), /* canCallMethod $methodReflection */ + reg::packed(7796, 0, 7813), /* canCallMethod $methodReflection */ reg::packed(738, MAY_BE_BOOL), /* canCallMethod return */ - reg::packed(7830, 0, 7849), /* canAccessConstant $constantReflection */ + reg::packed(7863, 0, 7882), /* canAccessConstant $constantReflection */ reg::packed(738, MAY_BE_BOOL), /* canAccessConstant return */ - reg::packed(7910, 0, 7932), /* canAccessClassMember $classMemberReflection */ + reg::packed(7943, 0, 7965), /* canAccessClassMember $classMemberReflection */ reg::packed(738, MAY_BE_BOOL), /* canAccessClassMember return */ reg::packed(738, MAY_BE_ARRAY), /* debug return */ - reg::packed(8000, 0, 1424), /* filterTypeWithMethod $typeWithMethod */ - reg::packed(8015, MAY_BE_STRING), /* filterTypeWithMethod $methodName */ + reg::packed(8033, 0, 1424), /* filterTypeWithMethod $typeWithMethod */ + reg::packed(8048, MAY_BE_STRING), /* filterTypeWithMethod $methodName */ reg::packed(738, MAY_BE_NULL, 1424), /* filterTypeWithMethod return */ - reg::packed(8000, 0, 1424), /* getMethodReflection $typeWithMethod */ - reg::packed(8015, MAY_BE_STRING), /* getMethodReflection $methodName */ - reg::packed(738, MAY_BE_NULL, 8047), /* getMethodReflection return */ - reg::packed(8000, 0, 1424), /* getNakedMethod $typeWithMethod */ - reg::packed(8015, MAY_BE_STRING), /* getNakedMethod $methodName */ - reg::packed(738, MAY_BE_NULL, 8047), /* getNakedMethod return */ - reg::packed(8126, 0, 1424), /* getPropertyReflection $typeWithProperty */ - reg::packed(3728, MAY_BE_STRING), /* getPropertyReflection $propertyName */ - reg::packed(738, MAY_BE_NULL, 7684), /* getPropertyReflection return */ - reg::packed(8126, 0, 1424), /* getInstancePropertyReflection $typeWithProperty */ - reg::packed(3728, MAY_BE_STRING), /* getInstancePropertyReflection $propertyName */ - reg::packed(738, MAY_BE_NULL, 7684), /* getInstancePropertyReflection return */ - reg::packed(8126, 0, 1424), /* getStaticPropertyReflection $typeWithProperty */ - reg::packed(3728, MAY_BE_STRING), /* getStaticPropertyReflection $propertyName */ - reg::packed(738, MAY_BE_NULL, 7684), /* getStaticPropertyReflection return */ - reg::packed(8223, 0, 1424), /* getConstantReflection $typeWithConstant */ - reg::packed(8240, MAY_BE_STRING), /* getConstantReflection $constantName */ - reg::packed(738, MAY_BE_NULL, 7849), /* getConstantReflection return */ - reg::packed(8240, MAY_BE_STRING), /* getConstantExplicitTypeFromConfig $constantName */ - reg::packed(8275, 0, 1424), /* getConstantExplicitTypeFromConfig $constantType */ + reg::packed(8033, 0, 1424), /* getMethodReflection $typeWithMethod */ + reg::packed(8048, MAY_BE_STRING), /* getMethodReflection $methodName */ + reg::packed(738, MAY_BE_NULL, 8080), /* getMethodReflection return */ + reg::packed(8033, 0, 1424), /* getNakedMethod $typeWithMethod */ + reg::packed(8048, MAY_BE_STRING), /* getNakedMethod $methodName */ + reg::packed(738, MAY_BE_NULL, 8080), /* getNakedMethod return */ + reg::packed(8159, 0, 1424), /* getPropertyReflection $typeWithProperty */ + reg::packed(3761, MAY_BE_STRING), /* getPropertyReflection $propertyName */ + reg::packed(738, MAY_BE_NULL, 7717), /* getPropertyReflection return */ + reg::packed(8159, 0, 1424), /* getInstancePropertyReflection $typeWithProperty */ + reg::packed(3761, MAY_BE_STRING), /* getInstancePropertyReflection $propertyName */ + reg::packed(738, MAY_BE_NULL, 7717), /* getInstancePropertyReflection return */ + reg::packed(8159, 0, 1424), /* getStaticPropertyReflection $typeWithProperty */ + reg::packed(3761, MAY_BE_STRING), /* getStaticPropertyReflection $propertyName */ + reg::packed(738, MAY_BE_NULL, 7717), /* getStaticPropertyReflection return */ + reg::packed(8256, 0, 1424), /* getConstantReflection $typeWithConstant */ + reg::packed(8273, MAY_BE_STRING), /* getConstantReflection $constantName */ + reg::packed(738, MAY_BE_NULL, 7882), /* getConstantReflection return */ + reg::packed(8273, MAY_BE_STRING), /* getConstantExplicitTypeFromConfig $constantName */ + reg::packed(8308, 0, 1424), /* getConstantExplicitTypeFromConfig $constantType */ reg::packed(738, 0, 1424), /* getConstantExplicitTypeFromConfig return */ reg::packed(738, MAY_BE_ARRAY), /* getConstantTypes return */ reg::packed(1520, 0, 1525), /* getGlobalConstantType $name */ reg::packed(738, MAY_BE_NULL, 1424), /* getGlobalConstantType return */ reg::packed(1520, 0, 1525), /* createGlobalConstantFetches $name */ - reg::packed(8361, MAY_BE_STRING), /* createGlobalConstantFetches $nameString */ + reg::packed(8394, MAY_BE_STRING), /* createGlobalConstantFetches $nameString */ reg::packed(227, MAY_BE_NULL | MAY_BE_STRING), /* createGlobalConstantFetches $namespace */ reg::packed(738, MAY_BE_ARRAY), /* createGlobalConstantFetches return */ reg::packed(738, MAY_BE_ARRAY), /* getNativeConstantTypes return */ - reg::packed(5138, 0, 1424), /* getIterableKeyType $iteratee */ + reg::packed(5171, 0, 1424), /* getIterableKeyType $iteratee */ reg::packed(738, 0, 1424), /* getIterableKeyType return */ - reg::packed(5138, 0, 1424), /* getIterableValueType $iteratee */ + reg::packed(5171, 0, 1424), /* getIterableValueType $iteratee */ reg::packed(738, 0, 1424), /* getIterableValueType return */ - reg::packed(738, 0, 8463), /* getPhpVersion return */ + reg::packed(738, 0, 8496), /* getPhpVersion return */ reg::packed(738, MAY_BE_NULL, 1424), /* getConfiguredPhpVersionRange return */ - reg::packed(3874, 0, 1424), /* isOverallPhpVersionRange $type */ + reg::packed(3907, 0, 1424), /* isOverallPhpVersionRange $type */ reg::packed(738, MAY_BE_BOOL), /* isOverallPhpVersionRange return */ - reg::packed(1707, 0, 8555), /* invokeNodeCallback $node */ + reg::packed(1707, 0, 8588), /* invokeNodeCallback $node */ reg::packed(738, MAY_BE_VOID), /* invokeNodeCallback return */ - reg::packed(8589, MAY_BE_STRING), /* emitCollectedData $collectorType */ - reg::packed(8603, MAY_BE_ANY), /* emitCollectedData $data */ + reg::packed(8622, MAY_BE_STRING), /* emitCollectedData $collectorType */ + reg::packed(8636, MAY_BE_ANY), /* emitCollectedData $data */ reg::packed(738, MAY_BE_VOID), /* emitCollectedData return */ - reg::packed(8626, MAY_BE_STRING), /* trackValueDependency $extensionClass */ + reg::packed(8659, MAY_BE_STRING), /* trackValueDependency $extensionClass */ reg::packed(2540, MAY_BE_STRING), /* trackValueDependency $key */ reg::packed(738, MAY_BE_VOID), /* trackValueDependency return */ - reg::packed(8662, MAY_BE_STRING), /* trackFileDependency $file */ + reg::packed(8695, MAY_BE_STRING), /* trackFileDependency $file */ reg::packed(738, MAY_BE_VOID), /* trackFileDependency return */ - reg::packed(8687, MAY_BE_STRING), /* trackDirectoryDependency $directory */ - reg::packed(8697, MAY_BE_STRING, reg::NoString, false, false, 8705), /* trackDirectoryDependency $pattern */ + reg::packed(8720, MAY_BE_STRING), /* trackDirectoryDependency $directory */ + reg::packed(8730, MAY_BE_STRING, reg::NoString, false, false, 8738), /* trackDirectoryDependency $pattern */ reg::packed(738, MAY_BE_VOID), /* trackDirectoryDependency return */ reg::packed(2977, MAY_BE_STRING), /* trackClassDependency $className */ reg::packed(738, MAY_BE_VOID), /* trackClassDependency return */ @@ -1110,124 +1113,124 @@ inline constexpr sigtab::Sig getFunctionCallStackWithParameters = { { 3024 /* ge inline constexpr sigtab::Sig isInFunctionExists = { { 3072 /* isInFunctionExists */, 1, 153, 1, 154, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig enterClass = { { 3107 /* enterClass */, 1, 155, 1, 156, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig enterTrait = { { 3134 /* enterTrait */, 1, 157, 1, 158, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterClassMethod = { { 3678 /* enterClassMethod */, 9, 159, 21, 180, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterPropertyHook = { { 3856 /* enterPropertyHook */, 10, 181, 11, 192, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig transformStaticType = { { 3879 /* transformStaticType */, 1, 193, 1, 194, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getRealParameterTypes = { { 3940 /* getRealParameterTypes */, 1, 195, 1, 196, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getRealParameterDefaultValues = { { 3962 /* getRealParameterDefaultValues */, 1, 197, 1, 198, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getParameterAttributes = { { 4082 /* getParameterAttributes */, 1, 199, 1, 200, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig enterFunction = { { 4208 /* enterFunction */, 8, 201, 17, 218, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterFunctionLike = { { 4266 /* enterFunctionLike */, 2, 219, 2, 221, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig enterNamespace = { { 4298 /* enterNamespace */, 1, 222, 1, 223, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterClosureBind = { { 4350 /* enterClosureBind */, 3, 224, 3, 227, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig restoreOriginalScopeAfterClosureBind = { { 4381 /* restoreOriginalScopeAfterClosureBind */, 1, 228, 1, 229, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig restoreThis = { { 4435 /* restoreThis */, 1, 230, 1, 231, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterClosureCall = { { 4447 /* enterClosureCall */, 2, 232, 2, 234, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isInClosureBind = { { 4464 /* isInClosureBind */, 0, 235, 0, 235, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withClosureBindScopeClasses = { { 4480 /* withClosureBindScopeClasses */, 1, 236, 1, 237, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterAnonymousFunction = { { 4588 /* enterAnonymousFunction */, 2, 238, 3, 241, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterAnonymousFunctionWithoutReflection = { { 4611 /* enterAnonymousFunctionWithoutReflection */, 3, 242, 3, 245, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig expressionTypeIsUnchangeable = { { 4700 /* expressionTypeIsUnchangeable */, 1, 246, 1, 247, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig invalidateStaticExpressions = { { 4729 /* invalidateStaticExpressions */, 1, 248, 1, 249, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig enterArrowFunction = { { 4805 /* enterArrowFunction */, 2, 250, 3, 253, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterArrowFunctionWithoutReflection = { { 4824 /* enterArrowFunctionWithoutReflection */, 3, 254, 3, 257, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isParameterValueNullable = { { 4881 /* isParameterValueNullable */, 1, 258, 1, 259, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getFunctionType = { { 4928 /* getFunctionType */, 3, 260, 3, 263, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getCallableParameterType = { { 4950 /* getCallableParameterType */, 3, 264, 3, 267, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig buildVariadicArrayTypeFromCallableParameters = { { 4986 /* buildVariadicArrayTypeFromCallableParameters */, 2, 268, 2, 270, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig intersectButNotNever = { { 5055 /* intersectButNotNever */, 2, 271, 2, 273, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig enterMatch = { { 5127 /* enterMatch */, 3, 274, 3, 277, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterForeach = { { 5208 /* enterForeach */, 7, 278, 7, 285, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterForeachKey = { { 5221 /* enterForeachKey */, 5, 286, 5, 291, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterCatchType = { { 5247 /* enterCatchType */, 2, 292, 2, 294, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterExpressionAssign = { { 5275 /* enterExpressionAssign */, 1, 295, 2, 297, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig exitExpressionAssign = { { 5297 /* exitExpressionAssign */, 1, 298, 1, 299, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isInExpressionAssign = { { 5318 /* isInExpressionAssign */, 1, 300, 1, 301, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isInWriteExpressionAssign = { { 5339 /* isInWriteExpressionAssign */, 1, 302, 1, 303, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig setAllowedUndefinedExpression = { { 5365 /* setAllowedUndefinedExpression */, 1, 304, 1, 305, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig unsetAllowedUndefinedExpression = { { 5395 /* unsetAllowedUndefinedExpression */, 1, 306, 1, 307, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isUndefinedExpressionAllowed = { { 5427 /* isUndefinedExpressionAllowed */, 1, 308, 1, 309, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig assignVariable = { { 5492 /* assignVariable */, 4, 310, 5, 315, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig overwriteExpression = { { 5507 /* overwriteExpression */, 3, 316, 3, 319, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveIntertwinedAssignedType = { { 5579 /* resolveIntertwinedAssignedType */, 5, 320, 5, 325, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isDimFetchPathReachable = { { 5653 /* isDimFetchPathReachable */, 2, 326, 2, 328, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig unsetExpression = { { 5677 /* unsetExpression */, 1, 329, 1, 330, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getStateType = { { 5693 /* getStateType */, 1, 331, 1, 332, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getScopeStateType = { { 5706 /* getScopeStateType */, 1, 333, 1, 334, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getScopeStateNativeType = { { 5724 /* getScopeStateNativeType */, 1, 335, 1, 336, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveScopeStateType = { { 5748 /* resolveScopeStateType */, 2, 337, 2, 339, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig specifyExpressionType = { { 5770 /* specifyExpressionType */, 4, 340, 4, 344, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig openSpecificationScope = { { 5792 /* openSpecificationScope */, 0, 345, 0, 345, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isSpecifyExpressionTypeNoop = { { 5815 /* isSpecifyExpressionTypeNoop */, 2, 346, 2, 348, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig specifyExpressionTypeInPlace = { { 5843 /* specifyExpressionTypeInPlace */, 4, 349, 4, 353, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig assignExpression = { { 5872 /* assignExpression */, 3, 354, 3, 357, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig assignInitializedProperty = { { 5903 /* assignInitializedProperty */, 2, 358, 2, 360, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig invalidateExpression = { { 6012 /* invalidateExpression */, 1, 361, 4, 365, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isPrivatePropertyOfDifferentClass = { { 6033 /* isPrivatePropertyOfDifferentClass */, 2, 366, 2, 368, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig invalidateMethodsOnExpression = { { 6067 /* invalidateMethodsOnExpression */, 1, 369, 1, 370, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig setExpressionCertaintyKeepingType = { { 6097 /* setExpressionCertaintyKeepingType */, 2, 371, 2, 373, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isComplexUnionType = { { 6131 /* isComplexUnionType */, 1, 374, 1, 375, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig addTypeToExpression = { { 6150 /* addTypeToExpression */, 2, 376, 2, 378, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig removeTypeFromExpression = { { 6183 /* removeTypeFromExpression */, 2, 379, 2, 381, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig filterByTruthyValue = { { 6208 /* filterByTruthyValue */, 1, 382, 1, 383, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig filterByFalseyValue = { { 6228 /* filterByFalseyValue */, 1, 384, 1, 385, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig applySpecifiedTypes = { { 6263 /* applySpecifiedTypes */, 1, 386, 1, 387, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig processConditionalExpressionsAfterSpecifying = { { 6304 /* processConditionalExpressionsAfterSpecifying */, 1, 388, 1, 389, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getConditionalExpressions = { { 6349 /* getConditionalExpressions */, 0, 390, 0, 390, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig addConditionalExpressions = { { 6404 /* addConditionalExpressions */, 2, 391, 2, 393, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig exitFirstLevelStatements = { { 6430 /* exitFirstLevelStatements */, 0, 394, 0, 394, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isInFirstLevelStatement = { { 6455 /* isInFirstLevelStatement */, 0, 395, 0, 395, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig mergeWith = { { 6518 /* mergeWith */, 1, 396, 2, 398, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig collectAbsorbedClosures = { { 6540 /* collectAbsorbedClosures */, 2, 399, 2, 401, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig mergeWithVariableState = { { 6564 /* mergeWithVariableState */, 1, 402, 2, 404, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig withoutPreciseClassConstantFetches = { { 6651 /* withoutPreciseClassConstantFetches */, 3, 405, 3, 408, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig preserveVacuousConditionalExpressions = { { 6766 /* preserveVacuousConditionalExpressions */, 3, 409, 3, 412, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig mergeSameGuardConditionalExpressions = { { 6858 /* mergeSameGuardConditionalExpressions */, 3, 413, 3, 416, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig mergeConditionalExpressions = { { 6952 /* mergeConditionalExpressions */, 2, 417, 2, 419, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig mergeInitializedProperties = { { 6998 /* mergeInitializedProperties */, 1, 420, 1, 421, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig processFinallyScope = { { 7059 /* processFinallyScope */, 2, 422, 2, 424, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig processFinallyScopeVariableTypeHolders = { { 7157 /* processFinallyScopeVariableTypeHolders */, 3, 425, 3, 428, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processClosureScope = { { 7229 /* processClosureScope */, 3, 429, 3, 432, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig processAlwaysIterableForeachScopeWithoutPollute = { { 7260 /* processAlwaysIterableForeachScopeWithoutPollute */, 1, 433, 1, 434, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig generalizeWith = { { 7330 /* generalizeWith */, 1, 435, 2, 437, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig generalizeWithVariableState = { { 7345 /* generalizeWithVariableState */, 2, 438, 2, 440, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig generalizeVariableTypeHolders = { { 7418 /* generalizeVariableTypeHolders */, 3, 441, 3, 444, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig flattenUnionForGeneralization = { { 7448 /* flattenUnionForGeneralization */, 1, 445, 1, 446, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig generalizeType = { { 7488 /* generalizeType */, 3, 447, 3, 450, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getArrayDepth = { { 7503 /* getArrayDepth */, 1, 451, 1, 452, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig equals = { { 7517 /* equals */, 1, 453, 1, 454, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig compareConditionalExpressions = { { 7552 /* compareConditionalExpressions */, 2, 455, 2, 457, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig compareVariableTypeHolders = { { 7582 /* compareVariableTypeHolders */, 2, 458, 2, 460, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig canAccessProperty = { { 7666 /* canAccessProperty */, 1, 461, 1, 462, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canReadProperty = { { 7730 /* canReadProperty */, 1, 463, 1, 464, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canWriteProperty = { { 7746 /* canWriteProperty */, 1, 465, 1, 466, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canCallMethod = { { 7816 /* canCallMethod */, 1, 467, 1, 468, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canAccessConstant = { { 7892 /* canAccessConstant */, 1, 469, 1, 470, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canAccessClassMember = { { 7973 /* canAccessClassMember */, 1, 471, 1, 472, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig debug = { { 7994 /* debug */, 0, 473, 0, 473, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig filterTypeWithMethod = { { 8026 /* filterTypeWithMethod */, 2, 474, 2, 476, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getMethodReflection = { { 8091 /* getMethodReflection */, 2, 477, 2, 479, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getNakedMethod = { { 8111 /* getNakedMethod */, 2, 480, 2, 482, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPropertyReflection = { { 8143 /* getPropertyReflection */, 2, 483, 2, 485, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getInstancePropertyReflection = { { 8165 /* getInstancePropertyReflection */, 2, 486, 2, 488, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getStaticPropertyReflection = { { 8195 /* getStaticPropertyReflection */, 2, 489, 2, 491, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantReflection = { { 8253 /* getConstantReflection */, 2, 492, 2, 494, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantExplicitTypeFromConfig = { { 8288 /* getConstantExplicitTypeFromConfig */, 2, 495, 2, 497, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantTypes = { { 8322 /* getConstantTypes */, 0, 498, 0, 498, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getGlobalConstantType = { { 8339 /* getGlobalConstantType */, 1, 499, 1, 500, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig createGlobalConstantFetches = { { 8372 /* createGlobalConstantFetches */, 3, 501, 3, 504, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig getNativeConstantTypes = { { 8400 /* getNativeConstantTypes */, 0, 505, 0, 505, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getIterableKeyType = { { 8423 /* getIterableKeyType */, 1, 506, 1, 507, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getIterableValueType = { { 8442 /* getIterableValueType */, 1, 508, 1, 509, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPhpVersion = { { 8487 /* getPhpVersion */, 0, 510, 0, 510, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConfiguredPhpVersionRange = { { 8501 /* getConfiguredPhpVersionRange */, 0, 511, 0, 511, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isOverallPhpVersionRange = { { 8530 /* isOverallPhpVersionRange */, 1, 512, 1, 513, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig invokeNodeCallback = { { 8570 /* invokeNodeCallback */, 1, 514, 1, 515, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig emitCollectedData = { { 8608 /* emitCollectedData */, 2, 516, 2, 518, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig trackValueDependency = { { 8641 /* trackValueDependency */, 2, 519, 2, 521, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig trackFileDependency = { { 8667 /* trackFileDependency */, 1, 522, 1, 523, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig trackDirectoryDependency = { { 8709 /* trackDirectoryDependency */, 1, 524, 2, 526, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig trackClassDependency = { { 8734 /* trackClassDependency */, 1, 527, 1, 528, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterClassMethod = { { 3711 /* enterClassMethod */, 9, 159, 22, 181, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterPropertyHook = { { 3889 /* enterPropertyHook */, 10, 182, 11, 193, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig transformStaticType = { { 3912 /* transformStaticType */, 1, 194, 1, 195, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getRealParameterTypes = { { 3973 /* getRealParameterTypes */, 1, 196, 1, 197, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getRealParameterDefaultValues = { { 3995 /* getRealParameterDefaultValues */, 1, 198, 1, 199, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getParameterAttributes = { { 4115 /* getParameterAttributes */, 1, 200, 1, 201, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig enterFunction = { { 4241 /* enterFunction */, 8, 202, 18, 220, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterFunctionLike = { { 4299 /* enterFunctionLike */, 2, 221, 2, 223, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig enterNamespace = { { 4331 /* enterNamespace */, 1, 224, 1, 225, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterClosureBind = { { 4383 /* enterClosureBind */, 3, 226, 3, 229, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig restoreOriginalScopeAfterClosureBind = { { 4414 /* restoreOriginalScopeAfterClosureBind */, 1, 230, 1, 231, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig restoreThis = { { 4468 /* restoreThis */, 1, 232, 1, 233, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterClosureCall = { { 4480 /* enterClosureCall */, 2, 234, 2, 236, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isInClosureBind = { { 4497 /* isInClosureBind */, 0, 237, 0, 237, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withClosureBindScopeClasses = { { 4513 /* withClosureBindScopeClasses */, 1, 238, 1, 239, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterAnonymousFunction = { { 4621 /* enterAnonymousFunction */, 2, 240, 3, 243, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterAnonymousFunctionWithoutReflection = { { 4644 /* enterAnonymousFunctionWithoutReflection */, 3, 244, 3, 247, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig expressionTypeIsUnchangeable = { { 4733 /* expressionTypeIsUnchangeable */, 1, 248, 1, 249, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig invalidateStaticExpressions = { { 4762 /* invalidateStaticExpressions */, 1, 250, 1, 251, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig enterArrowFunction = { { 4838 /* enterArrowFunction */, 2, 252, 3, 255, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterArrowFunctionWithoutReflection = { { 4857 /* enterArrowFunctionWithoutReflection */, 3, 256, 3, 259, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isParameterValueNullable = { { 4914 /* isParameterValueNullable */, 1, 260, 1, 261, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getFunctionType = { { 4961 /* getFunctionType */, 3, 262, 3, 265, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getCallableParameterType = { { 4983 /* getCallableParameterType */, 3, 266, 3, 269, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig buildVariadicArrayTypeFromCallableParameters = { { 5019 /* buildVariadicArrayTypeFromCallableParameters */, 2, 270, 2, 272, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig intersectButNotNever = { { 5088 /* intersectButNotNever */, 2, 273, 2, 275, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig enterMatch = { { 5160 /* enterMatch */, 3, 276, 3, 279, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterForeach = { { 5241 /* enterForeach */, 7, 280, 7, 287, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterForeachKey = { { 5254 /* enterForeachKey */, 5, 288, 5, 293, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterCatchType = { { 5280 /* enterCatchType */, 2, 294, 2, 296, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterExpressionAssign = { { 5308 /* enterExpressionAssign */, 1, 297, 2, 299, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig exitExpressionAssign = { { 5330 /* exitExpressionAssign */, 1, 300, 1, 301, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isInExpressionAssign = { { 5351 /* isInExpressionAssign */, 1, 302, 1, 303, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isInWriteExpressionAssign = { { 5372 /* isInWriteExpressionAssign */, 1, 304, 1, 305, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig setAllowedUndefinedExpression = { { 5398 /* setAllowedUndefinedExpression */, 1, 306, 1, 307, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig unsetAllowedUndefinedExpression = { { 5428 /* unsetAllowedUndefinedExpression */, 1, 308, 1, 309, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isUndefinedExpressionAllowed = { { 5460 /* isUndefinedExpressionAllowed */, 1, 310, 1, 311, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig assignVariable = { { 5525 /* assignVariable */, 4, 312, 5, 317, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig overwriteExpression = { { 5540 /* overwriteExpression */, 3, 318, 3, 321, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveIntertwinedAssignedType = { { 5612 /* resolveIntertwinedAssignedType */, 5, 322, 5, 327, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isDimFetchPathReachable = { { 5686 /* isDimFetchPathReachable */, 2, 328, 2, 330, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig unsetExpression = { { 5710 /* unsetExpression */, 1, 331, 1, 332, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getStateType = { { 5726 /* getStateType */, 1, 333, 1, 334, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getScopeStateType = { { 5739 /* getScopeStateType */, 1, 335, 1, 336, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getScopeStateNativeType = { { 5757 /* getScopeStateNativeType */, 1, 337, 1, 338, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveScopeStateType = { { 5781 /* resolveScopeStateType */, 2, 339, 2, 341, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig specifyExpressionType = { { 5803 /* specifyExpressionType */, 4, 342, 4, 346, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig openSpecificationScope = { { 5825 /* openSpecificationScope */, 0, 347, 0, 347, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isSpecifyExpressionTypeNoop = { { 5848 /* isSpecifyExpressionTypeNoop */, 2, 348, 2, 350, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig specifyExpressionTypeInPlace = { { 5876 /* specifyExpressionTypeInPlace */, 4, 351, 4, 355, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig assignExpression = { { 5905 /* assignExpression */, 3, 356, 3, 359, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig assignInitializedProperty = { { 5936 /* assignInitializedProperty */, 2, 360, 2, 362, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig invalidateExpression = { { 6045 /* invalidateExpression */, 1, 363, 4, 367, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isPrivatePropertyOfDifferentClass = { { 6066 /* isPrivatePropertyOfDifferentClass */, 2, 368, 2, 370, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig invalidateMethodsOnExpression = { { 6100 /* invalidateMethodsOnExpression */, 1, 371, 1, 372, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig setExpressionCertaintyKeepingType = { { 6130 /* setExpressionCertaintyKeepingType */, 2, 373, 2, 375, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isComplexUnionType = { { 6164 /* isComplexUnionType */, 1, 376, 1, 377, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig addTypeToExpression = { { 6183 /* addTypeToExpression */, 2, 378, 2, 380, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig removeTypeFromExpression = { { 6216 /* removeTypeFromExpression */, 2, 381, 2, 383, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig filterByTruthyValue = { { 6241 /* filterByTruthyValue */, 1, 384, 1, 385, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig filterByFalseyValue = { { 6261 /* filterByFalseyValue */, 1, 386, 1, 387, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig applySpecifiedTypes = { { 6296 /* applySpecifiedTypes */, 1, 388, 1, 389, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig processConditionalExpressionsAfterSpecifying = { { 6337 /* processConditionalExpressionsAfterSpecifying */, 1, 390, 1, 391, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getConditionalExpressions = { { 6382 /* getConditionalExpressions */, 0, 392, 0, 392, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig addConditionalExpressions = { { 6437 /* addConditionalExpressions */, 2, 393, 2, 395, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig exitFirstLevelStatements = { { 6463 /* exitFirstLevelStatements */, 0, 396, 0, 396, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isInFirstLevelStatement = { { 6488 /* isInFirstLevelStatement */, 0, 397, 0, 397, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig mergeWith = { { 6551 /* mergeWith */, 1, 398, 2, 400, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig collectAbsorbedClosures = { { 6573 /* collectAbsorbedClosures */, 2, 401, 2, 403, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig mergeWithVariableState = { { 6597 /* mergeWithVariableState */, 1, 404, 2, 406, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig withoutPreciseClassConstantFetches = { { 6684 /* withoutPreciseClassConstantFetches */, 3, 407, 3, 410, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig preserveVacuousConditionalExpressions = { { 6799 /* preserveVacuousConditionalExpressions */, 3, 411, 3, 414, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig mergeSameGuardConditionalExpressions = { { 6891 /* mergeSameGuardConditionalExpressions */, 3, 415, 3, 418, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig mergeConditionalExpressions = { { 6985 /* mergeConditionalExpressions */, 2, 419, 2, 421, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig mergeInitializedProperties = { { 7031 /* mergeInitializedProperties */, 1, 422, 1, 423, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig processFinallyScope = { { 7092 /* processFinallyScope */, 2, 424, 2, 426, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig processFinallyScopeVariableTypeHolders = { { 7190 /* processFinallyScopeVariableTypeHolders */, 3, 427, 3, 430, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processClosureScope = { { 7262 /* processClosureScope */, 3, 431, 3, 434, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig processAlwaysIterableForeachScopeWithoutPollute = { { 7293 /* processAlwaysIterableForeachScopeWithoutPollute */, 1, 435, 1, 436, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig generalizeWith = { { 7363 /* generalizeWith */, 1, 437, 2, 439, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig generalizeWithVariableState = { { 7378 /* generalizeWithVariableState */, 2, 440, 2, 442, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig generalizeVariableTypeHolders = { { 7451 /* generalizeVariableTypeHolders */, 3, 443, 3, 446, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig flattenUnionForGeneralization = { { 7481 /* flattenUnionForGeneralization */, 1, 447, 1, 448, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig generalizeType = { { 7521 /* generalizeType */, 3, 449, 3, 452, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getArrayDepth = { { 7536 /* getArrayDepth */, 1, 453, 1, 454, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig equals = { { 7550 /* equals */, 1, 455, 1, 456, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig compareConditionalExpressions = { { 7585 /* compareConditionalExpressions */, 2, 457, 2, 459, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig compareVariableTypeHolders = { { 7615 /* compareVariableTypeHolders */, 2, 460, 2, 462, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig canAccessProperty = { { 7699 /* canAccessProperty */, 1, 463, 1, 464, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canReadProperty = { { 7763 /* canReadProperty */, 1, 465, 1, 466, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canWriteProperty = { { 7779 /* canWriteProperty */, 1, 467, 1, 468, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canCallMethod = { { 7849 /* canCallMethod */, 1, 469, 1, 470, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canAccessConstant = { { 7925 /* canAccessConstant */, 1, 471, 1, 472, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canAccessClassMember = { { 8006 /* canAccessClassMember */, 1, 473, 1, 474, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig debug = { { 8027 /* debug */, 0, 475, 0, 475, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig filterTypeWithMethod = { { 8059 /* filterTypeWithMethod */, 2, 476, 2, 478, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getMethodReflection = { { 8124 /* getMethodReflection */, 2, 479, 2, 481, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getNakedMethod = { { 8144 /* getNakedMethod */, 2, 482, 2, 484, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPropertyReflection = { { 8176 /* getPropertyReflection */, 2, 485, 2, 487, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getInstancePropertyReflection = { { 8198 /* getInstancePropertyReflection */, 2, 488, 2, 490, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getStaticPropertyReflection = { { 8228 /* getStaticPropertyReflection */, 2, 491, 2, 493, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantReflection = { { 8286 /* getConstantReflection */, 2, 494, 2, 496, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantExplicitTypeFromConfig = { { 8321 /* getConstantExplicitTypeFromConfig */, 2, 497, 2, 499, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantTypes = { { 8355 /* getConstantTypes */, 0, 500, 0, 500, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getGlobalConstantType = { { 8372 /* getGlobalConstantType */, 1, 501, 1, 502, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig createGlobalConstantFetches = { { 8405 /* createGlobalConstantFetches */, 3, 503, 3, 506, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig getNativeConstantTypes = { { 8433 /* getNativeConstantTypes */, 0, 507, 0, 507, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getIterableKeyType = { { 8456 /* getIterableKeyType */, 1, 508, 1, 509, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getIterableValueType = { { 8475 /* getIterableValueType */, 1, 510, 1, 511, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPhpVersion = { { 8520 /* getPhpVersion */, 0, 512, 0, 512, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConfiguredPhpVersionRange = { { 8534 /* getConfiguredPhpVersionRange */, 0, 513, 0, 513, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isOverallPhpVersionRange = { { 8563 /* isOverallPhpVersionRange */, 1, 514, 1, 515, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig invokeNodeCallback = { { 8603 /* invokeNodeCallback */, 1, 516, 1, 517, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig emitCollectedData = { { 8641 /* emitCollectedData */, 2, 518, 2, 520, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig trackValueDependency = { { 8674 /* trackValueDependency */, 2, 521, 2, 523, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig trackFileDependency = { { 8700 /* trackFileDependency */, 1, 524, 1, 525, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig trackDirectoryDependency = { { 8742 /* trackDirectoryDependency */, 1, 526, 2, 528, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig trackClassDependency = { { 8767 /* trackClassDependency */, 1, 529, 1, 530, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::MutatingScope diff --git a/turbo-ext/src/generated/PhpClassReflectionExtension.h b/turbo-ext/src/generated/PhpClassReflectionExtension.h index ce22088dd4b..1ec4b389c2f 100644 --- a/turbo-ext/src/generated/PhpClassReflectionExtension.h +++ b/turbo-ext/src/generated/PhpClassReflectionExtension.h @@ -151,32 +151,34 @@ inline constexpr char strings[] = "closureThisParameters\0" /* 2006 */ "phpDocFromStubs\0" /* 2028 */ "usePhpDocParameterNames\0" /* 2044 */ - "PHPStan\\Reflection\\ExtendedFunctionVariant\0" /* 2068 */ - "createNativeMethodVariant\0" /* 2111 */ - "propertyReflection\0" /* 2137 */ - "PHPStan\\BetterReflection\\Reflection\\Adapter\\ReflectionProperty\0" /* 2156 */ - "findPropertyTrait\0" /* 2219 */ - "findMethodTrait\0" /* 2237 */ - "constructor\0" /* 2253 */ - "PHPStan\\Reflection\\MethodReflection\0" /* 2265 */ - "inferPrivatePropertyType\0" /* 2301 */ - "inferAndCachePropertyTypes\0" /* 2326 */ - "className\0" /* 2353 */ - "nodes\0" /* 2363 */ - "PhpParser\\Node\\Stmt\\Class_\0" /* 2369 */ - "findClassNode\0" /* 2396 */ - "classStatements\0" /* 2410 */ - "PhpParser\\Node\\Stmt\\ClassMethod\0" /* 2426 */ - "findConstructorNode\0" /* 2458 */ - "phpDocBlockClassReflection\0" /* 2478 */ - "resolvedPhpDoc\0" /* 2505 */ - "PHPStan\\PhpDoc\\ResolvedPhpDocBlock\0" /* 2520 */ - "nativeReturnType\0" /* 2555 */ - "getPhpDocReturnType\0" /* 2572 */ - "declaringClass\0" /* 2592 */ - "implementingClass\0" /* 2607 */ - "positionalParameterNames\0" /* 2625 */ - "findMethodPhpDocIncludingAncestors"; /* 2650 */ + "closureScopeParameters\0" /* 2068 */ + "[]\0" /* 2091 */ + "PHPStan\\Reflection\\ExtendedFunctionVariant\0" /* 2094 */ + "createNativeMethodVariant\0" /* 2137 */ + "propertyReflection\0" /* 2163 */ + "PHPStan\\BetterReflection\\Reflection\\Adapter\\ReflectionProperty\0" /* 2182 */ + "findPropertyTrait\0" /* 2245 */ + "findMethodTrait\0" /* 2263 */ + "constructor\0" /* 2279 */ + "PHPStan\\Reflection\\MethodReflection\0" /* 2291 */ + "inferPrivatePropertyType\0" /* 2327 */ + "inferAndCachePropertyTypes\0" /* 2352 */ + "className\0" /* 2379 */ + "nodes\0" /* 2389 */ + "PhpParser\\Node\\Stmt\\Class_\0" /* 2395 */ + "findClassNode\0" /* 2422 */ + "classStatements\0" /* 2436 */ + "PhpParser\\Node\\Stmt\\ClassMethod\0" /* 2452 */ + "findConstructorNode\0" /* 2484 */ + "phpDocBlockClassReflection\0" /* 2504 */ + "resolvedPhpDoc\0" /* 2531 */ + "PHPStan\\PhpDoc\\ResolvedPhpDocBlock\0" /* 2546 */ + "nativeReturnType\0" /* 2581 */ + "getPhpDocReturnType\0" /* 2598 */ + "declaringClass\0" /* 2618 */ + "implementingClass\0" /* 2633 */ + "positionalParameterNames\0" /* 2651 */ + "findMethodPhpDocIncludingAncestors"; /* 2676 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 13), /* __construct $scopeFactory */ reg::packed(43, 0, 59), /* __construct $phpDocsResolver */ @@ -247,30 +249,31 @@ inline constexpr reg::PackedArg args[] = { reg::packed(2006, MAY_BE_ARRAY), /* createNativeMethodVariant $closureThisParameters */ reg::packed(2028, MAY_BE_BOOL), /* createNativeMethodVariant $phpDocFromStubs */ reg::packed(2044, MAY_BE_BOOL), /* createNativeMethodVariant $usePhpDocParameterNames */ - reg::packed(1187, 0, 2068), /* createNativeMethodVariant return */ - reg::packed(2137, 0, 2156), /* findPropertyTrait $propertyReflection */ + reg::packed(2068, MAY_BE_ARRAY, reg::NoString, false, false, 2091), /* createNativeMethodVariant $closureScopeParameters */ + reg::packed(1187, 0, 2094), /* createNativeMethodVariant return */ + reg::packed(2163, 0, 2182), /* findPropertyTrait $propertyReflection */ reg::packed(1187, MAY_BE_NULL | MAY_BE_STRING), /* findPropertyTrait return */ reg::packed(1553, 0, 1570), /* findMethodTrait $methodReflection */ reg::packed(1187, MAY_BE_NULL | MAY_BE_STRING), /* findMethodTrait return */ reg::packed(1259, MAY_BE_STRING), /* inferPrivatePropertyType $propertyName */ - reg::packed(2253, 0, 2265), /* inferPrivatePropertyType $constructor */ + reg::packed(2279, 0, 2291), /* inferPrivatePropertyType $constructor */ reg::packed(1187, MAY_BE_NULL, 1900), /* inferPrivatePropertyType return */ - reg::packed(2253, 0, 2265), /* inferAndCachePropertyTypes $constructor */ + reg::packed(2279, 0, 2291), /* inferAndCachePropertyTypes $constructor */ reg::packed(1187, MAY_BE_ARRAY), /* inferAndCachePropertyTypes return */ - reg::packed(2353, MAY_BE_STRING), /* findClassNode $className */ - reg::packed(2363, MAY_BE_ARRAY), /* findClassNode $nodes */ - reg::packed(1187, MAY_BE_NULL, 2369), /* findClassNode return */ + reg::packed(2379, MAY_BE_STRING), /* findClassNode $className */ + reg::packed(2389, MAY_BE_ARRAY), /* findClassNode $nodes */ + reg::packed(1187, MAY_BE_NULL, 2395), /* findClassNode return */ reg::packed(1446, MAY_BE_STRING), /* findConstructorNode $methodName */ - reg::packed(2410, MAY_BE_ARRAY), /* findConstructorNode $classStatements */ - reg::packed(1187, MAY_BE_NULL, 2426), /* findConstructorNode return */ - reg::packed(2478, 0, 1224), /* getPhpDocReturnType $phpDocBlockClassReflection */ - reg::packed(2505, 0, 2520), /* getPhpDocReturnType $resolvedPhpDoc */ - reg::packed(2555, 0, 1900), /* getPhpDocReturnType $nativeReturnType */ + reg::packed(2436, MAY_BE_ARRAY), /* findConstructorNode $classStatements */ + reg::packed(1187, MAY_BE_NULL, 2452), /* findConstructorNode return */ + reg::packed(2504, 0, 1224), /* getPhpDocReturnType $phpDocBlockClassReflection */ + reg::packed(2531, 0, 2546), /* getPhpDocReturnType $resolvedPhpDoc */ + reg::packed(2581, 0, 1900), /* getPhpDocReturnType $nativeReturnType */ reg::packed(1187, MAY_BE_NULL, 1900), /* getPhpDocReturnType return */ - reg::packed(2592, 0, 1224), /* findMethodPhpDocIncludingAncestors $declaringClass */ - reg::packed(2607, 0, 1224), /* findMethodPhpDocIncludingAncestors $implementingClass */ + reg::packed(2618, 0, 1224), /* findMethodPhpDocIncludingAncestors $declaringClass */ + reg::packed(2633, 0, 1224), /* findMethodPhpDocIncludingAncestors $implementingClass */ reg::packed(1446, MAY_BE_STRING), /* findMethodPhpDocIncludingAncestors $methodName */ - reg::packed(2625, MAY_BE_ARRAY), /* findMethodPhpDocIncludingAncestors $positionalParameterNames */ + reg::packed(2651, MAY_BE_ARRAY), /* findMethodPhpDocIncludingAncestors $positionalParameterNames */ reg::packed(1187, MAY_BE_NULL | MAY_BE_ARRAY), /* findMethodPhpDocIncludingAncestors return */ }; using Sig = reg::Sig; @@ -290,15 +293,15 @@ inline constexpr sigtab::Sig hasNativeMethod = { { 1521 /* hasNativeMethod */, 2 inline constexpr sigtab::Sig getNativeMethod = { { 1537 /* getNativeMethod */, 2, 45, 2, 47, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig createMethod = { { 1631 /* createMethod */, 4, 48, 4, 52, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig createUserlandMethodReflection = { { 1746 /* createUserlandMethodReflection */, 4, 53, 4, 57, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig createNativeMethodVariant = { { 2111 /* createNativeMethodVariant */, 11, 58, 11, 69, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig findPropertyTrait = { { 2219 /* findPropertyTrait */, 1, 70, 1, 71, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig findMethodTrait = { { 2237 /* findMethodTrait */, 1, 72, 1, 73, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig inferPrivatePropertyType = { { 2301 /* inferPrivatePropertyType */, 2, 74, 2, 76, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig inferAndCachePropertyTypes = { { 2326 /* inferAndCachePropertyTypes */, 1, 77, 1, 78, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig findClassNode = { { 2396 /* findClassNode */, 2, 79, 2, 81, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig findConstructorNode = { { 2458 /* findConstructorNode */, 2, 82, 2, 84, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getPhpDocReturnType = { { 2572 /* getPhpDocReturnType */, 3, 85, 3, 88, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig findMethodPhpDocIncludingAncestors = { { 2650 /* findMethodPhpDocIncludingAncestors */, 4, 89, 4, 93, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig createNativeMethodVariant = { { 2137 /* createNativeMethodVariant */, 11, 58, 12, 70, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig findPropertyTrait = { { 2245 /* findPropertyTrait */, 1, 71, 1, 72, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig findMethodTrait = { { 2263 /* findMethodTrait */, 1, 73, 1, 74, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig inferPrivatePropertyType = { { 2327 /* inferPrivatePropertyType */, 2, 75, 2, 77, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig inferAndCachePropertyTypes = { { 2352 /* inferAndCachePropertyTypes */, 1, 78, 1, 79, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig findClassNode = { { 2422 /* findClassNode */, 2, 80, 2, 82, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig findConstructorNode = { { 2484 /* findConstructorNode */, 2, 83, 2, 85, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getPhpDocReturnType = { { 2598 /* getPhpDocReturnType */, 3, 86, 3, 89, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig findMethodPhpDocIncludingAncestors = { { 2676 /* findMethodPhpDocIncludingAncestors */, 4, 90, 4, 94, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::PhpClassReflectionExtension diff --git a/turbo-ext/src/generated/PhpParameterReflection.h b/turbo-ext/src/generated/PhpParameterReflection.h index cc0e4389a55..911f160bc39 100644 --- a/turbo-ext/src/generated/PhpParameterReflection.h +++ b/turbo-ext/src/generated/PhpParameterReflection.h @@ -23,6 +23,7 @@ inline constexpr uint32_t attributes = 9; inline constexpr uint32_t allowedConstants = 10; inline constexpr uint32_t pureUnlessCallableIsImpureParameter = 11; inline constexpr uint32_t pureUnlessParameterPassedParameter = 12; +inline constexpr uint32_t closureScopeType = 13; } // namespace slot inline void declareClass(reg::Class &cls) @@ -47,6 +48,7 @@ inline void declareProperties(reg::Class &cls) cls.property("allowedConstants", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, MAY_BE_NULL, "PHPStan\\Reflection\\ParameterAllowedConstants"); cls.property("pureUnlessCallableIsImpureParameter", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, 0, "PHPStan\\TrinaryLogic"); cls.property("pureUnlessParameterPassedParameter", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, 0, "PHPStan\\TrinaryLogic"); + cls.property("closureScopeType", ZEND_ACC_PRIVATE, reg::PropertyKind::Typed, MAY_BE_NULL, "PHPStan\\Type\\Type"); } /* the string and parameter tables the signatures below index into (see reg::Sig) */ @@ -69,28 +71,31 @@ inline constexpr char strings[] = "PHPStan\\Reflection\\ParameterAllowedConstants\0" /* 329 */ "pureUnlessCallableIsImpureParameter\0" /* 374 */ "pureUnlessParameterPassedParameter\0" /* 410 */ - "__construct\0" /* 445 */ - "\0" /* 457 */ - "isOptional\0" /* 458 */ - "getName\0" /* 469 */ - "getType\0" /* 477 */ - "PHPStan\\Reflection\\PassedByReference\0" /* 485 */ - "passedByReference\0" /* 522 */ - "isVariadic\0" /* 540 */ - "getPhpDocType\0" /* 551 */ - "hasNativeType\0" /* 565 */ - "getNativeType\0" /* 579 */ - "getDefaultValue\0" /* 593 */ - "getOutType\0" /* 609 */ - "isImmediatelyInvokedCallable\0" /* 620 */ - "getClosureThisType\0" /* 649 */ - "getAttributes\0" /* 668 */ - "getAllowedConstants\0" /* 682 */ - "constants\0" /* 702 */ - "PHPStan\\Reflection\\AllowedConstantsResult\0" /* 712 */ - "checkAllowedConstants\0" /* 754 */ - "isPureUnlessCallableIsImpureParameter\0" /* 776 */ - "isPureUnlessParameterPassedParameter"; /* 814 */ + "closureScopeType\0" /* 445 */ + "null\0" /* 462 */ + "__construct\0" /* 467 */ + "\0" /* 479 */ + "isOptional\0" /* 480 */ + "getName\0" /* 491 */ + "getType\0" /* 499 */ + "PHPStan\\Reflection\\PassedByReference\0" /* 507 */ + "passedByReference\0" /* 544 */ + "isVariadic\0" /* 562 */ + "getPhpDocType\0" /* 573 */ + "hasNativeType\0" /* 587 */ + "getNativeType\0" /* 601 */ + "getDefaultValue\0" /* 615 */ + "getOutType\0" /* 631 */ + "isImmediatelyInvokedCallable\0" /* 642 */ + "getClosureThisType\0" /* 671 */ + "getClosureScopeType\0" /* 690 */ + "getAttributes\0" /* 710 */ + "getAllowedConstants\0" /* 724 */ + "constants\0" /* 744 */ + "PHPStan\\Reflection\\AllowedConstantsResult\0" /* 754 */ + "checkAllowedConstants\0" /* 796 */ + "isPureUnlessCallableIsImpureParameter\0" /* 818 */ + "isPureUnlessParameterPassedParameter"; /* 856 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 28), /* __construct $initializerExprTypeResolver */ reg::packed(75, 0, 86), /* __construct $reflection */ @@ -103,48 +108,51 @@ inline constexpr reg::PackedArg args[] = { reg::packed(312, MAY_BE_NULL, 329), /* __construct $allowedConstants */ reg::packed(374, 0, 264), /* __construct $pureUnlessCallableIsImpureParameter */ reg::packed(410, 0, 264), /* __construct $pureUnlessParameterPassedParameter */ - reg::packed(457, MAY_BE_BOOL), /* isOptional return */ - reg::packed(457, MAY_BE_STRING), /* getName return */ - reg::packed(457, 0, 161), /* getType return */ - reg::packed(457, 0, 485), /* passedByReference return */ - reg::packed(457, MAY_BE_BOOL), /* isVariadic return */ - reg::packed(457, 0, 161), /* getPhpDocType return */ - reg::packed(457, MAY_BE_BOOL), /* hasNativeType return */ - reg::packed(457, 0, 161), /* getNativeType return */ - reg::packed(457, MAY_BE_NULL, 161), /* getDefaultValue return */ - reg::packed(457, MAY_BE_NULL, 161), /* getOutType return */ - reg::packed(457, 0, 264), /* isImmediatelyInvokedCallable return */ - reg::packed(457, MAY_BE_NULL, 161), /* getClosureThisType return */ - reg::packed(457, MAY_BE_ARRAY), /* getAttributes return */ - reg::packed(457, MAY_BE_NULL, 329), /* getAllowedConstants return */ - reg::packed(702, MAY_BE_ARRAY), /* checkAllowedConstants $constants */ - reg::packed(457, 0, 712), /* checkAllowedConstants return */ - reg::packed(457, 0, 264), /* isPureUnlessCallableIsImpureParameter return */ - reg::packed(457, 0, 264), /* isPureUnlessParameterPassedParameter return */ + reg::packed(445, MAY_BE_NULL, 161, false, false, 462), /* __construct $closureScopeType */ + reg::packed(479, MAY_BE_BOOL), /* isOptional return */ + reg::packed(479, MAY_BE_STRING), /* getName return */ + reg::packed(479, 0, 161), /* getType return */ + reg::packed(479, 0, 507), /* passedByReference return */ + reg::packed(479, MAY_BE_BOOL), /* isVariadic return */ + reg::packed(479, 0, 161), /* getPhpDocType return */ + reg::packed(479, MAY_BE_BOOL), /* hasNativeType return */ + reg::packed(479, 0, 161), /* getNativeType return */ + reg::packed(479, MAY_BE_NULL, 161), /* getDefaultValue return */ + reg::packed(479, MAY_BE_NULL, 161), /* getOutType return */ + reg::packed(479, 0, 264), /* isImmediatelyInvokedCallable return */ + reg::packed(479, MAY_BE_NULL, 161), /* getClosureThisType return */ + reg::packed(479, MAY_BE_NULL, 161), /* getClosureScopeType return */ + reg::packed(479, MAY_BE_ARRAY), /* getAttributes return */ + reg::packed(479, MAY_BE_NULL, 329), /* getAllowedConstants return */ + reg::packed(744, MAY_BE_ARRAY), /* checkAllowedConstants $constants */ + reg::packed(479, 0, 754), /* checkAllowedConstants return */ + reg::packed(479, 0, 264), /* isPureUnlessCallableIsImpureParameter return */ + reg::packed(479, 0, 264), /* isPureUnlessParameterPassedParameter return */ }; using Sig = reg::Sig; } // namespace sigtab /* the signatures of the methods the class declares itself (a used trait's are in the trait's header) */ namespace sig { -inline constexpr sigtab::Sig __construct = { { 445 /* __construct */, 11, 0, 11, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isOptional = { { 458 /* isOptional */, 0, 11, 0, 11, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getName = { { 469 /* getName */, 0, 12, 0, 12, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getType = { { 477 /* getType */, 0, 13, 0, 13, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig passedByReference = { { 522 /* passedByReference */, 0, 14, 0, 14, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isVariadic = { { 540 /* isVariadic */, 0, 15, 0, 15, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPhpDocType = { { 551 /* getPhpDocType */, 0, 16, 0, 16, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasNativeType = { { 565 /* hasNativeType */, 0, 17, 0, 17, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getNativeType = { { 579 /* getNativeType */, 0, 18, 0, 18, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getDefaultValue = { { 593 /* getDefaultValue */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getOutType = { { 609 /* getOutType */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isImmediatelyInvokedCallable = { { 620 /* isImmediatelyInvokedCallable */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getClosureThisType = { { 649 /* getClosureThisType */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getAttributes = { { 668 /* getAttributes */, 0, 23, 0, 23, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getAllowedConstants = { { 682 /* getAllowedConstants */, 0, 24, 0, 24, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig checkAllowedConstants = { { 754 /* checkAllowedConstants */, 1, 25, 1, 26, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isPureUnlessCallableIsImpureParameter = { { 776 /* isPureUnlessCallableIsImpureParameter */, 0, 27, 0, 27, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isPureUnlessParameterPassedParameter = { { 814 /* isPureUnlessParameterPassedParameter */, 0, 28, 0, 28, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 467 /* __construct */, 11, 0, 12, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isOptional = { { 480 /* isOptional */, 0, 12, 0, 12, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getName = { { 491 /* getName */, 0, 13, 0, 13, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getType = { { 499 /* getType */, 0, 14, 0, 14, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig passedByReference = { { 544 /* passedByReference */, 0, 15, 0, 15, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isVariadic = { { 562 /* isVariadic */, 0, 16, 0, 16, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPhpDocType = { { 573 /* getPhpDocType */, 0, 17, 0, 17, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasNativeType = { { 587 /* hasNativeType */, 0, 18, 0, 18, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getNativeType = { { 601 /* getNativeType */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getDefaultValue = { { 615 /* getDefaultValue */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getOutType = { { 631 /* getOutType */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isImmediatelyInvokedCallable = { { 642 /* isImmediatelyInvokedCallable */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureThisType = { { 671 /* getClosureThisType */, 0, 23, 0, 23, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureScopeType = { { 690 /* getClosureScopeType */, 0, 24, 0, 24, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getAttributes = { { 710 /* getAttributes */, 0, 25, 0, 25, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getAllowedConstants = { { 724 /* getAllowedConstants */, 0, 26, 0, 26, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig checkAllowedConstants = { { 796 /* checkAllowedConstants */, 1, 27, 1, 28, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isPureUnlessCallableIsImpureParameter = { { 818 /* isPureUnlessCallableIsImpureParameter */, 0, 29, 0, 29, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isPureUnlessParameterPassedParameter = { { 856 /* isPureUnlessParameterPassedParameter */, 0, 30, 0, 30, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::PhpParameterReflection diff --git a/turbo-ext/src/support.h b/turbo-ext/src/support.h index 6c0e26f9c3a..cb19cbcb940 100644 --- a/turbo-ext/src/support.h +++ b/turbo-ext/src/support.h @@ -2722,8 +2722,8 @@ extern zend_class_entry *pt_ce_class_method_handler; extern zend_class_entry *pt_ce_function_handler; extern zend_class_entry *pt_ce_class_like_handler; -/* MutatingScope.cpp — $scope->enterClassMethod(...$argv) (the 20 positional - * arguments) / ->enterFunction(...$argv) (the 16 positional arguments) / +/* MutatingScope.cpp — $scope->enterClassMethod(...$argv) (the 22 positional + * arguments) / ->enterFunction(...$argv) (the 18 positional arguments) / * ->enterClass($classReflection) / ->rememberConstructorScope() / * ->invalidateExistenceCheckExpressions($functionNames, $declaredSymbolName) * (IS_NULL for null) / ->getNamespace(), next to the walk hub's @@ -3485,7 +3485,7 @@ extern zend_class_entry *pt_ce_deprecated_attribute_resolver; extern zend_class_entry *pt_ce_property_hooks_processor; extern zend_class_entry *pt_ce_called_method_processor; -/* $phpDocsResolver->getPhpDocs($scope, $node) without the array: the 22 +/* $phpDocsResolver->getPhpDocs($scope, $node) without the array: the 23 * values of the twin's list, owned. For the shadowing class every item is * set; any other resolver's method runs and its array is unpacked like the * caller's list() — an item it lacks stays UNDEF, unless its bit (1 << index) @@ -3493,7 +3493,7 @@ extern zend_class_entry *pt_ce_called_method_processor; * false = pending exception */ enum : uint32_t { - PT_PHP_DOCS_COUNT = 22, + PT_PHP_DOCS_COUNT = 23, PT_PHP_DOCS_TEMPLATE_TYPE_MAP = 0, PT_PHP_DOCS_PARAMETER_TYPES, PT_PHP_DOCS_IMMEDIATELY_INVOKED_CALLABLE_PARAMETERS, @@ -3516,6 +3516,7 @@ enum : uint32_t PT_PHP_DOCS_RESOLVED_PHP_DOC, PT_PHP_DOCS_PURE_UNLESS_CALLABLE_IS_IMPURE_PARAMETERS, PT_PHP_DOCS_PURE_UNLESS_PARAMETER_PASSED_PARAMETERS, + PT_PHP_DOCS_CLOSURE_SCOPE_TYPE_PARAMETERS, }; struct pt_php_docs { @@ -3828,6 +3829,7 @@ enum pt_parameter_reflection_member PT_PR_GET_ALLOWED_CONSTANTS, PT_PR_IS_PURE_UNLESS_CALLABLE_IS_IMPURE_PARAMETER, PT_PR_IS_PURE_UNLESS_PARAMETER_PASSED_PARAMETER, + PT_PR_GET_CLOSURE_SCOPE_TYPE, PT_PR_MEMBER_COUNT }; /* $parameter->() of any parameter reflection (borrowed): callers @@ -4408,6 +4410,7 @@ enum pt_resolved_php_doc_member PT_RPD_GET_PARAMS_PURE_UNLESS_CALLABLE_IS_IMPURE, PT_RPD_GET_PARAMS_PURE_UNLESS_PARAMETER_PASSED, PT_RPD_GET_PARAM_CLOSURE_THIS_TAGS, + PT_RPD_GET_PARAM_CLOSURE_SCOPE_TAGS, PT_RPD_GET_RETURN_TAG, PT_RPD_GET_THROWS_TAG, PT_RPD_GET_MIXIN_TAGS,