diff --git a/bin/phpstan b/bin/phpstan index 85fd6e79bc2..d7684566935 100755 --- a/bin/phpstan +++ b/bin/phpstan @@ -33,7 +33,7 @@ use Symfony\Component\Console\Helper\ProgressBar; require_once __DIR__ . '/../src/Process/Restart/IniComposer.php'; require_once __DIR__ . '/../src/Process/Restart/RestartExecutor.php'; require_once __DIR__ . '/../src/Process/Restart/RestartManager.php'; - RestartManager::run($_SERVER['argv']); + RestartManager::run($_SERVER['argv'], null, null, 'phpstan'); TurboExtensionEnabler::trustOwnTypesIfSuitable($_SERVER['argv']); $analysisStartTime = microtime(true); diff --git a/build/PHPStan/Build/InlineCallCollector.php b/build/PHPStan/Build/InlineCallCollector.php index dffe5511743..9a3e6fed5f5 100644 --- a/build/PHPStan/Build/InlineCallCollector.php +++ b/build/PHPStan/Build/InlineCallCollector.php @@ -83,7 +83,7 @@ final class InlineCallCollector implements Collector /** * @param list|null $directories the closed world to scan for overrides; null = directories() */ - public function __construct(private Parser $parser, private ReflectionProvider $reflectionProvider, private ?array $directories = null) + public function __construct(private Parser $parser, private ReflectionProvider $reflectionProvider, private ?array $directories) { } diff --git a/build/PHPStan/Build/NoOptionalParameterRule.php b/build/PHPStan/Build/NoOptionalParameterRule.php new file mode 100644 index 00000000000..af87e2b693f --- /dev/null +++ b/build/PHPStan/Build/NoOptionalParameterRule.php @@ -0,0 +1,149 @@ + + */ +final class NoOptionalParameterRule implements Rule +{ + + public function getNodeType(): string + { + return Node\FunctionLike::class; + } + + public function processNode(Node $node, Scope $scope): array + { + $positionsOptionalInAncestors = []; + if ($node instanceof Node\Stmt\ClassMethod) { + $methodName = $node->name->toString(); + $classReflection = $scope->getClassReflection(); + $declaringReflection = $scope->isInTrait() ? $scope->getTraitReflection() : $classReflection; + if ($classReflection === null || $declaringReflection === null || $this->isApiMethod($node, $declaringReflection)) { + return []; + } + $description = sprintf('method %s::%s()', $declaringReflection->getDisplayName(), $methodName); + $positionsOptionalInAncestors = $this->getPositionsOptionalInAncestors($classReflection, $methodName); + } elseif ($node instanceof Node\Stmt\Function_) { + if ($this->hasApiTag($node)) { + return []; + } + $description = sprintf('function %s()', $node->namespacedName !== null ? $node->namespacedName->toString() : $node->name->toString()); + } else { + return []; + } + + $errors = []; + foreach ($node->getParams() as $position => $param) { + if ($param->default === null) { + continue; + } + if (!$param->var instanceof Node\Expr\Variable || !is_string($param->var->name)) { + continue; + } + if (isset($positionsOptionalInAncestors[$position])) { + continue; + } + + $errors[] = RuleErrorBuilder::message(sprintf( + 'Parameter $%s of %s must not be optional. Optional parameters are allowed only in @api code.', + $param->var->name, + $description, + )) + ->identifier('phpstan.optionalParameter') + ->line($param->getStartLine()) + ->build(); + } + + return $errors; + } + + private function isApiMethod(Node\Stmt\ClassMethod $node, ClassReflection $classReflection): bool + { + if ($this->hasApiTag($node)) { + return true; + } + + if (strtolower($node->name->toString()) === '__construct') { + return false; + } + + if ($node->isPrivate()) { + return false; + } + + if ($node->isProtected() && $classReflection->isFinal()) { + return false; + } + + $resolvedPhpDoc = $classReflection->getResolvedPhpDoc(); + if ($resolvedPhpDoc === null) { + return false; + } + + foreach ($resolvedPhpDoc->getPhpDocNodes() as $phpDocNode) { + if (count($phpDocNode->getTagsByName('@api')) > 0) { + return true; + } + } + + return false; + } + + private function hasApiTag(Node $node): bool + { + $docComment = $node->getDocComment(); + if ($docComment === null) { + return false; + } + + return preg_match('~@api(?![\w-])~', $docComment->getText()) === 1; + } + + /** + * PHP requires an overriding method to keep these parameters optional. + * + * @return array + */ + private function getPositionsOptionalInAncestors(ClassReflection $classReflection, string $methodName): array + { + $positions = []; + foreach ($classReflection->getAncestors() as $ancestor) { + if ($ancestor->getName() === $classReflection->getName() || $ancestor->isTrait() || !$ancestor->hasNativeMethod($methodName)) { + continue; + } + + foreach ($ancestor->getNativeMethod($methodName)->getVariants() as $variant) { + foreach ($variant->getParameters() as $position => $parameter) { + if (!$parameter->isOptional()) { + continue; + } + + $positions[$position] = true; + } + } + } + + return $positions; + } + +} diff --git a/build/baseline-optional-parameters.neon b/build/baseline-optional-parameters.neon new file mode 100644 index 00000000000..faad6e4675b --- /dev/null +++ b/build/baseline-optional-parameters.neon @@ -0,0 +1,1171 @@ +parameters: + ignoreErrors: + - + rawMessage: 'Parameter $allAnalysedFiles of method PHPStan\Analyser\Analyser::analyse() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Analyser.php + + - + rawMessage: 'Parameter $debug of method PHPStan\Analyser\Analyser::analyse() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Analyser.php + + - + rawMessage: 'Parameter $postFileCallback of method PHPStan\Analyser\Analyser::analyse() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Analyser.php + + - + rawMessage: 'Parameter $preFileCallback of method PHPStan\Analyser\Analyser::analyse() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Analyser.php + + - + rawMessage: 'Parameter $canBeIgnored of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $filePath of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $fixedErrorDiff of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $identifier of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $line of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $metadata of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $nodeLine of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $nodeType of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $tip of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $traitContexts of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $traitFilePath of method PHPStan\Analyser\Error::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/Error.php + + - + rawMessage: 'Parameter $arrayDimFetchRoot of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $inAssignRightSideNativeType of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $inAssignRightSideType of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $inThrow of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $nativePassedToType of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $passedToType of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $passedToTypeResolver of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $resolveTemplateArguments of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $unsetTarget of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $valueConsumed of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $valueFlowDirect of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $valueFlowTarget of method PHPStan\Analyser\ExpressionContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionContext.php + + - + rawMessage: 'Parameter $cachedNativeType of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $cachedType of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $dependencies of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $extensionsDeclined of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $projectedNativeType of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $projectedType of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $readVariableNames of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $resolvedNativeType of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $resolvedType of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $specifiedTypes of method PHPStan\Analyser\ExpressionResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ExpressionResult.php + + - + rawMessage: 'Parameter $bypassTypeAliases of method PHPStan\Analyser\IntermediaryNameScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/IntermediaryNameScope.php + + - + rawMessage: 'Parameter $className of method PHPStan\Analyser\IntermediaryNameScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/IntermediaryNameScope.php + + - + rawMessage: 'Parameter $functionName of method PHPStan\Analyser\IntermediaryNameScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/IntermediaryNameScope.php + + - + rawMessage: 'Parameter $parent of method PHPStan\Analyser\IntermediaryNameScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/IntermediaryNameScope.php + + - + rawMessage: 'Parameter $templatePhpDocNodes of method PHPStan\Analyser\IntermediaryNameScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/IntermediaryNameScope.php + + - + rawMessage: 'Parameter $traitData of method PHPStan\Analyser\IntermediaryNameScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/IntermediaryNameScope.php + + - + rawMessage: 'Parameter $typeAliasClassName of method PHPStan\Analyser\IntermediaryNameScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/IntermediaryNameScope.php + + - + rawMessage: 'Parameter $typeAliasesMap of method PHPStan\Analyser\IntermediaryNameScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/IntermediaryNameScope.php + + - + rawMessage: 'Parameter $afterExtractCall of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $anonymousFunctionReflection of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $conditionalExpressions of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $currentlyAllowedUndefinedExpressions of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $currentlyAssignedExpressions of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $declareStrictTypes of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $expressionTypes of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $function of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $inClosureBindScopeClasses of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $inFirstLevelStatement of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $inFunctionCallsStack of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $namespace of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $nativeExpressionTypes of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $nativeTypesPromoted of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $parentScope of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $templateArgumentConstraints of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $templateArgumentFrame of method PHPStan\Analyser\InternalScopeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalScopeFactory.php + + - + rawMessage: 'Parameter $dependencies of method PHPStan\Analyser\InternalStatementResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalStatementResult.php + + - + rawMessage: 'Parameter $endReachable of method PHPStan\Analyser\InternalStatementResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalStatementResult.php + + - + rawMessage: 'Parameter $endStatements of method PHPStan\Analyser\InternalStatementResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalStatementResult.php + + - + rawMessage: 'Parameter $variableFlow of method PHPStan\Analyser\InternalStatementResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/InternalStatementResult.php + + - + rawMessage: 'Parameter $afterExtractCall of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $anonymousFunctionReflection of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $conditionalExpressions of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $currentlyAllowedUndefinedExpressions of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $currentlyAssignedExpressions of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $declareStrictTypes of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $expressionTypes of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $function of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $inClosureBindScopeClasses of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $inFirstLevelStatement of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $inFunctionCallsStack of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $intertwinedPropagatedFrom of method PHPStan\Analyser\MutatingScope::assignVariable() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $invalidatingClass of method PHPStan\Analyser\MutatingScope::invalidateExpression() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $keepPropertyFetches of method PHPStan\Analyser\MutatingScope::invalidateExpression() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $namespace of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $nativeExpressionTypes of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $nativeTypesPromoted of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $parentScope of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $preserveVacuousConditionals of method PHPStan\Analyser\MutatingScope::mergeWith() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $requireMoreCharacters of method PHPStan\Analyser\MutatingScope::invalidateExpression() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $resolvedPhpDocBlock of method PHPStan\Analyser\MutatingScope::enterPropertyHook() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $templateArgumentConstraints of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $templateArgumentFrame of method PHPStan\Analyser\MutatingScope::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/MutatingScope.php + + - + rawMessage: 'Parameter $byRefClosureResultScope of method PHPStan\Analyser\ProcessClosureResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ProcessClosureResult.php + + - + rawMessage: 'Parameter $byRefUses of method PHPStan\Analyser\ProcessClosureResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ProcessClosureResult.php + + - + rawMessage: 'Parameter $dependencies of method PHPStan\Analyser\ProcessClosureResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/ProcessClosureResult.php + + - + rawMessage: 'Parameter $expectedReturnType of method PHPStan\Analyser\StatementContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/StatementContext.php + + - + rawMessage: 'Parameter $foreachUnrollFactor of method PHPStan\Analyser\StatementContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/StatementContext.php + + - + rawMessage: 'Parameter $nativeExpectedReturnType of method PHPStan\Analyser\StatementContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/StatementContext.php + + - + rawMessage: 'Parameter $resolveTemplateArguments of method PHPStan\Analyser\StatementContext::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/StatementContext.php + + - + rawMessage: 'Parameter $endStatements of method PHPStan\Analyser\StatementResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Analyser/StatementResult.php + + - + rawMessage: 'Parameter $processedFiles of method PHPStan\Command\AnalyseCommand::runDiagnoseExtensions() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/AnalyseCommand.php + + - + rawMessage: 'Parameter $processedFiles of method PHPStan\Command\AnalysisResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/AnalysisResult.php + + - + rawMessage: 'Parameter $resultCacheExisted of method PHPStan\Command\AnalysisResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/AnalysisResult.php + + - + rawMessage: 'Parameter $workerCount of method PHPStan\Command\AnalysisResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/AnalysisResult.php + + - + rawMessage: 'Parameter $composerHome of method PHPStan\Command\BisectCommand::getGitHubToken() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/BisectCommand.php + + - + rawMessage: 'Parameter $message of method PHPStan\Command\ErrorFormatter\JunitErrorFormatter::createTestCase() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/ErrorFormatter/JunitErrorFormatter.php + + - + rawMessage: 'Parameter $errorsBudget of method PHPStan\Command\ErrorFormatter\TableErrorFormatter::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/ErrorFormatter/TableErrorFormatter.php + + - + rawMessage: 'Parameter $escapedWrongSequence of method PHPStan\Command\IgnoredRegexValidatorResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/IgnoredRegexValidatorResult.php + + - + rawMessage: 'Parameter $wrongSequence of method PHPStan\Command\IgnoredRegexValidatorResult::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Command/IgnoredRegexValidatorResult.php + + - + rawMessage: 'Parameter $flags of method PHPStan\Dependency\ExportedNode\ExportedParameterNode::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Dependency/ExportedNode/ExportedParameterNode.php + + - + rawMessage: 'Parameter $phpDoc of method PHPStan\Dependency\ExportedNode\ExportedParameterNode::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Dependency/ExportedNode/ExportedParameterNode.php + + - + rawMessage: 'Parameter $ref of method PHPStan\DependencyInjection\AutowiredParameter::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/AutowiredParameter.php + + - + rawMessage: 'Parameter $as of method PHPStan\DependencyInjection\AutowiredService::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/AutowiredService.php + + - + rawMessage: 'Parameter $autoTag of method PHPStan\DependencyInjection\AutowiredService::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/AutowiredService.php + + - + rawMessage: 'Parameter $factory of method PHPStan\DependencyInjection\AutowiredService::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/AutowiredService.php + + - + rawMessage: 'Parameter $name of method PHPStan\DependencyInjection\AutowiredService::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/AutowiredService.php + + - + rawMessage: 'Parameter $required of method PHPStan\DependencyInjection\ContainerFactory::processArgument() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/ContainerFactory.php + + - + rawMessage: 'Parameter $required of method PHPStan\DependencyInjection\ContainerFactory::processSchema() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/ContainerFactory.php + + - + rawMessage: 'Parameter $additionalParameters of method PHPStan\DependencyInjection\DerivativeContainerFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/DerivativeContainerFactory.php + + - + rawMessage: 'Parameter $resultType of method PHPStan\DependencyInjection\GenerateFactory::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/GenerateFactory.php + + - + rawMessage: 'Parameter $factory of method PHPStan\DependencyInjection\NonAutowiredService::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/DependencyInjection/NonAutowiredService.php + + - + rawMessage: 'Parameter $directorySeparator of method PHPStan\File\FuzzyRelativePathHelper::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/File/FuzzyRelativePathHelper.php + + - + rawMessage: 'Parameter $mode of method PHPStan\Internal\DirectoryCreator::ensureDirectoryExists() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Internal/DirectoryCreator.php + + - + rawMessage: 'Parameter $recursive of method PHPStan\Internal\DirectoryCreator::ensureDirectoryExists() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Internal/DirectoryCreator.php + + - + rawMessage: 'Parameter $connectTimeout of method PHPStan\Internal\HttpClientFactory::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Internal/HttpClientFactory.php + + - + rawMessage: 'Parameter $timeout of method PHPStan\Internal\HttpClientFactory::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Internal/HttpClientFactory.php + + - + rawMessage: 'Parameter $nextStatements of method PHPStan\Node\UnreachableStatementNode::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Node/UnreachableStatementNode.php + + - + rawMessage: 'Parameter $cachedSourceBytesMax of method PHPStan\Parser\CachedParser::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Parser/CachedParser.php + + - + rawMessage: 'Parameter $autoloadSection of method PHPStan\Reflection\BetterReflection\SourceLocator\ComposerJsonAndInstalledJsonSourceLocatorMaker::packageToClassMapPaths() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php + + - + rawMessage: 'Parameter $autoloadSection of method PHPStan\Reflection\BetterReflection\SourceLocator\ComposerJsonAndInstalledJsonSourceLocatorMaker::packageToFilePaths() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php + + - + rawMessage: 'Parameter $autoloadSection of method PHPStan\Reflection\BetterReflection\SourceLocator\ComposerJsonAndInstalledJsonSourceLocatorMaker::packageToPsr0AutoloadNamespaces() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php + + - + rawMessage: 'Parameter $autoloadSection of method PHPStan\Reflection\BetterReflection\SourceLocator\ComposerJsonAndInstalledJsonSourceLocatorMaker::packageToPsr4AutoloadNamespaces() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php + + - + rawMessage: 'Parameter $streamWrapperProtocols of method PHPStan\Reflection\BetterReflection\SourceLocator\FileReadTrapStreamWrapper::withStreamWrapperOverride() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/BetterReflection/SourceLocator/FileReadTrapStreamWrapper.php + + - + rawMessage: 'Parameter $positionInNode of method PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedDirectorySourceLocator::nodeToReflection() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php + + - + rawMessage: 'Parameter $match of method PHPStan\Reflection\BetterReflection\SourceLocator\PhpFileCleaner::match() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/BetterReflection/SourceLocator/PhpFileCleaner.php + + - + rawMessage: 'Parameter $offset of method PHPStan\Reflection\BetterReflection\SourceLocator\PhpFileCleaner::match() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/BetterReflection/SourceLocator/PhpFileCleaner.php + + - + rawMessage: 'Parameter $args of method PHPStan\Reflection\Callables\SimpleImpurePoint::createFromVariant() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/Callables/SimpleImpurePoint.php + + - + rawMessage: 'Parameter $scope of method PHPStan\Reflection\Callables\SimpleImpurePoint::createFromVariant() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/Callables/SimpleImpurePoint.php + + - + rawMessage: 'Parameter $extraCacheKey of method PHPStan\Reflection\ClassReflection::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ClassReflection.php + + - + rawMessage: 'Parameter $finalByKeywordOverride of method PHPStan\Reflection\ClassReflection::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ClassReflection.php + + - + rawMessage: 'Parameter $resolvedCallSiteVarianceMap of method PHPStan\Reflection\ClassReflection::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ClassReflection.php + + - + rawMessage: 'Parameter $extraCacheKey of method PHPStan\Reflection\ClassReflectionFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ClassReflectionFactory.php + + - + rawMessage: 'Parameter $finalByKeywordOverride of method PHPStan\Reflection\ClassReflectionFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ClassReflectionFactory.php + + - + rawMessage: 'Parameter $resolvedCallSiteVarianceMap of method PHPStan\Reflection\ClassReflectionFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ClassReflectionFactory.php + + - + rawMessage: 'Parameter $assertions of method PHPStan\Reflection\ExtendedCallableFunctionVariant::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ExtendedCallableFunctionVariant.php + + - + rawMessage: 'Parameter $isStatic of method PHPStan\Reflection\ExtendedCallableFunctionVariant::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ExtendedCallableFunctionVariant.php + + - + rawMessage: 'Parameter $assertions of method PHPStan\Reflection\ResolvedFunctionVariantWithCallable::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ResolvedFunctionVariantWithCallable.php + + - + rawMessage: 'Parameter $isStatic of method PHPStan\Reflection\ResolvedFunctionVariantWithCallable::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Reflection/ResolvedFunctionVariantWithCallable.php + + - + rawMessage: 'Parameter $phpVersion of method PHPStan\Rules\Arrays\AllowedArrayKeysTypes::getType() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Rules/Arrays/AllowedArrayKeysTypes.php + + - + rawMessage: 'Parameter $reportNonIntStringArrayKey of method PHPStan\Rules\Arrays\AllowedArrayKeysTypes::getType() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Rules/Arrays/AllowedArrayKeysTypes.php + + - + rawMessage: 'Parameter $checkClassCaseSensitivity of method PHPStan\Rules\ClassNameCheck::checkClassNames() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Rules/ClassNameCheck.php + + - + rawMessage: 'Parameter $reasons of method PHPStan\Rules\Comparison\ImpossibleCheckTypeHelper::findSpecifiedType() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Rules/Comparison/ImpossibleCheckTypeHelper.php + + - + rawMessage: 'Parameter $depth of method PHPStan\Rules\PhpDoc\VarTagTypeRuleHelper::isValidSuperType() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Rules/PhpDoc/VarTagTypeRuleHelper.php + + - + rawMessage: 'Parameter $isTopLevel of method PHPStan\Rules\RuleLevelHelper::findTypeToCheckImplementation() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Rules/RuleLevelHelper.php + + - + rawMessage: 'Parameter $decorated of method PHPStan\Testing\ErrorFormatterTestCase::getOutput() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Testing/ErrorFormatterTestCase.php + + - + rawMessage: 'Parameter $decorated of method PHPStan\Testing\ErrorFormatterTestCase::getOutputContent() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Testing/ErrorFormatterTestCase.php + + - + rawMessage: 'Parameter $decorated of method PHPStan\Testing\ErrorFormatterTestCase::getOutputStream() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Testing/ErrorFormatterTestCase.php + + - + rawMessage: 'Parameter $verbose of method PHPStan\Testing\ErrorFormatterTestCase::getOutput() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Testing/ErrorFormatterTestCase.php + + - + rawMessage: 'Parameter $verbose of method PHPStan\Testing\ErrorFormatterTestCase::getOutputContent() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Testing/ErrorFormatterTestCase.php + + - + rawMessage: 'Parameter $verbose of method PHPStan\Testing\ErrorFormatterTestCase::getOutputStream() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Testing/ErrorFormatterTestCase.php + + - + rawMessage: 'Parameter $strictTypes of method PHPStan\Type\CallableType::isSuperTypeOfInternal() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/CallableType.php + + - + rawMessage: 'Parameter $strictTypes of method PHPStan\Type\CallableTypeHelper::isParametersAcceptorSuperTypeOf() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/CallableTypeHelper.php + + - + rawMessage: 'Parameter $strictTypes of method PHPStan\Type\ClosureType::isSuperTypeOfInternal() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/ClosureType.php + + - + rawMessage: 'Parameter $hasNonExistentMethod of method PHPStan\Type\Constant\ConstantArrayType::doFindTypeAndMethodNames() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Constant/ConstantArrayType.php + + - + rawMessage: 'Parameter $reindex of method PHPStan\Type\Constant\ConstantArrayType::removeFirstElements() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Constant/ConstantArrayType.php + + - + rawMessage: 'Parameter $activeTraitResolutions of method PHPStan\Type\FileTypeMapper::createPhpDocNodeMap() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/FileTypeMapper.php + + - + rawMessage: 'Parameter $default of method PHPStan\Type\Generic\TemplateTypeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Generic/TemplateTypeFactory.php + + - + rawMessage: 'Parameter $strategy of method PHPStan\Type\Generic\TemplateTypeFactory::create() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Generic/TemplateTypeFactory.php + + - + rawMessage: 'Parameter $keepErrorTypes of method PHPStan\Type\Generic\TemplateTypeHelper::resolveTemplateTypes() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Generic/TemplateTypeHelper.php + + - + rawMessage: 'Parameter $filter of method PHPStan\Type\IntersectionType::intersectResults() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/IntersectionType.php + + - + rawMessage: 'Parameter $supportedCipherMethods of method PHPStan\Type\Php\OpenSslCipherMethodsProvider::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Php/OpenSslCipherMethodsProvider.php + + - + rawMessage: 'Parameter $length of method PHPStan\Type\Php\SubstrDynamicReturnTypeExtension::substrOrFalse() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Php/SubstrDynamicReturnTypeExtension.php + + - + rawMessage: 'Parameter $forceAlternationBranchMatched of method PHPStan\Type\Regex\RegexCapturingGroup::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Regex/RegexCapturingGroup.php + + - + rawMessage: 'Parameter $forceNonOptional of method PHPStan\Type\Regex\RegexCapturingGroup::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Regex/RegexCapturingGroup.php + + - + rawMessage: 'Parameter $forceType of method PHPStan\Type\Regex\RegexCapturingGroup::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Regex/RegexCapturingGroup.php + + - + rawMessage: 'Parameter $alternationBranchOnly of method PHPStan\Type\Regex\RegexGroupList::cloneAndReParentList() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Regex/RegexGroupList.php + + - + rawMessage: 'Parameter $type of method PHPStan\Type\Regex\RegexGroupList::cloneAndReParentList() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/Regex/RegexGroupList.php + + - + rawMessage: 'Parameter $stopOnUnmatched of method PHPStan\Type\TypeUtils::map() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/TypeUtils.php + + - + rawMessage: 'Parameter $cacheCallback of method PHPStan\Type\VerbosityLevel::handle() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/VerbosityLevel.php + + - + rawMessage: 'Parameter $preciseCallback of method PHPStan\Type\VerbosityLevel::handle() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../src/Type/VerbosityLevel.php + + - + rawMessage: 'Parameter $allAnalysedFiles of method PHPStan\Analyser\AnalyserIntegrationTest::runAnalyse() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Analyser/AnalyserIntegrationTest.php + + - + rawMessage: 'Parameter $variableName of method PHPStan\Analyser\TypeSpecifierTest::createFunctionCall() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Analyser/TypeSpecifierTest.php + + - + rawMessage: 'Parameter $variableName of method PHPStan\Analyser\TypeSpecifierTest::createInstanceOf() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Analyser/TypeSpecifierTest.php + + - + rawMessage: 'Parameter $parameters of method PHPStan\Command\AnalyseCommandTest::runCommand() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Command/AnalyseCommandTest.php + + - + rawMessage: 'Parameter $baselineFile of method PHPStan\Command\ErrorFormatter\BaselineNeonErrorFormatterIntegrationTest::runPhpStan() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Command/ErrorFormatter/BaselineNeonErrorFormatterIntegrationTest.php + + - + rawMessage: 'Parameter $errorFormatter of method PHPStan\Command\ErrorFormatter\BaselineNeonErrorFormatterIntegrationTest::runPhpStan() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Command/ErrorFormatter/BaselineNeonErrorFormatterIntegrationTest.php + + - + rawMessage: 'Parameter $editorUrlTitle of method PHPStan\Command\ErrorFormatter\TableErrorFormatterTest::createErrorFormatter() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Command/ErrorFormatter/TableErrorFormatterTest.php + + - + rawMessage: 'Parameter $errorsBudget of method PHPStan\Command\ErrorFormatter\TableErrorFormatterTest::createErrorFormatter() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Command/ErrorFormatter/TableErrorFormatterTest.php + + - + rawMessage: 'Parameter $generateErrorsCount of method PHPStan\Command\ErrorFormatter\TableErrorFormatterTest::testErrorLimit() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Command/ErrorFormatter/TableErrorFormatterTest.php + + - + rawMessage: 'Parameter $usedLevel of method PHPStan\Command\ErrorFormatter\TableErrorFormatterTest::createErrorFormatter() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Command/ErrorFormatter/TableErrorFormatterTest.php + + - + rawMessage: 'Parameter $expectedFlags of method PHPStan\Reflection\ClassReflectionTest::testIsAttributeClass() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Reflection/ClassReflectionTest.php + + - + rawMessage: 'Parameter $resultIsExplicit of method PHPStan\Reflection\InitializerExprTypeResolverTest::testExplicitNever() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Reflection/InitializerExprTypeResolverTest.php + + - + rawMessage: 'Parameter $nullContext of method PHPStan\Tests\AssertionClassMethodTypeSpecifyingExtension::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Tests/AssertionClassMethodTypeSpecifyingExtension.php + + - + rawMessage: 'Parameter $nullContext of method PHPStan\Tests\AssertionClassStaticMethodTypeSpecifyingExtension::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Tests/AssertionClassStaticMethodTypeSpecifyingExtension.php + + - + rawMessage: 'Parameter $reasons of method PHPStan\Type\Constant\ConstantArrayTypeTest::testAccepts() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: ../tests/PHPStan/Type/Constant/ConstantArrayTypeTest.php + + - + rawMessage: 'Parameter $skipTests of method PHPStan\Build\FinalClassRule::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: PHPStan/Build/FinalClassRule.php + + - + rawMessage: 'Parameter $skipTests of method PHPStan\Build\MemoizationPropertyRule::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: PHPStan/Build/MemoizationPropertyRule.php + + - + rawMessage: 'Parameter $skipTests of method PHPStan\Build\OrChainIdenticalComparisonToInArrayRule::__construct() must not be optional. Optional parameters are allowed only in @api code.' + identifier: phpstan.optionalParameter + count: 1 + path: PHPStan/Build/OrChainIdenticalComparisonToInArrayRule.php diff --git a/build/inline.neon b/build/inline.neon index b86b62536b6..54922ee5243 100644 --- a/build/inline.neon +++ b/build/inline.neon @@ -17,6 +17,7 @@ services: class: PHPStan\Build\InlineCallCollector arguments: parser: @defaultAnalysisParser + directories: null tags: - phpstan.collector - diff --git a/build/phpstan.neon b/build/phpstan.neon index e4c1650ff6a..06a0ca14dc3 100644 --- a/build/phpstan.neon +++ b/build/phpstan.neon @@ -8,6 +8,7 @@ includes: - ../conf/bleedingEdge.neon - ../phpstan-baseline.neon - ../phpstan-baseline.php + - baseline-optional-parameters.neon - ignore-by-php-version.neon.php - ignore-by-architecture.neon.php @@ -216,6 +217,7 @@ rules: - PHPStan\Build\MemoizationPropertyRule - PHPStan\Build\OrChainIdenticalComparisonToInArrayRule - PHPStan\Build\NoPhpVersionInjectionInScopeAwareExtensionRule + - PHPStan\Build\NoOptionalParameterRule services: - diff --git a/build/regex-parser/RegexGrammar.pp3 b/build/regex-parser/RegexGrammar.pp3 index 4b9f58b237a..8b63ed80964 100644 --- a/build/regex-parser/RegexGrammar.pp3 +++ b/build/regex-parser/RegexGrammar.pp3 @@ -131,7 +131,7 @@ %token T_LITERAL \\.|.|\n Expression -> { - return new RegexNode('#expression', children: \is_array($children) ? $children : [$children]); + return new RegexNode('#expression', '', '', \is_array($children) ? $children : [$children]); } : Alternation()? ; @@ -145,14 +145,14 @@ Alternation -> { foreach ($children as $child) { if ($child instanceof TokenInterface) { $isAlternation = true; - $child = new RegexNode('token', 'alternation', $child->value); + $child = new RegexNode('token', 'alternation', $child->value, []); } $nodes[] = $child; } if (!$isAlternation) { return $children[0] ?? []; } - return new RegexNode('#alternation', children: $nodes); + return new RegexNode('#alternation', '', '', $nodes); } : Concatenation()? ( Concatenation()?)* ; @@ -164,14 +164,14 @@ Concatenation -> { if (\count($children) === 1) { return $children[0]; } - return new RegexNode('#concatenation', children: $children); + return new RegexNode('#concatenation', '', '', $children); } : (InternalOptions() | Assertion() | Quantification() | Condition())+ ; InternalOptions -> { - return new RegexNode('#internal_options', children: [ - new RegexNode('token', 'internal_option', $children->value), + return new RegexNode('#internal_options', '', '', [ + new RegexNode('token', 'internal_option', $children->value, []), ]); } : @@ -181,16 +181,16 @@ Condition -> { $reference = \array_shift($children); switch ($reference->id) { case self::T_NAMED_REFERENCE: - \array_unshift($children, new RegexNode('token', 'capturing_name', $reference->captures[0])); - return new RegexNode('#namedcondition', children: $children); + \array_unshift($children, new RegexNode('token', 'capturing_name', $reference->captures[0], [])); + return new RegexNode('#namedcondition', '', '', $children); case self::T_ABSOLUTE_REFERENCE: - \array_unshift($children, new RegexNode('token', 'index', $reference->captures[0])); - return new RegexNode('#absolutecondition', children: $children); + \array_unshift($children, new RegexNode('token', 'index', $reference->captures[0], [])); + return new RegexNode('#absolutecondition', '', '', $children); case self::T_RELATIVE_REFERENCE: - \array_unshift($children, new RegexNode('token', 'index', $reference->captures[0])); - return new RegexNode('#relativecondition', children: $children); + \array_unshift($children, new RegexNode('token', 'index', $reference->captures[0], [])); + return new RegexNode('#relativecondition', '', '', $children); default: - return new RegexNode('#assertioncondition', children: $children); + return new RegexNode('#assertioncondition', '', '', $children); } } : ( @@ -211,7 +211,7 @@ Assertion -> { self::T_LOOKBEHIND => '#lookbehind', self::T_NEGATIVE_LOOKBEHIND => '#negativelookbehind', ]; - return new RegexNode($ids[$assertion->id], children: $children); + return new RegexNode($ids[$assertion->id], '', '', $children); } : ( | | | ) Alternation()? @@ -225,9 +225,9 @@ Quantification -> { if (\count($children) === 1) { return $children[0]; } - return new RegexNode('#quantification', children: [ + return new RegexNode('#quantification', '', '', [ $children[0], - new RegexNode('token', \strtolower(\substr($children[1]->name, 2)), $children[1]->value), + new RegexNode('token', \strtolower(\substr($children[1]->name, 2)), $children[1]->value, []), ]); } : (CharacterClass() | Capturing() | Literal()) Quantifier()? @@ -251,7 +251,7 @@ CharacterClass -> { $nodes = []; if ($children->id === self::T_NEGATIVE_CLASS_FC || $children->id === self::T_CLASS_FC) { - $nodes[] = new RegexNode('token', '_class', ']'); + $nodes[] = new RegexNode('token', '_class', ']', []); } $literalNames = [ @@ -265,37 +265,37 @@ CharacterClass -> { $i = 0; // ? ( | | range() ? | literal() )* ? if ($i < $count && $tokens[$i]->name === 'T_RANGE') { - $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value); + $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value, []); $i++; } while ($i < $count) { $token = $tokens[$i]; if ($token->name === 'T_POSIX_CLASS') { - $nodes[] = new RegexNode('token', 'posix_class', $token->value); + $nodes[] = new RegexNode('token', 'posix_class', $token->value, []); $i++; continue; } if ($token->name === 'T_CLASS_NESTED') { - $nodes[] = new RegexNode('token', 'class_', $token->value); + $nodes[] = new RegexNode('token', 'class_', $token->value, []); $i++; continue; } if (!isset($literalNames[$token->name])) { break; } - $literal = new RegexNode('token', $literalNames[$token->name], $token->value); + $literal = new RegexNode('token', $literalNames[$token->name], $token->value, []); if ( $i + 2 < $count && $tokens[$i + 1]->name === 'T_RANGE' && isset($literalNames[$tokens[$i + 2]->name]) ) { - $nodes[] = new RegexNode('#range', children: [ + $nodes[] = new RegexNode('#range', '', '', [ $literal, - new RegexNode('token', $literalNames[$tokens[$i + 2]->name], $tokens[$i + 2]->value), + new RegexNode('token', $literalNames[$tokens[$i + 2]->name], $tokens[$i + 2]->value, []), ]); $i += 3; if ($i < $count && $tokens[$i]->name === 'T_RANGE') { - $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value); + $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value, []); $i++; } continue; @@ -304,7 +304,7 @@ CharacterClass -> { $i++; } if ($i < $count && $tokens[$i]->name === 'T_RANGE') { - $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value); + $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value, []); $i++; } if ($i !== $count) { @@ -312,7 +312,7 @@ CharacterClass -> { } $negative = $children->id === self::T_NEGATIVE_CLASS_FC || $children->id === self::T_NEGATIVE_CLASS; - return new RegexNode($negative ? '#negativeclass' : '#class', children: $nodes); + return new RegexNode($negative ? '#negativeclass' : '#class', '', '', $nodes); } : | | | ; @@ -324,27 +324,27 @@ Capturing -> { $opening = \array_shift($children); switch ($opening->id) { case self::T_MARKER: - return new RegexNode('#mark', children: [ - new RegexNode('token', 'name', $opening->captures[0]), + return new RegexNode('#mark', '', '', [ + new RegexNode('token', 'name', $opening->captures[0], []), ]); case self::T_COMMENT: - return new RegexNode('#comment', children: $opening->captures[0] === '' ? [] : [ - new RegexNode('token', 'comment', $opening->captures[0]), + return new RegexNode('#comment', '', '', $opening->captures[0] === '' ? [] : [ + new RegexNode('token', 'comment', $opening->captures[0], []), ]); case self::T_NAMED_CAPTURING: - \array_unshift($children, new RegexNode('token', 'capturing_name', $opening->captures[0])); - return new RegexNode('#namedcapturing', children: $children); + \array_unshift($children, new RegexNode('token', 'capturing_name', $opening->captures[0], [])); + return new RegexNode('#namedcapturing', '', '', $children); case self::T_NON_CAPTURING: - return new RegexNode('#noncapturing', children: $children); + return new RegexNode('#noncapturing', '', '', $children); case self::T_NON_CAPTURING_INTERNAL_OPTION: - \array_unshift($children, new RegexNode('token', 'non_capturing_internal_option', $opening->value)); - return new RegexNode('#noncapturing', children: $children); + \array_unshift($children, new RegexNode('token', 'non_capturing_internal_option', $opening->value, [])); + return new RegexNode('#noncapturing', '', '', $children); case self::T_NON_CAPTURING_RESET: - return new RegexNode('#noncapturingreset', children: $children); + return new RegexNode('#noncapturingreset', '', '', $children); case self::T_ATOMIC_GROUP: - return new RegexNode('#atomicgroup', children: $children); + return new RegexNode('#atomicgroup', '', '', $children); default: - return new RegexNode('#capturing', children: $children); + return new RegexNode('#capturing', '', '', $children); } } : @@ -367,7 +367,7 @@ Literal -> { self::T_SUBROUTINE_G => 'subroutine', ]; - return new RegexNode('token', $names[$children->id] ?? \strtolower(\substr($children->name, 2)), $children->value); + return new RegexNode('token', $names[$children->id] ?? \strtolower(\substr($children->name, 2)), $children->value, []); } : | diff --git a/src/Analyser/Analyser.php b/src/Analyser/Analyser.php index 2de73b41052..21ea6420ce6 100644 --- a/src/Analyser/Analyser.php +++ b/src/Analyser/Analyser.php @@ -152,6 +152,7 @@ public function analyse( // analysis ran in this process - its peak is read where the number is printed peakMemoryUsageBytes: 0, processedFiles: $allProcessedFiles, + workerCount: 0, ); } diff --git a/src/Analyser/AnalyserResult.php b/src/Analyser/AnalyserResult.php index 4b814297f14..58e969d38f8 100644 --- a/src/Analyser/AnalyserResult.php +++ b/src/Analyser/AnalyserResult.php @@ -50,7 +50,7 @@ public function __construct( private bool $reachedInternalErrorsCountLimit, private int $peakMemoryUsageBytes, private array $processedFiles, - private int $workerCount = 0, + private int $workerCount, ) { } diff --git a/src/Analyser/AnalyserResultFinalizer.php b/src/Analyser/AnalyserResultFinalizer.php index 9428ffa3be9..191c4ff803c 100644 --- a/src/Analyser/AnalyserResultFinalizer.php +++ b/src/Analyser/AnalyserResultFinalizer.php @@ -61,23 +61,23 @@ public function finalize( AnalyserResult $analyserResult, bool $onlyFiles, bool $debug, - ?Closure $preRuleCallback = null, - ?Closure $postRuleCallback = null, - array $previousCollectedDataRuleResults = [], + ?Closure $preRuleCallback, + ?Closure $postRuleCallback, + array $previousCollectedDataRuleResults, ): FinalizerResult { if (count($analyserResult->getCollectedData()) === 0) { - return $this->addUnmatchedIgnoredErrors($this->mergeFilteredPhpErrors($analyserResult), [], []); + return $this->addUnmatchedIgnoredErrors($this->mergeFilteredPhpErrors($analyserResult), [], [], [], 0); } $hasInternalErrors = count($analyserResult->getInternalErrors()) > 0 || $analyserResult->hasReachedInternalErrorsCountLimit(); if ($hasInternalErrors) { - return $this->addUnmatchedIgnoredErrors($this->mergeFilteredPhpErrors($analyserResult), [], []); + return $this->addUnmatchedIgnoredErrors($this->mergeFilteredPhpErrors($analyserResult), [], [], [], 0); } $nodeType = CollectedDataNode::class; $collectedData = $analyserResult->getCollectedData(); - $node = new CollectedDataNode($collectedData, $onlyFiles); + $node = new CollectedDataNode($collectedData, $onlyFiles, null); // Hashed once per collector type and run, in the same order however the files were merged. $collectorHashes = []; @@ -349,8 +349,8 @@ private function addUnmatchedIgnoredErrors( AnalyserResult $analyserResult, array $collectorErrors, array $locallyIgnoredCollectorErrors, - array $collectedDataRuleResults = [], - int $reusedRulesCount = 0, + array $collectedDataRuleResults, + int $reusedRulesCount, ): FinalizerResult { if (!$this->reportUnmatchedIgnoredErrors) { diff --git a/src/Analyser/ArgsResult.php b/src/Analyser/ArgsResult.php index d5dd8a4ed87..7a5fa614b6d 100644 --- a/src/Analyser/ArgsResult.php +++ b/src/Analyser/ArgsResult.php @@ -31,7 +31,7 @@ public function __construct( private ExpressionResult $expressionResult, private ?ParametersAcceptor $resolvedParametersAcceptor, private array $argResults, - private array $byRefArguments = [], + private array $byRefArguments, ) { } diff --git a/src/Analyser/ArgumentsHandler.php b/src/Analyser/ArgumentsHandler.php index 4e84ba02c59..114a077296f 100644 --- a/src/Analyser/ArgumentsHandler.php +++ b/src/Analyser/ArgumentsHandler.php @@ -146,7 +146,7 @@ public function processArgs( ExpressionResultStorage $storage, callable $nodeCallback, ExpressionContext $context, - ?callable $closureBindScopeFactory = null, + ?callable $closureBindScopeFactory, ): ArgsResult { $args = $callLike->getArgs(); @@ -237,7 +237,7 @@ public function processArgs( $originalArgForGather = $arg->getAttribute(ArgumentsNormalizer::ORIGINAL_ARG_ATTRIBUTE) ?? $arg; $gatheredArgTypeByIndex[$i] = $typeDrivenAcceptorSelection ? $this->gatherClosureArgType($parametersAcceptors, $i, $arg->value, $scope) - : $this->closureTypeResolver->getClosureType($scope, $arg->value, true, $storage); + : $this->closureTypeResolver->getClosureType($scope, $arg->value, true, $storage, null); $this->addGatheredArgType($gatheredTypes, $gatheredUnpack, $gatheredHasName, $originalArgForGather, $i, $gatheredArgTypeByIndex[$i]); } @@ -367,10 +367,18 @@ public function processArgs( isAlwaysTerminating: false, throwPoints: [], impurePoints: [], - type: $this->closureTypeResolver->getClosureType($scopeToPass, $arg->value, false, $storage), - nativeType: $this->closureTypeResolver->getClosureType($scopeToPass->doNotTreatPhpDocTypesAsCertain(), $arg->value, false, $storage), + type: $this->closureTypeResolver->getClosureType($scopeToPass, $arg->value, false, $storage, null), + nativeType: $this->closureTypeResolver->getClosureType($scopeToPass->doNotTreatPhpDocTypesAsCertain(), $arg->value, false, $storage, null), typeCallback: null, specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); $nodeScopeResolver->storeExpressionResult($storage, $arg->value, $storedClosureArgResult); } @@ -410,7 +418,7 @@ public function processArgs( $closureResult = $this->closureProcessor->processClosureNode($nodeScopeResolver, $stmt, $arg->value, $scopeToPass, $storage, $nodeCallback, $context, $parameterType, $parameterNativeType); if ($this->callCallbackImmediately($parameter, $parameterType, $calleeReflection)) { - $throwPoints = array_merge($throwPoints, array_map(static fn (InternalThrowPoint $throwPoint) => $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($scope, $throwPoint->getType(), $arg->value, $throwPoint->canContainAnyThrowable()) : InternalThrowPoint::createImplicit($scope, $arg->value), $closureResult->getThrowPoints())); + $throwPoints = array_merge($throwPoints, array_map(static fn (InternalThrowPoint $throwPoint) => $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($scope, $throwPoint->getType(), $arg->value, $throwPoint->canContainAnyThrowable()) : InternalThrowPoint::createImplicit($scope, $arg->value, null), $closureResult->getThrowPoints())); $impurePoints = array_merge($impurePoints, $closureResult->getImpurePoints()); } @@ -434,6 +442,8 @@ public function processArgs( $closureResult->getInvalidateExpressions(), false, $storage, + null, + null, ), // the native flavour reads the stored native types off the same // single body walk - no second walk on the promoted scope @@ -448,13 +458,22 @@ public function processArgs( $closureResult->getInvalidateExpressions(), true, $storage, + null, + null, ), typeCallback: null, specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + argsResult: null, + dependencies: null, ); $storedClosureResult = $storedClosureResult->withDependencies(Dependencies::merge( $closureResult->getDependencies(), - Dependencies::create($scopeToPass->getFile(), DependencyTypes::ofClosureType($storedClosureResult->getType())), + Dependencies::create($scopeToPass->getFile(), DependencyTypes::ofClosureType($storedClosureResult->getType()), [], [], [], []), )); $nodeScopeResolver->storeExpressionResult($storage, $arg->value, $storedClosureResult); // the closure node's own callback fires after its result is @@ -517,10 +536,18 @@ public function processArgs( isAlwaysTerminating: false, throwPoints: [], impurePoints: [], - type: $this->closureTypeResolver->getClosureType($scopeToPass, $arg->value, false, $storage), - nativeType: $this->closureTypeResolver->getClosureType($scopeToPass->doNotTreatPhpDocTypesAsCertain(), $arg->value, false, $storage), + type: $this->closureTypeResolver->getClosureType($scopeToPass, $arg->value, false, $storage, null), + nativeType: $this->closureTypeResolver->getClosureType($scopeToPass->doNotTreatPhpDocTypesAsCertain(), $arg->value, false, $storage, null), typeCallback: null, specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); $nodeScopeResolver->storeExpressionResult($storage, $arg->value, $storedClosureArgResult); } @@ -559,7 +586,7 @@ public function processArgs( $arrowFunctionResult = $this->closureProcessor->processArrowFunctionNode($nodeScopeResolver, $stmt, $arg->value, $scopeToPass, $storage, $nodeCallback, $parameterType, $parameterNativeType, $context); $arrowFunctionExprResult = $arrowFunctionResult->getExpressionResult(); if ($this->callCallbackImmediately($parameter, $parameterType, $calleeReflection)) { - $throwPoints = array_merge($throwPoints, array_map(static fn (InternalThrowPoint $throwPoint) => $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($scope, $throwPoint->getType(), $arg->value, $throwPoint->canContainAnyThrowable()) : InternalThrowPoint::createImplicit($scope, $arg->value), $arrowFunctionExprResult->getThrowPoints())); + $throwPoints = array_merge($throwPoints, array_map(static fn (InternalThrowPoint $throwPoint) => $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($scope, $throwPoint->getType(), $arg->value, $throwPoint->canContainAnyThrowable()) : InternalThrowPoint::createImplicit($scope, $arg->value, null), $arrowFunctionExprResult->getThrowPoints())); $impurePoints = array_merge($impurePoints, $arrowFunctionExprResult->getImpurePoints()); } $arrowFunctionScope = $arrowFunctionResult->getArrowFunctionScope(); @@ -576,6 +603,8 @@ public function processArgs( $arrowFunctionResult->getInvalidateExpressions(), false, $storage, + null, + null, ); $storedArrowResult = $this->expressionResultFactory->create( $arrowFunctionExprResult->getScope(), @@ -596,13 +625,21 @@ public function processArgs( $arrowFunctionResult->getInvalidateExpressions(), true, $storage, + null, + null, ), typeCallback: null, specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), dependencies: Dependencies::merge( $arrowFunctionExprResult->getDependencies(), - Dependencies::create($scopeToPass->getFile(), DependencyTypes::ofClosureType($arrowFunctionType)), + Dependencies::create($scopeToPass->getFile(), DependencyTypes::ofClosureType($arrowFunctionType), [], [], [], []), ), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + argsResult: null, ); $nodeScopeResolver->storeExpressionResult($storage, $arg->value, $storedArrowResult); // the arrow function node's own callback fires after its result @@ -621,7 +658,7 @@ public function processArgs( } else { $enterExpressionAssignForByRef = $assignByReference && $arg->value instanceof ArrayDimFetch && $arg->value->dim === null; if ($enterExpressionAssignForByRef) { - $scopeToPass = $scopeToPass->enterExpressionAssign($arg->value); + $scopeToPass = $scopeToPass->enterExpressionAssign($arg->value, true); } $argContext = $context->enterDeep(); if (!$arg->unpack && $arg->value instanceof Expr\Array_) { @@ -654,7 +691,7 @@ public function processArgs( $deferredInvalidateExpressions[] = [$acceptors[0]->getInvalidateExpressions(), $acceptors[0]->getUsedVariables()]; } if ($callCallbackImmediately) { - $callableThrowPoints = array_map(static fn (SimpleThrowPoint $throwPoint) => $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($scope, $throwPoint->getType(), $arg->value, $throwPoint->canContainAnyThrowable()) : InternalThrowPoint::createImplicit($scope, $arg->value), $acceptors[0]->getThrowPoints()); + $callableThrowPoints = array_map(static fn (SimpleThrowPoint $throwPoint) => $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($scope, $throwPoint->getType(), $arg->value, $throwPoint->canContainAnyThrowable()) : InternalThrowPoint::createImplicit($scope, $arg->value, null), $acceptors[0]->getThrowPoints()); if (!$this->implicitThrows) { $callableThrowPoints = array_values(array_filter($callableThrowPoints, static fn (InternalThrowPoint $throwPoint) => $throwPoint->isExplicit())); } @@ -817,6 +854,7 @@ public function processArgs( $argValue, new NativeTypeExpr($byRefType, $byRefNativeType), $nodeCallback, + null, )->getScope(); $scope = $nodeScopeResolver->lookForUnsetAllowedUndefinedExpressions($scope, $argValue); } @@ -863,6 +901,15 @@ public function processArgs( typeCallback: static fn () => new MixedType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), dependencies: Dependencies::merge(...array_map(static fn (ExpressionResult $argResult): ?Dependencies => $argResult->getDependencies(), array_values($argResults))), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, ), $resolvedAcceptor, $argResults, diff --git a/src/Analyser/AttributesHandler.php b/src/Analyser/AttributesHandler.php index ece200b1dab..6b2b534dc27 100644 --- a/src/Analyser/AttributesHandler.php +++ b/src/Analyser/AttributesHandler.php @@ -58,14 +58,14 @@ public function processAttributeGroups( ); $expr = new New_($attr->name, $attr->args); $expr = ArgumentsNormalizer::reorderNewArguments($parametersAcceptor, $expr) ?? $expr; - $dependencies[] = $this->argumentsHandler->processArgs($nodeScopeResolver, $stmt, $constructorReflection, null, $constructorReflection->getVariants(), $constructorReflection->getNamedArgumentsVariants(), $expr, $scope, $storage, $nodeCallback, ExpressionContext::createDeep())->getDependencies(); + $dependencies[] = $this->argumentsHandler->processArgs($nodeScopeResolver, $stmt, $constructorReflection, null, $constructorReflection->getVariants(), $constructorReflection->getNamedArgumentsVariants(), $expr, $scope, $storage, $nodeCallback, ExpressionContext::createDeep(true), null)->getDependencies(); $nodeScopeResolver->callNodeCallback($nodeCallback, $attr, $scope, $storage); continue; } } foreach ($attr->args as $arg) { - $dependencies[] = $nodeScopeResolver->processExprNode($stmt, $arg->value, $scope, $storage, $nodeCallback, ExpressionContext::createDeep())->getDependencies(); + $dependencies[] = $nodeScopeResolver->processExprNode($stmt, $arg->value, $scope, $storage, $nodeCallback, ExpressionContext::createDeep(true))->getDependencies(); $nodeScopeResolver->callNodeCallback($nodeCallback, $arg, $scope, $storage); } $nodeScopeResolver->callNodeCallback($nodeCallback, $attr, $scope, $storage); diff --git a/src/Analyser/ClosureProcessor.php b/src/Analyser/ClosureProcessor.php index e52c33ac024..8977b609484 100644 --- a/src/Analyser/ClosureProcessor.php +++ b/src/Analyser/ClosureProcessor.php @@ -114,7 +114,7 @@ public function processClosureNode( callable $nodeCallback, ExpressionContext $context, ?Type $passedToType, - ?Type $nativePassedToType = null, + ?Type $nativePassedToType, ): ProcessClosureResult { return $this->processClosureNodeInternal($nodeScopeResolver, $stmt, $expr, $scope, $storage, $nodeCallback, $context, $passedToType, $nativePassedToType); @@ -132,7 +132,7 @@ private function processClosureNodeInternal( callable $nodeCallback, ExpressionContext $context, ?Type $passedToType, - ?Type $nativePassedToType = null, + ?Type $nativePassedToType, ): ProcessClosureResult { $parametersDependencies = $this->processAttributeGroupsAndParams($nodeScopeResolver, $stmt, $expr, $scope, $storage, $nodeCallback); @@ -147,14 +147,14 @@ private function processClosureNodeInternal( // the closure's own body may invoke it (use (&$self)): its sites must // exist before the body is observed if ($this->closureSignatureInference->isObserving($scope)) { - $scope = $scope->addTemplateArgumentConstraints($this->closureSignatureInference->collectSites($scope, $this->closureTypeResolver->getClosureType($scope, $expr, true, $storage))); + $scope = $scope->addTemplateArgumentConstraints($this->closureSignatureInference->collectSites($scope, $this->closureTypeResolver->getClosureType($scope, $expr, true, $storage, null))); } $useScope = $scope; foreach ($expr->uses as $use) { if ($use->byRef) { $byRefUses[] = $use; - $useScope = $useScope->enterExpressionAssign($use->var); + $useScope = $useScope->enterExpressionAssign($use->var, true); $inAssignRightSideVariableName = $context->getInAssignRightSideVariableName(); $inAssignRightSideExpr = $context->getInAssignRightSideExpr(); @@ -363,7 +363,7 @@ private function processClosureNodeInternal( break; } if ($count >= NodeScopeResolver::GENERALIZE_AFTER_ITERATION) { - $closureScope = $prevScope->generalizeWith($closureScope); + $closureScope = $prevScope->generalizeWith($closureScope, null); } $count++; } @@ -495,7 +495,7 @@ public function processByRefInvocation( $throwScope = $this->assignByRefUses($scope, $throwPoint->getScope(), $byRefUses); $throwPoints[] = $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($throwScope, $throwPoint->getType(), $call, $throwPoint->canContainAnyThrowable()) - : InternalThrowPoint::createImplicit($throwScope, $call); + : InternalThrowPoint::createImplicit($throwScope, $call, null); } return [$this->assignByRefUses($scope, $exitScope, $byRefUses), $throwPoints]; @@ -543,7 +543,7 @@ private function walkByRefInvocation( break; } if ($count >= NodeScopeResolver::GENERALIZE_AFTER_ITERATION) { - $nextEntryScope = $entryScope->generalizeWith($nextEntryScope); + $nextEntryScope = $entryScope->generalizeWith($nextEntryScope, null); } $entryScope = $nextEntryScope; $count++; @@ -739,6 +739,8 @@ private function refineClosureNodeScope( $invalidateExpressions, false, $storage, + null, + null, ); return $closureScope->withAnonymousFunctionReflection($refinedClosureType); @@ -779,11 +781,11 @@ public function processArrowFunctionNode( ExpressionResultStorage $storage, callable $nodeCallback, ?Type $passedToType, - ?Type $nativePassedToType = null, - ?ExpressionContext $context = null, + ?Type $nativePassedToType, + ?ExpressionContext $context, ): ProcessArrowFunctionResult { - $context ??= ExpressionContext::createTopLevel(); + $context ??= ExpressionContext::createTopLevel(true); $parametersDependencies = $this->processAttributeGroupsAndParams($nodeScopeResolver, $stmt, $expr, $scope, $storage, $nodeCallback); if ($this->closureSignatureInference->isObserving($scope)) { foreach (ClosureSignatureInference::getArrowFunctionOuterVariables($expr) as $name) { @@ -863,6 +865,8 @@ public function processArrowFunctionNode( $invalidateExpressions, false, $storage, + null, + null, ); $refinedArrowFunctionScope = $arrowFunctionScope->withAnonymousFunctionReflection($refinedArrowFunctionType); $nodeScopeResolver->callNodeCallback($nodeCallback, new InArrowFunctionNode($refinedArrowFunctionType, $expr), $refinedArrowFunctionScope, $storage); @@ -880,6 +884,14 @@ public function processArrowFunctionNode( typeCallback: static fn () => new MixedType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), dependencies: Dependencies::merge($parametersDependencies, $exprResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ), $arrowFunctionScope, $closureTypeThrowPoints, diff --git a/src/Analyser/CollectedDataRuleResult.php b/src/Analyser/CollectedDataRuleResult.php index afe87c62968..4807d762992 100644 --- a/src/Analyser/CollectedDataRuleResult.php +++ b/src/Analyser/CollectedDataRuleResult.php @@ -21,7 +21,7 @@ public function __construct( private array $collectorHashes, private ?bool $onlyFiles, private array $errors, - private array $valueDependencies = [], + private array $valueDependencies, ) { } diff --git a/src/Analyser/DirectInternalScopeFactory.php b/src/Analyser/DirectInternalScopeFactory.php index c0a9007c0c7..f59828d6248 100644 --- a/src/Analyser/DirectInternalScopeFactory.php +++ b/src/Analyser/DirectInternalScopeFactory.php @@ -45,8 +45,8 @@ public function __construct( private ConfiguredPhpVersionRangeHelper $configuredPhpVersionRangeHelper, private $nodeCallback, private ConstantResolver $constantResolver, - private bool $createsNodeCallbackScopes = false, - ?ExpressionResultStorageStack $expressionResultStorageStack = null, + private bool $createsNodeCallbackScopes, + ?ExpressionResultStorageStack $expressionResultStorageStack, ) { $this->expressionResultStorageStack = $expressionResultStorageStack ?? new ExpressionResultStorageStack(); diff --git a/src/Analyser/DirectInternalScopeFactoryFactory.php b/src/Analyser/DirectInternalScopeFactoryFactory.php index 4e778139644..b36559297ab 100644 --- a/src/Analyser/DirectInternalScopeFactoryFactory.php +++ b/src/Analyser/DirectInternalScopeFactoryFactory.php @@ -41,7 +41,7 @@ public function __construct( /** * @param callable(Node $node, Scope $scope): void|null $nodeCallback */ - public function create(?callable $nodeCallback): DirectInternalScopeFactory + public function create(?callable $nodeCallback, bool $createsNodeCallbackScopes, ?ExpressionResultStorageStack $expressionResultStorageStack): DirectInternalScopeFactory { return new DirectInternalScopeFactory( $this->container, @@ -57,6 +57,8 @@ public function create(?callable $nodeCallback): DirectInternalScopeFactory $this->configuredPhpVersionRangeHelper, $nodeCallback, $this->constantResolver, + $createsNodeCallbackScopes, + $expressionResultStorageStack, ); } diff --git a/src/Analyser/DisjunctionBranchUnionAugment.php b/src/Analyser/DisjunctionBranchUnionAugment.php index 64536d0f537..7f73f98b262 100644 --- a/src/Analyser/DisjunctionBranchUnionAugment.php +++ b/src/Analyser/DisjunctionBranchUnionAugment.php @@ -66,7 +66,7 @@ public function evaluate(MutatingScope $scope): ?SpecifiedTypes continue; } - $created = $this->defaultNarrowingHelper->createForSubject($targetExpr, $unionType, TypeSpecifierContext::createTrue(), $scope); + $created = $this->defaultNarrowingHelper->createForSubject($targetExpr, $unionType, TypeSpecifierContext::createTrue(), $scope, null); $result = $result === null ? $created : $result->unionWith($created); } diff --git a/src/Analyser/ExprHandler/ArrayDimFetchHandler.php b/src/Analyser/ExprHandler/ArrayDimFetchHandler.php index 9a272b6134d..a80224a7f79 100644 --- a/src/Analyser/ExprHandler/ArrayDimFetchHandler.php +++ b/src/Analyser/ExprHandler/ArrayDimFetchHandler.php @@ -101,6 +101,13 @@ public function composeResult(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, typeCallback: static fn (): Type => new NeverType(), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $varResult->getDependencies(), + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } @@ -169,19 +176,26 @@ public function composeResult(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, return $shortCircuit(ParametersAcceptorSelector::combineAcceptors($methodReflection->getVariants())->getNativeReturnType()); } - return $shortCircuit($this->methodCallReturnTypeHelper->methodCallReturnType($scope, $offsetAccessibleType, 'offsetGet', $offsetGetCall) ?? new ErrorType()); + return $shortCircuit($this->methodCallReturnTypeHelper->methodCallReturnType($scope, $offsetAccessibleType, 'offsetGet', $offsetGetCall, null, null) ?? new ErrorType()); } return $shortCircuit($offsetAccessibleType->getOffsetValueType(($nativeTypesPromoted ? $dimResult->getNativeType() : $dimResult->getType()))); }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypesWithNullsafeFan($expr, $context, $beforeScope, $nativeTypesPromoted), + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); // the classes in the type of the value at the offset return $result->withDependencies(Dependencies::merge( $varResult->getDependencies(), $dimResult->getDependencies(), - Dependencies::create($beforeScope->getFile(), [$result->getType()]), + Dependencies::create($beforeScope->getFile(), [$result->getType()], [], [], [], []), )); } @@ -191,7 +205,7 @@ private static function offsetRead(ArrayDimFetch $expr, ?ExpressionResult $dimRe return null; } $target = $context->getValueFlowTarget(); - return VariableFlow::read($expr->var->name, $target !== null ? $target->getId() : null, offset: $dimResult !== null ? VariableWriteOffset::fromType($dimResult->getType()) : null); + return VariableFlow::read($expr->var->name, $target !== null ? $target->getId() : null, offset: $dimResult !== null ? VariableWriteOffset::fromType($dimResult->getType()) : null, container: false); } } diff --git a/src/Analyser/ExprHandler/ArrayHandler.php b/src/Analyser/ExprHandler/ArrayHandler.php index 186169a8830..906a5ca4907 100644 --- a/src/Analyser/ExprHandler/ArrayHandler.php +++ b/src/Analyser/ExprHandler/ArrayHandler.php @@ -147,7 +147,7 @@ private function walkItems(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Arr if ($tracksKeys) { [$keyType, $offset] = $this->getKeyTypeAndOffset($nodeScopeResolver, $arrayItem, $item['keyResult'], $scope, $nextIndex); if ($walk['literalWrite'] !== null) { - $item['itemWrite'] = new VariableWrite($walk['literalWrite']->getVariableName(), $arrayItem, spl_object_id($arrayItem), VariableWrite::KIND_ARRAY_LITERAL_ITEM, true, $offset, $walk['literalWrite']->getId()); + $item['itemWrite'] = new VariableWrite($walk['literalWrite']->getVariableName(), $arrayItem, spl_object_id($arrayItem), VariableWrite::KIND_ARRAY_LITERAL_ITEM, true, $offset, $walk['literalWrite']->getId(), true); } } @@ -353,7 +353,7 @@ private function createResult(NodeScopeResolver $nodeScopeResolver, array $walk, foreach ($walkedResults as $walkedResult) { if ($walkedResult === $valueResult && $item['itemWrite'] !== null) { - $variableFlows[] = VariableFlow::write($item['itemWrite']); + $variableFlows[] = VariableFlow::write($item['itemWrite'], null); } $variableFlows[] = $walkedResult->getVariableFlow(); $hasYield = $hasYield || $walkedResult->hasYield(); @@ -422,6 +422,15 @@ private function createResult(NodeScopeResolver $nodeScopeResolver, array $walk, return $type; }, specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); return $result->withDependencies(Dependencies::merge( @@ -571,7 +580,7 @@ private function getCallableDependencies(MutatingScope $scope, Array_ $expr, arr $returnTypes[] = $variant->getReturnType(); } - return Dependencies::create($scope->getFile(), $returnTypes); + return Dependencies::create($scope->getFile(), $returnTypes, [], [], [], []); } /** diff --git a/src/Analyser/ExprHandler/ArrowFunctionHandler.php b/src/Analyser/ExprHandler/ArrowFunctionHandler.php index 5914935419b..dd22edf10af 100644 --- a/src/Analyser/ExprHandler/ArrowFunctionHandler.php +++ b/src/Analyser/ExprHandler/ArrowFunctionHandler.php @@ -100,7 +100,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex type: $type, nativeType: $nativeType, typeCallback: null, - dependencies: Dependencies::merge($result->getDependencies(), Dependencies::create($scope->getFile(), DependencyTypes::ofClosureType($type))), + dependencies: Dependencies::merge($result->getDependencies(), Dependencies::create($scope->getFile(), DependencyTypes::ofClosureType($type), [], [], [], [])), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + argsResult: null, ); } @@ -111,7 +117,7 @@ public static function getVariableFlow(ArrowFunction $expr, ExpressionResult $bo if (!$param->byRef || !$param->var instanceof Expr\Variable || !is_string($param->var->name)) { continue; } - $outputs[] = VariableFlow::read($param->var->name); + $outputs[] = VariableFlow::read($param->var->name, null, false, null); } return VariableFlow::arrow($expr, $bodyResult->getVariableFlow(), VariableFlow::sequence(...$outputs)); diff --git a/src/Analyser/ExprHandler/AssignHandler.php b/src/Analyser/ExprHandler/AssignHandler.php index 62ee67ed27b..52d20e942be 100644 --- a/src/Analyser/ExprHandler/AssignHandler.php +++ b/src/Analyser/ExprHandler/AssignHandler.php @@ -203,7 +203,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex ); } - $valueScope = $valueScope->enterExpressionAssign($expr->expr); + $valueScope = $valueScope->enterExpressionAssign($expr->expr, true); } $valueContext = $context; @@ -237,6 +237,16 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: $valueImpurePoints, typeCallback: static fn (bool $nativeTypesPromoted): Type => $nativeTypesPromoted ? $assignedExprResult->getNativeType() : $assignedExprResult->getType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ), $assignedExprResult, $stmt, @@ -299,7 +309,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex ? self::redundant($assignedExprResult, $expr->var, $storage) : null; $variableFlow = VariableFlow::sequence( - VariableFlowBuilder::targetRead($expr->var, $storage, false), + VariableFlowBuilder::targetRead($expr->var, $storage, false, null), $assignedExprResult->getVariableFlow(), $valueFlowWrite !== null && $context->isValueConsumed() ? VariableFlow::inputs($valueFlowWrite->getId(), $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null) : null, VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_ASSIGN, $scope, $storage, $redundantType), @@ -324,6 +334,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex specifyTypesCallback: $expr instanceof Assign ? $this->createSpecifyTypesCallback($expr, $assignedExprResult, $beforeScope, $storage) : fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), createTypesCallback: $expr instanceof Assign ? $this->createCreateTypesCallback($expr, $assignedExprResult, $beforeScope) : null, dependencies: Dependencies::merge($assignedExprResult->getDependencies(), $result->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + argsResult: null, ); } @@ -577,7 +594,7 @@ private function createSpecifyTypesCallback(Assign $expr, ExpressionResult $assi /** * @param callable(Node $node, Scope $scope): void $nodeCallback */ - public function processVirtualAssign(NodeScopeResolver $nodeScopeResolver, MutatingScope $scope, ExpressionResultStorage $storage, Node\Stmt $stmt, Expr $var, Expr $assignedExpr, callable $nodeCallback, ?ExpressionResult $assignedExprResult = null): ExpressionResult + public function processVirtualAssign(NodeScopeResolver $nodeScopeResolver, MutatingScope $scope, ExpressionResultStorage $storage, Node\Stmt $stmt, Expr $var, Expr $assignedExpr, callable $nodeCallback, ?ExpressionResult $assignedExprResult): ExpressionResult { // work off an available result for the assigned expr: passed by the // caller, or fabricated from a type-carrying virtual node - threaded @@ -601,7 +618,7 @@ public function processVirtualAssign(NodeScopeResolver $nodeScopeResolver, Mutat $var, $assignedExpr, $virtualAssignNodeCallback, - ExpressionContext::createDeep(), + ExpressionContext::createDeep(true), AssignTargetWalkMode::virtualAssign(), ); @@ -618,12 +635,22 @@ public function processVirtualAssign(NodeScopeResolver $nodeScopeResolver, Mutat impurePoints: [], typeCallback: static fn () => new MixedType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ), $assignedExprResult, $stmt, $storage, $virtualAssignNodeCallback, - ExpressionContext::createDeep(), + ExpressionContext::createDeep(true), ); } @@ -654,7 +681,7 @@ public function prepareTarget( // answers its asks from the storage instead of re-walking on demand, // same as NodeScopeResolver::processExprNodeInternal(). $prepared = $this->doPrepareTarget($nodeScopeResolver, $scope, $storage, $stmt, $var, $assignedExpr, $nodeCallback, $context, $mode); - $nodeScopeResolver->callNodeCallback($nodeCallback, $var, $mode->enterExpressionAssign() ? $scope->enterExpressionAssign($var) : $scope, $storage); + $nodeScopeResolver->callNodeCallback($nodeCallback, $var, $mode->enterExpressionAssign() ? $scope->enterExpressionAssign($var, true) : $scope, $storage); return $prepared; } @@ -706,7 +733,7 @@ private function doPrepareTarget( $nonNullabilityResult = $this->nonNullabilityHelper->ensureNonNullability($scope, $var); $readScope = $nodeScopeResolver->lookForSetAllowedUndefinedExpressions($nonNullabilityResult->getScope(), $var); } - $targetReadResult = $this->variableHandler->composeResult($nodeScopeResolver, $var, $variableNameResult, $storage, $readScope); + $targetReadResult = $this->variableHandler->composeResult($nodeScopeResolver, $var, $variableNameResult, $storage, $readScope, null); if ($mode->issetSemanticsForRead()) { $targetChainResults[spl_object_id($var)] = $targetReadResult; } @@ -728,6 +755,18 @@ private function doPrepareTarget( targetChainResults: $targetChainResults, variableNameResult: $variableNameResult, dependencies: $variableNameResult !== null ? $variableNameResult->getDependencies() : null, + rootVar: null, + varResult: null, + dimFetchStack: null, + assignedPropertyExpr: null, + offsetTypes: null, + offsetNativeTypes: null, + existingOffsetTypes: null, + existingOffsetNativeTypes: null, + offsetSetTargetResult: null, + objectResult: null, + propertyName: null, + propertyHolderType: null, ); } @@ -814,13 +853,23 @@ private function doPrepareTarget( impurePoints: [], typeCallback: static fn (): Type => new NeverType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); $deferredDimFetchResults[] = [$dimFetch, $fabricatedResult]; $previousLinkResult = $fabricatedResult; } else { if ($enterExpressionAssign) { - $scope->enterExpressionAssign($dimExpr); + $scope->enterExpressionAssign($dimExpr, true); } // process the dimension first, then consume its ExpressionResult // (single-pass inside-out) rather than reading it before processExprNode() @@ -846,6 +895,16 @@ private function doPrepareTarget( return $previousLinkResult->getTypeOnScope($s, $s->nativeTypesPromoted)->getOffsetValueType($dimNodeResult->getTypeOnScope($s, $s->nativeTypesPromoted)); }, specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); $deferredDimFetchResults[] = [$dimFetch, $fabricatedResult]; $previousLinkResult = $fabricatedResult; @@ -865,7 +924,7 @@ private function doPrepareTarget( } $nodeScopeResolver->storeExpressionResult($storage, $dimFetch, $previousLinkResult); - $nodeScopeResolver->callNodeCallback($nodeCallback, $dimFetch, $enterExpressionAssign ? $callbackScope->enterExpressionAssign($dimFetch) : $callbackScope, $storage); + $nodeScopeResolver->callNodeCallback($nodeCallback, $dimFetch, $enterExpressionAssign ? $callbackScope->enterExpressionAssign($dimFetch, true) : $callbackScope, $storage); } if ($mode->issetSemanticsForRead()) { @@ -917,7 +976,7 @@ private function doPrepareTarget( $linkTypes[] = $deferredResult->getType(); } - $targetDependencies[] = Dependencies::create($beforeScope->getFile(), $linkTypes); + $targetDependencies[] = Dependencies::create($beforeScope->getFile(), $linkTypes, [], [], [], []); $targetDependencies = Dependencies::merge(...$targetDependencies); // the chain link the write's ArrayAccess::offsetSet would be invoked on: // the second-outermost link, or the root for a single-dimension target @@ -947,6 +1006,12 @@ private function doPrepareTarget( targetReadResult: $targetReadResult, targetChainResults: $targetChainResults, dependencies: $targetDependencies, + existingOffsetTypes: null, + existingOffsetNativeTypes: null, + objectResult: null, + propertyName: null, + propertyHolderType: null, + variableNameResult: null, ); } @@ -1014,6 +1079,17 @@ private function doPrepareTarget( targetReadResult: $targetReadResult, targetChainResults: $targetChainResults, dependencies: $parkedReadResult->getDependencies(), + rootVar: null, + varResult: null, + dimFetchStack: null, + assignedPropertyExpr: null, + offsetTypes: null, + offsetNativeTypes: null, + existingOffsetTypes: null, + existingOffsetNativeTypes: null, + offsetSetTargetResult: null, + propertyHolderType: null, + variableNameResult: null, ); } @@ -1075,6 +1151,17 @@ private function doPrepareTarget( targetReadResult: $targetReadResult, targetChainResults: $targetChainResults, dependencies: $parkedReadResult->getDependencies(), + rootVar: null, + varResult: null, + dimFetchStack: null, + assignedPropertyExpr: null, + offsetTypes: null, + offsetNativeTypes: null, + existingOffsetTypes: null, + existingOffsetNativeTypes: null, + offsetSetTargetResult: null, + objectResult: null, + variableNameResult: null, ); } @@ -1091,6 +1178,22 @@ private function doPrepareTarget( $throwPoints, $impurePoints, $isAlwaysTerminating, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + [], + null, + null, ); } @@ -1141,6 +1244,17 @@ private function doPrepareTarget( assignedPropertyExpr: $assignedPropertyExpr, existingOffsetTypes: $offsetTypes, existingOffsetNativeTypes: $offsetNativeTypes, + dimFetchStack: null, + offsetTypes: null, + offsetNativeTypes: null, + offsetSetTargetResult: null, + objectResult: null, + propertyName: null, + propertyHolderType: null, + targetReadResult: null, + targetChainResults: [], + variableNameResult: null, + dependencies: null, ); } @@ -1176,6 +1290,19 @@ private function doPrepareTarget( targetReadResult: $targetReadResult, targetChainResults: $targetChainResults, dependencies: $varResult->getDependencies(), + rootVar: null, + varResult: null, + dimFetchStack: null, + assignedPropertyExpr: null, + offsetTypes: null, + offsetNativeTypes: null, + existingOffsetTypes: null, + existingOffsetNativeTypes: null, + offsetSetTargetResult: null, + objectResult: null, + propertyName: null, + propertyHolderType: null, + variableNameResult: null, ); } @@ -1585,7 +1712,7 @@ public function applyWrite( $scope = $result->getScope(); if ($var->name instanceof Expr && $this->phpVersion->supportsPropertyHooks()) { - $throwPoints[] = InternalThrowPoint::createImplicit($scope, $var); + $throwPoints[] = InternalThrowPoint::createImplicit($scope, $var, null); } $propertyHolderType = $objectResult->getType(); @@ -1744,7 +1871,7 @@ public function applyWrite( $itemScope = $scope; if ($enterExpressionAssign) { - $itemScope = $itemScope->enterExpressionAssign($arrayItem->value); + $itemScope = $itemScope->enterExpressionAssign($arrayItem->value, true); } $itemScope = $nodeScopeResolver->lookForSetAllowedUndefinedExpressions($itemScope, $arrayItem->value); $keyResult = null; @@ -1800,6 +1927,16 @@ public function applyWrite( impurePoints: [], typeCallback: static fn () => new MixedType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ), $itemValueResult, $stmt, @@ -1883,6 +2020,15 @@ public function applyWrite( typeCallback: static fn () => new MixedType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), dependencies: Dependencies::merge(...$writeDependencies), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, ); } @@ -1902,13 +2048,13 @@ private function collectOffsetSetUsage(NodeScopeResolver $nodeScopeResolver, Mut $parameters = $receiverType->getMethod('offsetSet', $scope)->getOnlyVariant()->getParameters(); if ($keyType !== null && isset($parameters[0])) { - $constraints = $constraints->merge($this->templateArgumentObserver->collectArgument($parameters[0]->getType(), $keyType)); + $constraints = $constraints->merge($this->templateArgumentObserver->collectArgument($parameters[0]->getType(), $keyType, false)); } if (!isset($parameters[1])) { return $constraints; } - $constraints = $constraints->merge($this->templateArgumentObserver->collectArgument($parameters[1]->getType(), $valueType)); + $constraints = $constraints->merge($this->templateArgumentObserver->collectArgument($parameters[1]->getType(), $valueType, false)); $constraints = $constraints->merge($this->templateArgumentObserver->collectClosureArgument($parameters[1]->getType(), $valueType)); return $constraints; } @@ -1979,7 +2125,7 @@ private function resolveContainerTypesAfterAssignedExprEval( // the raw superglobal array (see bug-14999). if ( !in_array($var->name, Scope::SUPERGLOBAL_VARIABLES, true) - && !$varResult->askScopeVariableStateMatches($postEvalScope, false) + && !$varResult->askScopeVariableStateMatches($postEvalScope, false, false) ) { // the assigned expression reassigned the root variable itself return [ diff --git a/src/Analyser/ExprHandler/AssignOpHandler.php b/src/Analyser/ExprHandler/AssignOpHandler.php index c7cc9c15257..9fcbeac8db8 100644 --- a/src/Analyser/ExprHandler/AssignOpHandler.php +++ b/src/Analyser/ExprHandler/AssignOpHandler.php @@ -124,6 +124,16 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $rightResult->getImpurePoints(), typeCallback: static fn () => new MixedType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); } @@ -253,6 +263,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: $typeCallback, specifyTypesCallback: $specifyTypesCallback, createTypesCallback: $createTypesCallback, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); // applyWrite() emits nodes (PropertyAssignNode) whose rules ask about @@ -296,7 +315,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $writeFlow = VariableFlow::sequence( $rhsResult->getVariableFlow(), $valueFlowWrite !== null && $context->isValueConsumed() ? VariableFlow::inputs($valueFlowWrite->getId(), $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null) : null, - VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_READ_MODIFY_WRITE, $scope, $storage), + VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_READ_MODIFY_WRITE, $scope, $storage, null), ); $variableFlow = VariableFlow::sequence( VariableFlowBuilder::targetRead($expr->var, $storage, true, !($expr instanceof Expr\AssignOp\Coalesce) && $valueFlowWrite !== null ? $valueFlowWrite->getId() : null), @@ -316,6 +335,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex specifyTypesCallback: $specifyTypesCallback, createTypesCallback: $createTypesCallback, dependencies: Dependencies::merge($rhsResult->getDependencies(), $assignResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/BinaryOpHandler.php b/src/Analyser/ExprHandler/BinaryOpHandler.php index 362e7b27ab4..bcfdef7b7d8 100644 --- a/src/Analyser/ExprHandler/BinaryOpHandler.php +++ b/src/Analyser/ExprHandler/BinaryOpHandler.php @@ -490,7 +490,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { if (count($countables) > 0) { $countableType = TypeCombinator::union(...$countables); - return $this->defaultNarrowingHelper->createForSubject($expr->right->getArgs()[0]->value, $countableType, $context, $scope)->setRootExpr($expr); + return $this->defaultNarrowingHelper->createForSubject($expr->right->getArgs()[0]->value, $countableType, $context, $scope, null)->setRootExpr($expr); } } @@ -501,7 +501,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { } $result = $result->unionWith( - $this->defaultNarrowingHelper->createForSubject($expr->right->getArgs()[0]->value, $newType, $context, $scope)->setRootExpr($expr), + $this->defaultNarrowingHelper->createForSubject($expr->right->getArgs()[0]->value, $newType, $context, $scope, null)->setRootExpr($expr), ); } } @@ -518,7 +518,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { $arrayArg = $expr->right->getArgs()[0]->value; $dimFetch = new Expr\ArrayDimFetch($arrayArg, $expr->left); $result = $result->unionWith( - $this->defaultNarrowingHelper->createForSubject($dimFetch, $argType->getIterableValueType(), TypeSpecifierContext::createTrue(), $scope)->setRootExpr($expr), + $this->defaultNarrowingHelper->createForSubject($dimFetch, $argType->getIterableValueType(), TypeSpecifierContext::createTrue(), $scope, null)->setRootExpr($expr), ); } } @@ -548,7 +548,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { $arrayArg = $expr->right->left->getArgs()[0]->value; $dimFetch = new Expr\ArrayDimFetch($arrayArg, $expr->left); $result = $result->unionWith( - $this->defaultNarrowingHelper->createForSubject($dimFetch, $countArgType->getIterableValueType(), TypeSpecifierContext::createTrue(), $scope)->setRootExpr($expr), + $this->defaultNarrowingHelper->createForSubject($dimFetch, $countArgType->getIterableValueType(), TypeSpecifierContext::createTrue(), $scope, null)->setRootExpr($expr), ); } } @@ -592,7 +592,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { $accessory = new AccessoryNonFalsyStringType(); } - $result = $result->unionWith($this->defaultNarrowingHelper->createForSubject($expr->right->getArgs()[0]->value, $accessory, $context, $scope)->setRootExpr($expr)); + $result = $result->unionWith($this->defaultNarrowingHelper->createForSubject($expr->right->getArgs()[0]->value, $accessory, $context, $scope, null)->setRootExpr($expr)); } } } @@ -656,6 +656,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { $orEqual ? $rightType->getSmallerOrEqualType($this->phpVersion) : $rightType->getSmallerType($this->phpVersion), TypeSpecifierContext::createTruthy(), $scope, + null, )->setRootExpr($expr), ); } @@ -666,6 +667,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { $orEqual ? $leftType->getGreaterOrEqualType($this->phpVersion) : $leftType->getGreaterType($this->phpVersion), TypeSpecifierContext::createTruthy(), $scope, + null, )->setRootExpr($expr), ); } @@ -677,6 +679,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { $orEqual ? $rightType->getGreaterType($this->phpVersion) : $rightType->getGreaterOrEqualType($this->phpVersion), TypeSpecifierContext::createTruthy(), $scope, + null, )->setRootExpr($expr), ); } @@ -687,6 +690,7 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { $orEqual ? $leftType->getSmallerType($this->phpVersion) : $leftType->getSmallerOrEqualType($this->phpVersion), TypeSpecifierContext::createTruthy(), $scope, + null, )->setRootExpr($expr), ); } @@ -706,6 +710,14 @@ static function () use ($expr, $nativeTypesPromoted, $typeCallback): Type { return $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context); }, dependencies: Dependencies::merge($leftResult->getDependencies(), $rightResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/BitwiseNotHandler.php b/src/Analyser/ExprHandler/BitwiseNotHandler.php index bde23491890..46214152871 100644 --- a/src/Analyser/ExprHandler/BitwiseNotHandler.php +++ b/src/Analyser/ExprHandler/BitwiseNotHandler.php @@ -63,6 +63,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/BooleanAndHandler.php b/src/Analyser/ExprHandler/BooleanAndHandler.php index 8c1eecd2bef..4cb01a6c8e0 100644 --- a/src/Analyser/ExprHandler/BooleanAndHandler.php +++ b/src/Analyser/ExprHandler/BooleanAndHandler.php @@ -112,6 +112,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex static fn (): MutatingScope => $rightResult->getFalseyScope(), ), dependencies: Dependencies::merge($leftResult->getDependencies(), $rightResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); // store before emitting the virtual node: its rules ask about the raw // expression, and a synchronously invoked rule (the plain resolver, diff --git a/src/Analyser/ExprHandler/BooleanNotHandler.php b/src/Analyser/ExprHandler/BooleanNotHandler.php index ab5849d722a..d349285cb68 100644 --- a/src/Analyser/ExprHandler/BooleanNotHandler.php +++ b/src/Analyser/ExprHandler/BooleanNotHandler.php @@ -77,6 +77,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex return $exprResult->getSpecifiedTypes($context->negate(), $nativeTypesPromoted)->setRootExpr($expr); }, dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/BooleanOrHandler.php b/src/Analyser/ExprHandler/BooleanOrHandler.php index 1a297be5241..16cf48da639 100644 --- a/src/Analyser/ExprHandler/BooleanOrHandler.php +++ b/src/Analyser/ExprHandler/BooleanOrHandler.php @@ -132,6 +132,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex static fn (): MutatingScope => $rightResult->getTruthyScope(), ), dependencies: Dependencies::merge($leftResult->getDependencies(), $rightResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); // store before emitting the virtual node: its rules ask about the raw // expression, and a synchronously invoked rule (the plain resolver, diff --git a/src/Analyser/ExprHandler/CastHandler.php b/src/Analyser/ExprHandler/CastHandler.php index 7a4165c7535..2a79b304e9f 100644 --- a/src/Analyser/ExprHandler/CastHandler.php +++ b/src/Analyser/ExprHandler/CastHandler.php @@ -120,6 +120,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex return $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context); }, dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/CastStringHandler.php b/src/Analyser/ExprHandler/CastStringHandler.php index 0eefea4cea8..3bb2f0f3cd8 100644 --- a/src/Analyser/ExprHandler/CastStringHandler.php +++ b/src/Analyser/ExprHandler/CastStringHandler.php @@ -80,6 +80,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex new NotEqual($expr->expr, new String_('')), )->getSpecifiedTypes($context, $nativeTypesPromoted)->setRootExpr($expr), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/ClassConstFetchHandler.php b/src/Analyser/ExprHandler/ClassConstFetchHandler.php index aff729cfbbc..a21602c96ab 100644 --- a/src/Analyser/ExprHandler/ClassConstFetchHandler.php +++ b/src/Analyser/ExprHandler/ClassConstFetchHandler.php @@ -117,6 +117,15 @@ static function (Expr $e) use ($classResult, $nativeTypesPromoted): Type { ); }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); return $result->withDependencies(Dependencies::merge( @@ -157,7 +166,7 @@ private function getDependencies(MutatingScope $scope, ClassConstFetch $expr, ?E } } - return Dependencies::create($scope->getFile(), $types, $classNames); + return Dependencies::create($scope->getFile(), $types, $classNames, [], [], []); } } diff --git a/src/Analyser/ExprHandler/CloneHandler.php b/src/Analyser/ExprHandler/CloneHandler.php index 91ba570b22c..c5c0a7fcfbd 100644 --- a/src/Analyser/ExprHandler/CloneHandler.php +++ b/src/Analyser/ExprHandler/CloneHandler.php @@ -64,6 +64,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => self::resolveCloneType($nativeTypesPromoted ? $exprResult->getNativeType() : $exprResult->getType()), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/ClosureHandler.php b/src/Analyser/ExprHandler/ClosureHandler.php index 549e5325f64..b68cdfe426f 100644 --- a/src/Analyser/ExprHandler/ClosureHandler.php +++ b/src/Analyser/ExprHandler/ClosureHandler.php @@ -93,7 +93,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex type: $type, nativeType: $nativeType, typeCallback: null, - dependencies: Dependencies::merge($processClosureResult->getDependencies(), Dependencies::create($scope->getFile(), DependencyTypes::ofClosureType($type))), + dependencies: Dependencies::merge($processClosureResult->getDependencies(), Dependencies::create($scope->getFile(), DependencyTypes::ofClosureType($type), [], [], [], [])), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + argsResult: null, ); } @@ -105,7 +111,7 @@ public static function getVariableFlow(Closure $expr): ?VariableFlow continue; } - $uses[] = $use->byRef ? VariableFlow::escape($use->var->name) : VariableFlow::read($use->var->name); + $uses[] = $use->byRef ? VariableFlow::escape($use->var->name) : VariableFlow::read($use->var->name, null, false, null); } return VariableFlow::sequence(...$uses); } diff --git a/src/Analyser/ExprHandler/CoalesceHandler.php b/src/Analyser/ExprHandler/CoalesceHandler.php index af404f8c4c5..b900514c3ba 100644 --- a/src/Analyser/ExprHandler/CoalesceHandler.php +++ b/src/Analyser/ExprHandler/CoalesceHandler.php @@ -67,14 +67,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex // the falsey narrowing of this very node - asking the scope about it // mid-processing would take the on-demand path and recurse $rightSideSpecifiedTypes = $this->coalesceCompositionHelper->getFalseySpecifiedTypes($scope, $scope, $expr->left, $condResult, $expr, TypeSpecifierContext::createFalsey()); - $leftSurelySetNonNull = $condResult->getIssetabilityResolution($scope, false)->isSet(static function (Type $type): ?bool { + $leftSurelySetNonNull = $condResult->getIssetabilityResolution($scope, false, false)->isSet(static function (Type $type): ?bool { $isNull = $type->isNull(); if ($isNull->maybe()) { return null; } return !$isNull->yes(); - }) === true; + }, null) === true; if (!$leftSurelySetNonNull) { // the right side only evaluates when the left side is null or unset - // the falsey isset() narrowing of the left side, like `??=`; skipped @@ -184,6 +184,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex return $this->defaultNarrowingHelper->createSubjectTypes($s, $expr, null, $type, $context); }, dependencies: Dependencies::merge($condResult->getDependencies(), $rightResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/ConstFetchHandler.php b/src/Analyser/ExprHandler/ConstFetchHandler.php index b34050343eb..04ad6ab656a 100644 --- a/src/Analyser/ExprHandler/ConstFetchHandler.php +++ b/src/Analyser/ExprHandler/ConstFetchHandler.php @@ -58,7 +58,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex !in_array($expr->name->toLowerString(), ['true', 'false', 'null'], true) && $this->reflectionProvider->hasConstant($expr->name, $scope) ) { - $dependencies = Dependencies::create($scope->getFile(), reflections: [$this->reflectionProvider->getConstant($expr->name, $scope)]); + $dependencies = Dependencies::create($scope->getFile(), reflections: [$this->reflectionProvider->getConstant($expr->name, $scope)], types: [], classNames: [], filePaths: [], usedTraits: []); } return $this->expressionResultFactory->create( @@ -108,6 +108,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $dependencies, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, ); } diff --git a/src/Analyser/ExprHandler/EmptyHandler.php b/src/Analyser/ExprHandler/EmptyHandler.php index 05e4fa75fd6..98883611611 100644 --- a/src/Analyser/ExprHandler/EmptyHandler.php +++ b/src/Analyser/ExprHandler/EmptyHandler.php @@ -75,7 +75,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex throwPoints: $exprResult->getThrowPoints(), impurePoints: $exprResult->getImpurePoints(), typeCallback: static function (bool $nativeTypesPromoted) use ($exprResult, $beforeScope): Type { - $result = $exprResult->getIssetabilityResolution($nativeTypesPromoted ? $beforeScope->doNotTreatPhpDocTypesAsCertain() : $beforeScope, false)->notEmpty(); + $result = $exprResult->getIssetabilityResolution($nativeTypesPromoted ? $beforeScope->doNotTreatPhpDocTypesAsCertain() : $beforeScope, false, false)->notEmpty(); if ($result === null) { return new BooleanType(); } @@ -84,7 +84,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }, specifyTypesCallback: function (TypeSpecifierContext $context, bool $nativeTypesPromoted) use ($expr, $exprResult, $chainResults, $nodeScopeResolver, $beforeScope, &$foldScopes): SpecifiedTypes { $s = $nativeTypesPromoted ? $beforeScope->doNotTreatPhpDocTypesAsCertain() : $beforeScope; - $isset = $exprResult->getIssetabilityResolution($s, false)->isSet(static fn (): bool => true); + $isset = $exprResult->getIssetabilityResolution($s, false, false)->isSet(static fn (): bool => true, null); if ($isset === false) { return new SpecifiedTypes(); } @@ -110,14 +110,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }; $leftType = static function (bool $nativeTypesPromoted) use ($exprResult, $beforeScope): Type { $issetabilityScope = $nativeTypesPromoted ? $beforeScope->doNotTreatPhpDocTypesAsCertain() : $beforeScope; - $result = $exprResult->getIssetabilityResolution($issetabilityScope, false)->isSet(static function (Type $type): ?bool { + $result = $exprResult->getIssetabilityResolution($issetabilityScope, false, false)->isSet(static function (Type $type): ?bool { $isNull = $type->isNull(); if ($isNull->maybe()) { return null; } return !$isNull->yes(); - }); + }, null); if ($result === null) { return new BooleanType(); } @@ -173,6 +173,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex )->setRootExpr($expr); }, dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/ErrorSuppressHandler.php b/src/Analyser/ExprHandler/ErrorSuppressHandler.php index b17e4318437..b65bef6e6f3 100644 --- a/src/Analyser/ExprHandler/ErrorSuppressHandler.php +++ b/src/Analyser/ExprHandler/ErrorSuppressHandler.php @@ -54,6 +54,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => ($nativeTypesPromoted ? $exprResult->getNativeType() : $exprResult->getType()), specifyTypesCallback: static fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $exprResult->getSpecifiedTypes($context, $nativeTypesPromoted)->setRootExpr($expr), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/EvalHandler.php b/src/Analyser/ExprHandler/EvalHandler.php index cbbae6208df..50f32e105fe 100644 --- a/src/Analyser/ExprHandler/EvalHandler.php +++ b/src/Analyser/ExprHandler/EvalHandler.php @@ -50,13 +50,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex // the evaluated code may read any variable $scope = $exprResult->getScope()->invalidateVolatileExpressions(); - $throwPoint = InternalThrowPoint::createImplicit($scope, $expr); + $throwPoint = InternalThrowPoint::createImplicit($scope, $expr, null); return $this->expressionResultFactory->create( $scope, beforeScope: $beforeScope, expr: $expr, - variableFlow: VariableFlow::sequence($exprResult->getVariableFlow(), VariableFlow::all(VariableFlow::READ_ALL), VariableFlow::throwing($throwPoint->getType(), true)), + variableFlow: VariableFlow::sequence($exprResult->getVariableFlow(), VariableFlow::all(VariableFlow::READ_ALL), VariableFlow::throwing($throwPoint->getType(), true, false)), hasYield: $exprResult->hasYield(), isAlwaysTerminating: $exprResult->isAlwaysTerminating(), throwPoints: array_merge($exprResult->getThrowPoints(), [$throwPoint]), @@ -64,6 +64,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => new MixedType(), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/ExitHandler.php b/src/Analyser/ExprHandler/ExitHandler.php index 2fc7113872b..757f81b6298 100644 --- a/src/Analyser/ExprHandler/ExitHandler.php +++ b/src/Analyser/ExprHandler/ExitHandler.php @@ -69,7 +69,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $scope, beforeScope: $beforeScope, expr: $expr, - variableFlow: VariableFlow::sequence($variableFlow, VariableFlow::exit(VariableFlow::STOP)), + variableFlow: VariableFlow::sequence($variableFlow, VariableFlow::exit(VariableFlow::STOP, 1, null)), hasYield: $hasYield, isAlwaysTerminating: true, throwPoints: $throwPoints, @@ -77,6 +77,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => new NonAcceptingNeverType(), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $dependencies, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/FuncCallHandler.php b/src/Analyser/ExprHandler/FuncCallHandler.php index 4ff33f80889..dc2a6e0a731 100644 --- a/src/Analyser/ExprHandler/FuncCallHandler.php +++ b/src/Analyser/ExprHandler/FuncCallHandler.php @@ -166,7 +166,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex // their turn. The closure is then walked on the post-argument scope. $shallowVariants = $this->closureTypeResolver->getDeclaredClosureType($scope, $expr->name)->getCallableParametersAcceptors($scope); $shallowAcceptor = ParametersAcceptorSelector::combineVariantsForNormalization($expr->getArgs(), $shallowVariants, null); - $argumentsWalkedAhead = $this->argumentsHandler->processArgs($nodeScopeResolver, $stmt, null, null, $shallowVariants, null, ArgumentsNormalizer::reorderFuncArguments($shallowAcceptor, $expr) ?? $expr, $scope, $storage, $nodeCallback, $context); + $argumentsWalkedAhead = $this->argumentsHandler->processArgs($nodeScopeResolver, $stmt, null, null, $shallowVariants, null, ArgumentsNormalizer::reorderFuncArguments($shallowAcceptor, $expr) ?? $expr, $scope, $storage, $nodeCallback, $context, null); $scope = $argumentsWalkedAhead->getScope(); } if ($expr->name instanceof Expr) { @@ -194,7 +194,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex ) { // processed later } elseif ($parametersAcceptor instanceof CallableParametersAcceptor) { - $callableThrowPoints = array_map(static fn (SimpleThrowPoint $throwPoint) => $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($scope, $throwPoint->getType(), $expr, $throwPoint->canContainAnyThrowable()) : InternalThrowPoint::createImplicit($scope, $expr), $parametersAcceptor->getThrowPoints()); + $callableThrowPoints = array_map(static fn (SimpleThrowPoint $throwPoint) => $throwPoint->isExplicit() ? InternalThrowPoint::createExplicit($scope, $throwPoint->getType(), $expr, $throwPoint->canContainAnyThrowable()) : InternalThrowPoint::createImplicit($scope, $expr, null), $parametersAcceptor->getThrowPoints()); if (!$this->implicitThrows) { $callableThrowPoints = array_values(array_filter($callableThrowPoints, static fn (InternalThrowPoint $throwPoint) => $throwPoint->isExplicit())); } @@ -266,6 +266,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex new PropertyFetch($cloneExpr, (string) $clonePropertyKeyTypeScalars[0], $propertyAttributes), new TypeExpr($clonePropertiesArgTypeConstantArray->getValueTypes()[$i]), $nodeCallback, + null, ); continue; } @@ -278,6 +279,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex new PropertyFetch($cloneExpr, new TypeExpr($clonePropertyKeyType), $propertyAttributes), new TypeExpr($clonePropertiesArgTypeConstantArray->getValueTypes()[$i]), $nodeCallback, + null, ); } } @@ -356,7 +358,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex // the arguments are processed; the call resolves from the walked // closure's acceptor, which is the sole variant of its type ? $argumentsWalkedAhead->withResolvedParametersAcceptor($parametersAcceptor) - : $this->argumentsHandler->processArgs($nodeScopeResolver, $stmt, $functionReflection, null, $variants, $namedArgumentsVariants, $normalizedExpr, $scope, $storage, $nodeCallback, $context); + : $this->argumentsHandler->processArgs($nodeScopeResolver, $stmt, $functionReflection, null, $variants, $namedArgumentsVariants, $normalizedExpr, $scope, $storage, $nodeCallback, $context, null); } finally { if ($argsGatherer !== null) { $nodeScopeResolver->popNodeGatherer(); @@ -480,7 +482,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $argType = $argsResult->requireArgResult($argExpr)->getTypeOnScope($s, $s->nativeTypesPromoted); if ($argType->isArray()->yes() && ($bothDirections || $createContext->falsey())) { $types = $types->unionWith( - $this->defaultNarrowingHelper->createForSubject($argExpr, new NonEmptyArrayType(), $createContext->negate(), $s), + $this->defaultNarrowingHelper->createForSubject($argExpr, new NonEmptyArrayType(), $createContext->negate(), $s, null), ); } } @@ -510,6 +512,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex specifyTypesCallback: $specifyTypesCallback, createTypesCallback: $createTypesCallback, argsResult: $argsResult, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + variableFlow: null, + dependencies: null, ); $nodeScopeResolver->storeExpressionResult($storage, $expr, $preliminaryResult); @@ -563,7 +573,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $throwPoints[] = $functionThrowPoint; } } else { - $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr); + $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr, null); } $byRefWrittenNames = []; @@ -589,7 +599,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex self::getCallVariableFlow($functionReflection !== null ? $functionReflection->getName() : null, $normalizedExpr, $argsResult, $scope), VariableFlowBuilder::throws($expr, $throwPoints), $byRefFlow, - $isAlwaysTerminating ? VariableFlow::exit(VariableFlow::STOP) : null, + $isAlwaysTerminating ? VariableFlow::exit(VariableFlow::STOP, 1, null) : null, ); $dependencies = Dependencies::merge( @@ -789,7 +799,7 @@ private function getFunctionThrowPoint( || count($normalizedFuncCall->getArgs()) > 0 ) { if (!$context->isInThrow() || !(new ObjectType(Throwable::class))->isSuperTypeOf($returnType)->yes()) { - return InternalThrowPoint::createImplicit($scope, $normalizedFuncCall); + return InternalThrowPoint::createImplicit($scope, $normalizedFuncCall, null); } } } @@ -877,7 +887,7 @@ private function resolveReturnType(NodeScopeResolver $nodeScopeResolver, Mutatin } } - return TemplateArgumentFrame::returnTypeOfCall($parametersAcceptor, $reflectionScope, $expr); + return TemplateArgumentFrame::returnTypeOfCall($parametersAcceptor, $reflectionScope, $expr, null); } if (!$this->reflectionProvider->hasFunction($expr->name, $reflectionScope)) { @@ -949,7 +959,7 @@ private function resolveReturnType(NodeScopeResolver $nodeScopeResolver, Mutatin // the typeCallback keeps void; ExpressionResult projects void->null for // value reads, getKeepVoidType() keeps it - return TemplateArgumentFrame::returnTypeOfCall($parametersAcceptor, $reflectionScope, $expr); + return TemplateArgumentFrame::returnTypeOfCall($parametersAcceptor, $reflectionScope, $expr, null); } /** @@ -1040,7 +1050,7 @@ private function getDependencies(MutatingScope $scope, ?FunctionReflection $func } } - return Dependencies::create($scope->getFile(), $types, reflections: $reflections); + return Dependencies::create($scope->getFile(), $types, reflections: $reflections, classNames: [], filePaths: [], usedTraits: []); } /** @@ -1055,7 +1065,7 @@ private function getDependencies(MutatingScope $scope, ?FunctionReflection $func * * @param FuncCall $expr */ - private function specifyTypes(MutatingScope $scope, Expr $expr, FuncCall $normalizedExpr, ?ExpressionResult $nameResult, ?ParametersAcceptor $resolvedParametersAcceptor, TypeSpecifierContext $context, ?ArgsResult $argsResult = null): SpecifiedTypes + private function specifyTypes(MutatingScope $scope, Expr $expr, FuncCall $normalizedExpr, ?ExpressionResult $nameResult, ?ParametersAcceptor $resolvedParametersAcceptor, TypeSpecifierContext $context, ?ArgsResult $argsResult): SpecifiedTypes { if ($expr->name instanceof Name) { if ($this->reflectionProvider->hasFunction($expr->name, $scope)) { @@ -1270,7 +1280,7 @@ private static function getCallVariableFlow(?string $functionName, Expr\FuncCall return VariableFlow::all(VariableFlow::READ_ALL); } foreach ($names as $name) { - $reads[] = VariableFlow::read($name); + $reads[] = VariableFlow::read($name, null, false, null); } } return VariableFlow::sequence(...$reads); diff --git a/src/Analyser/ExprHandler/Helper/ClosureParameterResolver.php b/src/Analyser/ExprHandler/Helper/ClosureParameterResolver.php index 67db5e96beb..d87f334bb67 100644 --- a/src/Analyser/ExprHandler/Helper/ClosureParameterResolver.php +++ b/src/Analyser/ExprHandler/Helper/ClosureParameterResolver.php @@ -69,7 +69,7 @@ public function resolve( public function resolveCallableTypeForScope(Expr $expr, MutatingScope $scope): Type { if ($expr instanceof Expr\Closure || $expr instanceof Expr\ArrowFunction) { - return $this->closureTypeResolver->getClosureType($scope, $expr, false, $scope->getCurrentExpressionResultStorage()); + return $this->closureTypeResolver->getClosureType($scope, $expr, false, $scope->getCurrentExpressionResultStorage(), null); } return $this->nodeScopeResolver->readTypeOfMaybeStored($expr, $scope); diff --git a/src/Analyser/ExprHandler/Helper/ClosureTypeResolver.php b/src/Analyser/ExprHandler/Helper/ClosureTypeResolver.php index 2a519ebcdea..e6de228ab2d 100644 --- a/src/Analyser/ExprHandler/Helper/ClosureTypeResolver.php +++ b/src/Analyser/ExprHandler/Helper/ClosureTypeResolver.php @@ -127,12 +127,12 @@ private function findCachedTypes(Node\Expr\Closure|ArrowFunction $expr): array public function getClosureType( MutatingScope $scope, Node\Expr\Closure|ArrowFunction $expr, - bool $shallow = false, - ?ExpressionResultStorage $storage = null, - ?Type $passedToType = null, + bool $shallow, + ?ExpressionResultStorage $storage, + ?Type $passedToType, ): ClosureType { - [$parameters, $isVariadic, $callableParameters, $nativeCallableParameters, $contextFree] = $this->buildParametersAndAcceptors($scope, $expr, $storage, $passedToType); + [$parameters, $isVariadic, $callableParameters, $nativeCallableParameters, $contextFree] = $this->buildParametersAndAcceptors($scope, $expr, $storage, $passedToType, null); // A shallow reflection is the closure/arrow function's signature without // walking its body: parameters plus the DECLARED return type. Used at scope @@ -165,7 +165,7 @@ public function getClosureType( } if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('closureTypeBodyWalks'); + TemplateArgumentStats::increment('closureTypeBodyWalks', 1); } if ($expr instanceof ArrowFunction) { $arrowScope = $scope->enterArrowFunctionWithoutReflection($expr, $callableParameters, $nativeCallableParameters); @@ -204,7 +204,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu ); $invalidateExpressions[] = new InvalidateExprNode($node->getPropertyFetch()); }, - ExpressionContext::createDeep(), + ExpressionContext::createDeep(true), ); } finally { $arrowScope->popExpressionResultStorage(); @@ -317,10 +317,10 @@ public function buildClosureTypeForClosure( array $throwPoints, array $impurePoints, array $invalidateExpressions, - bool $native = false, - ?ExpressionResultStorage $storage = null, - ?Type $passedToType = null, - ?Type $nativePassedToType = null, + bool $native, + ?ExpressionResultStorage $storage, + ?Type $passedToType, + ?Type $nativePassedToType, ): ClosureType { [$parameters, $isVariadic, $callableParameters, $nativeCallableParameters, $contextFree] = $this->buildParametersAndAcceptors($scope, $expr, $storage, $passedToType, $nativePassedToType); @@ -368,10 +368,10 @@ public function buildClosureTypeForArrowFunction( array $throwPoints, array $impurePoints, array $invalidateExpressions, - bool $native = false, - ?ExpressionResultStorage $storage = null, - ?Type $passedToType = null, - ?Type $nativePassedToType = null, + bool $native, + ?ExpressionResultStorage $storage, + ?Type $passedToType, + ?Type $nativePassedToType, ): ClosureType { [$parameters, $isVariadic, $callableParameters, $nativeCallableParameters, $contextFree] = $this->buildParametersAndAcceptors($scope, $expr, $storage, $passedToType, $nativePassedToType); @@ -513,10 +513,10 @@ private function buildClosureTypeFromClosureWalk( array $throwPoints, array $impurePoints, array $invalidateExpressions, - ?string $cacheKey = null, - bool $native = false, - ?ExpressionResultStorage $storage = null, - bool $contextFree = false, + ?string $cacheKey, + bool $native, + ?ExpressionResultStorage $storage, + bool $contextFree, ): ClosureType { $onlyNeverExecutionEnds = $this->deriveOnlyNeverExecutionEnds($executionEnds); @@ -628,8 +628,8 @@ private function resolveArrowFunctionReturnType( MutatingScope $scope, MutatingScope $arrowScope, ArrowFunction $expr, - bool $native = false, - ?ExpressionResultStorage $storage = null, + bool $native, + ?ExpressionResultStorage $storage, ): Type { // Unlike a closure (whose native type equals its phpdoc type), an arrow @@ -804,9 +804,9 @@ public function getDeclaredClosureType(MutatingScope $scope, Node\Expr\Closure|A private function buildParametersAndAcceptors( MutatingScope $scope, Node\Expr\Closure|ArrowFunction $expr, - ?ExpressionResultStorage $storage = null, - ?Type $passedToType = null, - ?Type $nativePassedToType = null, + ?ExpressionResultStorage $storage, + ?Type $passedToType, + ?Type $nativePassedToType, ): array { [$parameters, $isVariadic] = $this->buildDeclaredParameters($scope, $expr); @@ -890,8 +890,8 @@ private function assembleClosureType( array $impurePoints, array $invalidateExpressions, array $usedVariables, - ?string $cacheKey = null, - bool $contextFree = false, + ?string $cacheKey, + bool $contextFree, ): ClosureType { foreach ($parameters as $parameter) { diff --git a/src/Analyser/ExprHandler/Helper/CoalesceCompositionHelper.php b/src/Analyser/ExprHandler/Helper/CoalesceCompositionHelper.php index fc86b53d08a..a72e119c5a0 100644 --- a/src/Analyser/ExprHandler/Helper/CoalesceCompositionHelper.php +++ b/src/Analyser/ExprHandler/Helper/CoalesceCompositionHelper.php @@ -41,7 +41,7 @@ public function __construct( */ public function getFalseySpecifiedTypes(MutatingScope $s, MutatingScope $evaluationScope, Expr $leftExpr, ExpressionResult $leftResult, Expr $rootExpr, TypeSpecifierContext $context): SpecifiedTypes { - $isset = $leftResult->getIssetabilityResolution($evaluationScope, false)->isSet(static fn (): bool => true); + $isset = $leftResult->getIssetabilityResolution($evaluationScope, false, false)->isSet(static fn (): bool => true, null); if ($isset !== true) { return new SpecifiedTypes(); @@ -95,14 +95,14 @@ public function composeType( if ($nativeTypesPromoted) { $evaluationScope = $evaluationScope->doNotTreatPhpDocTypesAsCertain(); } - $result = $leftResult->getIssetabilityResolution($evaluationScope, $nativeTypesPromoted)->isSet(static function (Type $type): ?bool { + $result = $leftResult->getIssetabilityResolution($evaluationScope, $nativeTypesPromoted, false)->isSet(static function (Type $type): ?bool { $isNull = $type->isNull(); if ($isNull->maybe()) { return null; } return !$isNull->yes(); - }); + }, null); // the left side's type when it is set: the left read on the left-is-set // narrowed scope (offsets resolve against the HasOffset-narrowed parent). diff --git a/src/Analyser/ExprHandler/Helper/ConditionalExpressionHolderHelper.php b/src/Analyser/ExprHandler/Helper/ConditionalExpressionHolderHelper.php index 90c8b2b5860..920b664b9fe 100644 --- a/src/Analyser/ExprHandler/Helper/ConditionalExpressionHolderHelper.php +++ b/src/Analyser/ExprHandler/Helper/ConditionalExpressionHolderHelper.php @@ -135,7 +135,7 @@ public function buildBranchUnionAugment( * holder targets were tracked on; their types are pinned from it at compose * time (null = read every target from the applying scope) */ - public function buildConditionalHolderRecipe(MutatingScope $composeScope, SpecifiedTypes $conditionSpecifiedTypes, SpecifiedTypes $holderSpecifiedTypes, bool $holdersFromSureTypes, bool $holderSideIsNegated, ?MutatingScope $nonVariableTargetScope, ?Expr $holderSideExpr = null): ?ConditionalExpressionHolderRecipe + public function buildConditionalHolderRecipe(MutatingScope $composeScope, SpecifiedTypes $conditionSpecifiedTypes, SpecifiedTypes $holderSpecifiedTypes, bool $holdersFromSureTypes, bool $holderSideIsNegated, ?MutatingScope $nonVariableTargetScope, ?Expr $holderSideExpr): ?ConditionalExpressionHolderRecipe { // an alternative-form entry (a cross-kind either-branch merge) has no // single condition type; dropping it from the condition set would let diff --git a/src/Analyser/ExprHandler/Helper/CountNarrowingHelper.php b/src/Analyser/ExprHandler/Helper/CountNarrowingHelper.php index c97ee405811..9c35526be2d 100644 --- a/src/Analyser/ExprHandler/Helper/CountNarrowingHelper.php +++ b/src/Analyser/ExprHandler/Helper/CountNarrowingHelper.php @@ -119,6 +119,7 @@ public function specifyCountSize( TypeCombinator::union(...$keptTypes), $context->negate(), $scope, + null, )->setRootExpr($rootExpr); } } @@ -184,7 +185,7 @@ public function specifyCountSize( } } - return $this->defaultNarrowingHelper->createForSubject($countFuncCall->getArgs()[0]->value, TypeCombinator::union(...$resultTypes), $context, $scope)->setRootExpr($rootExpr); + return $this->defaultNarrowingHelper->createForSubject($countFuncCall->getArgs()[0]->value, TypeCombinator::union(...$resultTypes), $context, $scope, null)->setRootExpr($rootExpr); } } diff --git a/src/Analyser/ExprHandler/Helper/DefaultNarrowingHelper.php b/src/Analyser/ExprHandler/Helper/DefaultNarrowingHelper.php index a0de3ba5e22..8b291095523 100644 --- a/src/Analyser/ExprHandler/Helper/DefaultNarrowingHelper.php +++ b/src/Analyser/ExprHandler/Helper/DefaultNarrowingHelper.php @@ -448,7 +448,7 @@ private function createFirstNullsafeReceiverTypes(MutatingScope $s, Expr $expr): * * @param (Closure(Expr): ?ExpressionResult)|null $resultFor */ - public function createForSubject(Expr $subject, Type $type, TypeSpecifierContext $context, Scope $scope, ?Closure $resultFor = null): SpecifiedTypes + public function createForSubject(Expr $subject, Type $type, TypeSpecifierContext $context, Scope $scope, ?Closure $resultFor): SpecifiedTypes { $walkScope = $scope->toWalkScope(); $subjectResult = $resultFor !== null ? $resultFor($subject) : null; @@ -563,6 +563,7 @@ public function createIssetTruthyChainTypes(MutatingScope $s, Expr $issetExpr, C new HasOffsetType($dimType), $context, $s, + null, )->setRootExpr($rootExpr), ); } else { @@ -576,6 +577,7 @@ public function createIssetTruthyChainTypes(MutatingScope $s, Expr $issetExpr, C $narrowedKey, $context, $s, + null, )->setRootExpr($rootExpr), ); } @@ -587,6 +589,7 @@ public function createIssetTruthyChainTypes(MutatingScope $s, Expr $issetExpr, C new NonEmptyArrayType(), $context, $s, + null, )->setRootExpr($rootExpr), ); } @@ -601,7 +604,7 @@ public function createIssetTruthyChainTypes(MutatingScope $s, Expr $issetExpr, C $this->createForSubject($var->var, new IntersectionType([ new ObjectWithoutClassType(), new HasPropertyType($var->name->toString()), - ]), TypeSpecifierContext::createTruthy(), $s)->setRootExpr($rootExpr), + ]), TypeSpecifierContext::createTruthy(), $s, null)->setRootExpr($rootExpr), ); } elseif ( $var instanceof StaticPropertyFetch @@ -612,12 +615,12 @@ public function createIssetTruthyChainTypes(MutatingScope $s, Expr $issetExpr, C $this->createForSubject($var->class, new IntersectionType([ new ObjectWithoutClassType(), new HasPropertyType($var->name->toString()), - ]), TypeSpecifierContext::createTruthy(), $s)->setRootExpr($rootExpr), + ]), TypeSpecifierContext::createTruthy(), $s, null)->setRootExpr($rootExpr), ); } $types = $types->unionWith( - $this->createForSubject($var, new NullType(), TypeSpecifierContext::createFalse(), $s)->setRootExpr($rootExpr), + $this->createForSubject($var, new NullType(), TypeSpecifierContext::createFalse(), $s, null)->setRootExpr($rootExpr), ); } @@ -639,7 +642,7 @@ public function createIssetSingleSubjectNonTrueTypes( Expr $rootExpr, ): SpecifiedTypes { - $isset = $varResult->getIssetabilityResolution($s, false)->isSet(static fn (): bool => true); + $isset = $varResult->getIssetabilityResolution($s, false, false)->isSet(static fn (): bool => true, null); if ($isset === false) { return new SpecifiedTypes(); @@ -652,6 +655,7 @@ public function createIssetSingleSubjectNonTrueTypes( new NullType(), $context->negate(), $s, + null, )->setRootExpr($rootExpr); if ($issetExpr instanceof Expr\Variable && is_string($issetExpr->name)) { @@ -666,6 +670,7 @@ public function createIssetSingleSubjectNonTrueTypes( new NullType(), $context, $s, + null, ))->setRootExpr($rootExpr); } @@ -676,6 +681,7 @@ public function createIssetSingleSubjectNonTrueTypes( new NullType(), $context->negate(), $s, + null, ))->setRootExpr($rootExpr); } @@ -685,6 +691,7 @@ public function createIssetSingleSubjectNonTrueTypes( new NullType(), $context, $s, + null, )->setRootExpr($rootExpr); } @@ -698,7 +705,7 @@ public function createIssetSingleSubjectNonTrueTypes( // the !isset() branch any read that completes yields null - the null pin // is sound for both. if ($isset === null && $isNullable) { - $resolution = $varResult->getIssetabilityResolution($s, false); + $resolution = $varResult->getIssetabilityResolution($s, false, false); $link = $resolution->getLink(); $inner = $resolution->getInner(); if ( @@ -706,7 +713,7 @@ public function createIssetSingleSubjectNonTrueTypes( && $link->isReflectionNative() && $link->hasNativeType() && !$link->isVirtual()->yes() - && ($inner === null || $inner->isSet(static fn (): bool => true) === true) + && ($inner === null || $inner->isSet(static fn (): bool => true, null) === true) ) { return $exprType; } @@ -762,6 +769,7 @@ public function createIssetSingleSubjectNonTrueTypes( $typeToRemove, TypeSpecifierContext::createFalse(), $s, + null, )->setRootExpr($rootExpr); if ($s->hasExpressionType($issetExpr->var)->maybe()) { @@ -771,6 +779,7 @@ public function createIssetSingleSubjectNonTrueTypes( new NullType(), TypeSpecifierContext::createTruthy(), $s, + null, )->setRootExpr($rootExpr), ); } diff --git a/src/Analyser/ExprHandler/Helper/FuncCallScopeEffectsHelper.php b/src/Analyser/ExprHandler/Helper/FuncCallScopeEffectsHelper.php index 5faa2c0a09a..0f6ff56d709 100644 --- a/src/Analyser/ExprHandler/Helper/FuncCallScopeEffectsHelper.php +++ b/src/Analyser/ExprHandler/Helper/FuncCallScopeEffectsHelper.php @@ -89,6 +89,7 @@ public function applyArrayWalkResult(NodeScopeResolver $nodeScopeResolver, Stmt $arrayWalkArrayArg, new NativeTypeExpr($newArrayType, $newArrayNativeType), $nodeCallback, + null, )->getScope(); return $scope; @@ -166,6 +167,7 @@ public function applyCallScopeEffects(NodeScopeResolver $nodeScopeResolver, Stmt $isArrayPop ? $arrayArgNativeType->popArray() : $arrayArgNativeType->shiftArray(), ), $nodeCallback, + null, )->getScope(); } @@ -187,6 +189,7 @@ public function applyCallScopeEffects(NodeScopeResolver $nodeScopeResolver, Stmt $this->getArrayFunctionAppendingType($functionReflection, $scopeBeforeArgs->doNotTreatPhpDocTypesAsCertain(), $normalizedExpr, $argsResult), ), $nodeCallback, + null, )->getScope(); } @@ -211,6 +214,7 @@ public function applyCallScopeEffects(NodeScopeResolver $nodeScopeResolver, Stmt $arrayArg, new NativeTypeExpr($argsResult->requireArgResult($arrayArg)->getTypeOnScope($scope, false)->shuffleArray(), $argsResult->requireArgResult($arrayArg)->getTypeOnScope($scope, true)->shuffleArray()), $nodeCallback, + null, )->getScope(); } @@ -255,6 +259,7 @@ public function applyCallScopeEffects(NodeScopeResolver $nodeScopeResolver, Stmt $arrayArgNativeType->spliceArray($offsetType, $lengthType, $replacementNativeType), ), $nodeCallback, + null, )->getScope(); } @@ -273,6 +278,7 @@ public function applyCallScopeEffects(NodeScopeResolver $nodeScopeResolver, Stmt $arrayArg, new NativeTypeExpr($argsResult->requireArgResult($arrayArg)->getTypeOnScope($scope, false)->shuffleArray(), $argsResult->requireArgResult($arrayArg)->getTypeOnScope($scope, true)->shuffleArray()), $nodeCallback, + null, )->getScope(); } @@ -291,6 +297,7 @@ public function applyCallScopeEffects(NodeScopeResolver $nodeScopeResolver, Stmt $arrayArg, new NativeTypeExpr($argsResult->requireArgResult($arrayArg)->getTypeOnScope($scope, false)->makeListMaybe(), $argsResult->requireArgResult($arrayArg)->getTypeOnScope($scope, true)->makeListMaybe()), $nodeCallback, + null, )->getScope(); } diff --git a/src/Analyser/ExprHandler/Helper/IdenticalNarrowingHelper.php b/src/Analyser/ExprHandler/Helper/IdenticalNarrowingHelper.php index 1c2d71ca200..ddcb18df1ca 100644 --- a/src/Analyser/ExprHandler/Helper/IdenticalNarrowingHelper.php +++ b/src/Analyser/ExprHandler/Helper/IdenticalNarrowingHelper.php @@ -261,6 +261,7 @@ private function specifyAgainstScalarLiteral( new ObjectType($constantStrings[0]->getValue(), classReflection: $this->reflectionProvider->getClass($constantStrings[0]->getValue())->asFinal()), $context, $evaluationScope, + null, )->unionWith($this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $constantType, $context)); } } @@ -413,6 +414,7 @@ private function specifyGeneral( new ObjectType($otherStrings[0]->getValue()), $context, $evaluationScope, + null, )->unionWith($this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $side, $sideResult, $otherStrings[0], $context)); } @@ -421,6 +423,7 @@ private function specifyGeneral( new ObjectType($otherStrings[0]->getValue(), classReflection: $this->reflectionProvider->getClass($otherStrings[0]->getValue())->asFinal()), $context, $evaluationScope, + null, )->unionWith($this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $side, $sideResult, $otherStrings[0], $context)); } } @@ -453,8 +456,8 @@ private function specifyGeneral( && !$rightType->isConstantScalarValue()->yes() && ($leftArgType->isIterableAtLeastOnce()->yes() || $rightArgType->isIterableAtLeastOnce()->yes()) ) { - return $this->defaultNarrowingHelper->createForSubject($unwrappedLeft->getArgs()[0]->value, new NonEmptyArrayType(), $context, $evaluationScope)->unionWith( - $this->defaultNarrowingHelper->createForSubject($unwrappedRight->getArgs()[0]->value, new NonEmptyArrayType(), $context, $evaluationScope), + return $this->defaultNarrowingHelper->createForSubject($unwrappedLeft->getArgs()[0]->value, new NonEmptyArrayType(), $context, $evaluationScope, null)->unionWith( + $this->defaultNarrowingHelper->createForSubject($unwrappedRight->getArgs()[0]->value, new NonEmptyArrayType(), $context, $evaluationScope, null), ); } } @@ -571,7 +574,7 @@ public function specifyEqual( return null; } - $identicalTypeCallback = fn (): Type => $this->richerScopeGetTypeHelper->getIdenticalResult($evaluationScope, new Expr\BinaryOp\Identical($left, $right), $nodeScopeResolver)->type; + $identicalTypeCallback = fn (): Type => $this->richerScopeGetTypeHelper->getIdenticalResult($evaluationScope, new Expr\BinaryOp\Identical($left, $right), $nodeScopeResolver, null, null)->type; $unwrappedLeft = $left instanceof AlwaysRememberedExpr ? $left->getExpr() : $left; $unwrappedRight = $right instanceof AlwaysRememberedExpr ? $right->getExpr() : $right; @@ -705,7 +708,7 @@ public function specifyIdenticalAgainstType( $contextForTypes = $isTrue ? $context->negate() : $context; return $this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $never, $contextForTypes)->unionWith( - $this->defaultNarrowingHelper->createForSubject($constantExpr, $never, $contextForTypes, $evaluationScope), + $this->defaultNarrowingHelper->createForSubject($constantExpr, $never, $contextForTypes, $evaluationScope, null), ); } } @@ -714,7 +717,7 @@ public function specifyIdenticalAgainstType( $subjectType = $subjectResult->getTypeOnScope($evaluationScope, $evaluationScope->nativeTypesPromoted); if (count($subjectType->getFiniteTypes()) === 1) { - $types = $types->unionWith($this->defaultNarrowingHelper->createForSubject($constantExpr, $subjectType, $context, $evaluationScope)); + $types = $types->unionWith($this->defaultNarrowingHelper->createForSubject($constantExpr, $subjectType, $context, $evaluationScope, null)); } return $types; @@ -870,6 +873,7 @@ private function specifyFuncCallFamilies( new IntersectionType([new StringType(), new AccessoryNonEmptyStringType()]), $context->negate(), $evaluationScope, + null, ); } } @@ -899,7 +903,7 @@ private function specifyFuncCallFamilies( $narrowed = TypeCombinator::union($objectType, $classStringType); } - return $this->defaultNarrowingHelper->createForSubject($argExpr, $narrowed, $context, $evaluationScope); + return $this->defaultNarrowingHelper->createForSubject($argExpr, $narrowed, $context, $evaluationScope, null); } } @@ -927,9 +931,9 @@ private function specifyFuncCallFamilies( $types = new SpecifiedTypes(); $funcName = $call->name->toLowerString(); if (in_array($funcName, ['strtolower', 'mb_strtolower'], true)) { - $types = $this->defaultNarrowingHelper->createForSubject($constantExpr, TypeCombinator::intersect($constantType, new AccessoryLowercaseStringType()), $context, $evaluationScope); + $types = $this->defaultNarrowingHelper->createForSubject($constantExpr, TypeCombinator::intersect($constantType, new AccessoryLowercaseStringType()), $context, $evaluationScope, null); } elseif (in_array($funcName, ['strtoupper', 'mb_strtoupper'], true)) { - $types = $this->defaultNarrowingHelper->createForSubject($constantExpr, TypeCombinator::intersect($constantType, new AccessoryUppercaseStringType()), $context, $evaluationScope); + $types = $this->defaultNarrowingHelper->createForSubject($constantExpr, TypeCombinator::intersect($constantType, new AccessoryUppercaseStringType()), $context, $evaluationScope, null); } $accessory = $constantType->isNonFalsyString()->yes() @@ -941,6 +945,7 @@ private function specifyFuncCallFamilies( TypeCombinator::intersect($argType, $accessory), $context, $evaluationScope, + null, )); } } @@ -960,7 +965,7 @@ private function specifyFuncCallFamilies( $argExpr = $call->getArgs()[0]->value; if (IntegerRangeType::fromInterval(null, -1)->isSuperTypeOf($constantType)->yes()) { - return $this->defaultNarrowingHelper->createForSubject($argExpr, new NeverType(), $context, $evaluationScope); + return $this->defaultNarrowingHelper->createForSubject($argExpr, new NeverType(), $context, $evaluationScope, null); } if ($argResult === null) { @@ -974,7 +979,7 @@ private function specifyFuncCallFamilies( : new ConstantArrayType([], []); return $this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $constantType, $context)->unionWith( - $this->defaultNarrowingHelper->createForSubject($argExpr, $newArgType, $context, $evaluationScope), + $this->defaultNarrowingHelper->createForSubject($argExpr, $newArgType, $context, $evaluationScope, null), ); } @@ -993,7 +998,7 @@ private function specifyFuncCallFamilies( $types = $this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $constantType, $context); if (IntegerRangeType::fromInterval(1, null)->isSuperTypeOf($constantType)->yes()) { return $types->unionWith( - $this->defaultNarrowingHelper->createForSubject($argExpr, new NonEmptyArrayType(), $context, $evaluationScope), + $this->defaultNarrowingHelper->createForSubject($argExpr, new NonEmptyArrayType(), $context, $evaluationScope, null), ); } @@ -1014,12 +1019,12 @@ private function specifyFuncCallFamilies( $argExpr = $call->getArgs()[0]->value; if (IntegerRangeType::fromInterval(null, -1)->isSuperTypeOf($constantType)->yes()) { - return $this->defaultNarrowingHelper->createForSubject($argExpr, new NeverType(), $context, $evaluationScope); + return $this->defaultNarrowingHelper->createForSubject($argExpr, new NeverType(), $context, $evaluationScope, null); } if ((new ConstantIntegerType(0))->isSuperTypeOf($constantType)->yes()) { return $this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $constantType, $context)->unionWith( - $this->defaultNarrowingHelper->createForSubject($argExpr, new ConstantStringType(''), $context, $evaluationScope), + $this->defaultNarrowingHelper->createForSubject($argExpr, new ConstantStringType(''), $context, $evaluationScope, null), ); } @@ -1033,7 +1038,7 @@ private function specifyFuncCallFamilies( : new AccessoryNonEmptyStringType(); return $this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $constantType, $context)->unionWith( - $this->defaultNarrowingHelper->createForSubject($argExpr, $accessory, $context, $evaluationScope), + $this->defaultNarrowingHelper->createForSubject($argExpr, $accessory, $context, $evaluationScope, null), ); } } @@ -1057,7 +1062,7 @@ private function specifyFuncCallFamilies( continue; } $one = $this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $constantString, $context)->unionWith( - $this->defaultNarrowingHelper->createForSubject($call->getArgs()[0]->value, $mapped, $context, $evaluationScope), + $this->defaultNarrowingHelper->createForSubject($call->getArgs()[0]->value, $mapped, $context, $evaluationScope, null), ); $intersectedTypes = $intersectedTypes === null ? $one : $intersectedTypes->intersectWith($one); } @@ -1071,7 +1076,7 @@ private function specifyFuncCallFamilies( $gettypeNarrowedType = $this->getTypeFromGettypeStringValue($constantStrings[0]->getValue()); if ($gettypeNarrowedType !== null) { return $this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $constantType, $context)->unionWith( - $this->defaultNarrowingHelper->createForSubject($call->getArgs()[0]->value, $gettypeNarrowedType, $context, $evaluationScope), + $this->defaultNarrowingHelper->createForSubject($call->getArgs()[0]->value, $gettypeNarrowedType, $context, $evaluationScope, null), ); } // an unknown type-name string only pins the call itself below @@ -1097,6 +1102,7 @@ private function specifyFuncCallFamilies( $narrowedObjectType, $context, $evaluationScope, + null, )->unionWith($this->defaultNarrowingHelper->createSubjectTypes($evaluationScope, $subject, $subjectResult, $constantType, $context)); } } diff --git a/src/Analyser/ExprHandler/Helper/ImplicitToStringCallHelper.php b/src/Analyser/ExprHandler/Helper/ImplicitToStringCallHelper.php index 8ac4b6aa92f..5ce4765c581 100644 --- a/src/Analyser/ExprHandler/Helper/ImplicitToStringCallHelper.php +++ b/src/Analyser/ExprHandler/Helper/ImplicitToStringCallHelper.php @@ -60,6 +60,16 @@ public function processImplicitToStringCall(Expr $expr, MutatingScope $scope, Ex impurePoints: [], typeCallback: static fn () => new MixedType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); } @@ -81,14 +91,14 @@ public function processImplicitToStringCall(Expr $expr, MutatingScope $scope, Ex if ($scope->nativeTypesPromoted) { $toStringReturnType = ParametersAcceptorSelector::combineAcceptors($toStringMethod->getVariants())->getNativeReturnType(); } else { - $toStringReturnType = $this->methodCallReturnTypeHelper->methodCallReturnType($scope, $exprType, '__toString', $toStringCall) ?? new ErrorType(); + $toStringReturnType = $this->methodCallReturnTypeHelper->methodCallReturnType($scope, $exprType, '__toString', $toStringCall, null, null) ?? new ErrorType(); } $throwPoint = $this->methodThrowPointHelper->getThrowPoint( $toStringMethod, $toStringMethod->getOnlyVariant(), $toStringCall, $scope, - ExpressionContext::createDeep(), + ExpressionContext::createDeep(true), $toStringReturnType, ); if ($throwPoint !== null) { @@ -106,6 +116,16 @@ public function processImplicitToStringCall(Expr $expr, MutatingScope $scope, Ex impurePoints: $impurePoints, typeCallback: static fn () => new MixedType(), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); } diff --git a/src/Analyser/ExprHandler/Helper/MethodCallReturnTypeHelper.php b/src/Analyser/ExprHandler/Helper/MethodCallReturnTypeHelper.php index ae14960c6fe..95492464e7c 100644 --- a/src/Analyser/ExprHandler/Helper/MethodCallReturnTypeHelper.php +++ b/src/Analyser/ExprHandler/Helper/MethodCallReturnTypeHelper.php @@ -35,8 +35,8 @@ public function methodCallReturnType( Type $typeWithMethod, string $methodName, MethodCall|Expr\StaticCall $methodCall, - ?ParametersAcceptor $preResolvedAcceptor = null, - ?ArgsResult $argsResult = null, + ?ParametersAcceptor $preResolvedAcceptor, + ?ArgsResult $argsResult, ): ?Type { $typeWithMethod = $scope->filterTypeWithMethod($typeWithMethod, $methodName); @@ -57,7 +57,7 @@ public function methodCallReturnType( $normalizedMethodCall = ArgumentsNormalizer::reorderStaticCallArguments($parametersAcceptor, $methodCall); } if ($normalizedMethodCall === null) { - return TemplateArgumentFrame::returnTypeOfCall($parametersAcceptor, $scope, $methodCall); + return TemplateArgumentFrame::returnTypeOfCall($parametersAcceptor, $scope, $methodCall, null); } // re-expose the already-processed arguments so an extension's @@ -119,7 +119,7 @@ public function methodCallReturnType( $remainingMethod->getVariants(), $remainingMethod->getNamedArgumentsVariants(), ); - $resolvedTypes[] = TemplateArgumentFrame::returnTypeOfCall($remainingParametersAcceptor, $scope, $methodCall); + $resolvedTypes[] = TemplateArgumentFrame::returnTypeOfCall($remainingParametersAcceptor, $scope, $methodCall, null); } } @@ -129,7 +129,7 @@ public function methodCallReturnType( $popPrimedStorage(); } - return TemplateArgumentFrame::returnTypeOfCall($parametersAcceptor, $scope, $methodCall); + return TemplateArgumentFrame::returnTypeOfCall($parametersAcceptor, $scope, $methodCall, null); } } diff --git a/src/Analyser/ExprHandler/Helper/MethodThrowPointHelper.php b/src/Analyser/ExprHandler/Helper/MethodThrowPointHelper.php index 88eed9df7fe..1404f7a63c3 100644 --- a/src/Analyser/ExprHandler/Helper/MethodThrowPointHelper.php +++ b/src/Analyser/ExprHandler/Helper/MethodThrowPointHelper.php @@ -96,7 +96,7 @@ public function getThrowPoint( && in_array($methodReflection->getName(), ['invoke', 'invokeArgs'], true) && in_array($methodReflection->getDeclaringClass()->getName(), [ReflectionMethod::class, ReflectionFunction::class], true) ) { - return InternalThrowPoint::createImplicit($scope, $normalizedMethodCall); + return InternalThrowPoint::createImplicit($scope, $normalizedMethodCall, null); } $throwType = $methodReflection->getThrowType(); @@ -115,7 +115,7 @@ public function getThrowPoint( } } elseif ($this->implicitThrows) { if (!$context->isInThrow() || !(new ObjectType(Throwable::class))->isSuperTypeOf($methodCallReturnType)->yes()) { - return InternalThrowPoint::createImplicit($scope, $normalizedMethodCall); + return InternalThrowPoint::createImplicit($scope, $normalizedMethodCall, null); } } @@ -138,7 +138,7 @@ public function getThrowPointsForCallOnType(MutatingScope $scope, ExpressionCont $methodReflection = $scope->getMethodReflection($calledOnType, $methodCall->name->toString()); if ($methodReflection === null) { - return [InternalThrowPoint::createImplicit($scope, $methodCall)]; + return [InternalThrowPoint::createImplicit($scope, $methodCall, null)]; } $parametersAcceptor = ParametersAcceptorSelector::combineVariantsForNormalization($methodCall->getArgs(), $methodReflection->getVariants(), $methodReflection->getNamedArgumentsVariants()); diff --git a/src/Analyser/ExprHandler/Helper/NonNullabilityHelper.php b/src/Analyser/ExprHandler/Helper/NonNullabilityHelper.php index fcf40407feb..2fc436e3947 100644 --- a/src/Analyser/ExprHandler/Helper/NonNullabilityHelper.php +++ b/src/Analyser/ExprHandler/Helper/NonNullabilityHelper.php @@ -102,7 +102,7 @@ public function getActiveEnsuredOriginalType(Expr $expr, bool $native): ?Type public function ensureShallowNonNullability(MutatingScope $scope, MutatingScope $originalScope, Expr $exprToSpecify): EnsuredNonNullabilityResult { $result = $this->doEnsureShallowNonNullability($scope, $originalScope, $exprToSpecify); - $this->pushActiveEnsure($result); + $this->pushActiveEnsure($result, ['keys' => [], 'classes' => []]); return $result; } @@ -110,7 +110,7 @@ public function ensureShallowNonNullability(MutatingScope $scope, MutatingScope /** * @param array{keys: array, classes: array, true>} $pending */ - private function pushActiveEnsure(EnsuredNonNullabilityResult $result, array $pending = ['keys' => [], 'classes' => []]): void + private function pushActiveEnsure(EnsuredNonNullabilityResult $result, array $pending): void { $originals = []; foreach ($result->getSpecifiedExpressions() as $specifiedExpression) { @@ -333,7 +333,7 @@ public function revertNonNullability(MutatingScope $scope, array $specifiedExpre /** * @param Closure(MutatingScope, Expr): MutatingScope $callback */ - private function lookForExpressionCallback(MutatingScope $scope, Expr $expr, Closure $callback, bool $includeExpr = true): MutatingScope + private function lookForExpressionCallback(MutatingScope $scope, Expr $expr, Closure $callback, bool $includeExpr): MutatingScope { // $includeExpr is false only for the outermost operand: ensuring its chain // links non-null lets it be walked without spurious "possibly null" noise, @@ -355,18 +355,18 @@ private function lookForExpressionCallback(MutatingScope $scope, Expr $expr, Clo } if ($expr instanceof ArrayDimFetch) { - $scope = $this->lookForExpressionCallback($scope, $expr->var, $callback); + $scope = $this->lookForExpressionCallback($scope, $expr->var, $callback, true); } elseif ($expr instanceof PropertyFetch || $expr instanceof Expr\NullsafePropertyFetch) { - $scope = $this->lookForExpressionCallback($scope, $expr->var, $callback); + $scope = $this->lookForExpressionCallback($scope, $expr->var, $callback, true); } elseif ($expr instanceof StaticPropertyFetch && $expr->class instanceof Expr) { - $scope = $this->lookForExpressionCallback($scope, $expr->class, $callback); + $scope = $this->lookForExpressionCallback($scope, $expr->class, $callback, true); } elseif ($expr instanceof List_) { foreach ($expr->items as $item) { if ($item === null) { continue; } - $scope = $this->lookForExpressionCallback($scope, $item->value, $callback); + $scope = $this->lookForExpressionCallback($scope, $item->value, $callback, true); } } diff --git a/src/Analyser/ExprHandler/Helper/VirtualExprResultHelper.php b/src/Analyser/ExprHandler/Helper/VirtualExprResultHelper.php index 4d4a3117594..ac537b630b3 100644 --- a/src/Analyser/ExprHandler/Helper/VirtualExprResultHelper.php +++ b/src/Analyser/ExprHandler/Helper/VirtualExprResultHelper.php @@ -46,6 +46,16 @@ public function createTypeExprResult(MutatingScope $scope, TypeExpr|NativeTypeEx ? static fn (bool $nativeTypesPromoted): Type => $expr->getExprType() : static fn (bool $nativeTypesPromoted): Type => $nativeTypesPromoted ? $expr->getNativeType() : $expr->getPhpDocType(), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); } @@ -61,6 +71,16 @@ public function createUnsetOffsetExprResult(MutatingScope $scope, UnsetOffsetExp impurePoints: [], typeCallback: static fn (bool $nativeTypesPromoted): Type => ($nativeTypesPromoted ? $varResult->getNativeType() : $varResult->getType())->unsetOffset($nativeTypesPromoted ? $dimResult->getNativeType() : $dimResult->getType()), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); } diff --git a/src/Analyser/ExprHandler/IncludeHandler.php b/src/Analyser/ExprHandler/IncludeHandler.php index 91e25982f58..95a391c195b 100644 --- a/src/Analyser/ExprHandler/IncludeHandler.php +++ b/src/Analyser/ExprHandler/IncludeHandler.php @@ -56,7 +56,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex // the included file may read any variable $scope = $exprResult->getScope()->afterExtractCall()->invalidateVolatileExpressions(); - $throwPoint = InternalThrowPoint::createImplicit($scope, $expr); + $throwPoint = InternalThrowPoint::createImplicit($scope, $expr, null); // an included file is a dependency with no symbol to reflect: nothing in it has to be // declared for the analysis to change when it is deleted @@ -75,14 +75,22 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $scope, beforeScope: $beforeScope, expr: $expr, - variableFlow: VariableFlow::sequence($exprResult->getVariableFlow(), VariableFlow::all(VariableFlow::READ_ALL), VariableFlow::throwing($throwPoint->getType(), true)), + variableFlow: VariableFlow::sequence($exprResult->getVariableFlow(), VariableFlow::all(VariableFlow::READ_ALL), VariableFlow::throwing($throwPoint->getType(), true, false)), hasYield: $exprResult->hasYield(), isAlwaysTerminating: $exprResult->isAlwaysTerminating(), throwPoints: array_merge($exprResult->getThrowPoints(), [$throwPoint]), impurePoints: array_merge($exprResult->getImpurePoints(), [new ImpurePoint($scope, $expr, $identifier, $identifier, true)]), typeCallback: static fn (bool $nativeTypesPromoted): Type => new MixedType(), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), - dependencies: Dependencies::merge($exprResult->getDependencies(), Dependencies::create($beforeScope->getFile(), filePaths: $includedFiles)), + dependencies: Dependencies::merge($exprResult->getDependencies(), Dependencies::create($beforeScope->getFile(), filePaths: $includedFiles, types: [], classNames: [], reflections: [], usedTraits: [])), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/InstanceofHandler.php b/src/Analyser/ExprHandler/InstanceofHandler.php index 8ae832fdaab..a93a758baca 100644 --- a/src/Analyser/ExprHandler/InstanceofHandler.php +++ b/src/Analyser/ExprHandler/InstanceofHandler.php @@ -71,7 +71,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $dependencies = Dependencies::merge( $exprResult->getDependencies(), $classResult->getDependencies(), - Dependencies::create($beforeScope->getFile(), classNames: DependencyTypes::classNamesOfClassString($classResult->getType())), + Dependencies::create($beforeScope->getFile(), classNames: DependencyTypes::classNamesOfClassString($classResult->getType()), types: [], reflections: [], filePaths: [], usedTraits: []), ); $scope = $classResult->getScope(); $hasYield = $hasYield || $classResult->hasYield(); @@ -79,7 +79,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $impurePoints = array_merge($impurePoints, $classResult->getImpurePoints()); $isAlwaysTerminating = $isAlwaysTerminating || $classResult->isAlwaysTerminating(); } else { - $dependencies = Dependencies::merge($exprResult->getDependencies(), Dependencies::create($beforeScope->getFile(), classNames: [$beforeScope->resolveName($expr->class)])); + $dependencies = Dependencies::merge($exprResult->getDependencies(), Dependencies::create($beforeScope->getFile(), classNames: [$beforeScope->resolveName($expr->class)], types: [], reflections: [], filePaths: [], usedTraits: [])); } // When the class side is written as a Name (self / static / parent / a @@ -211,6 +211,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex return (new SpecifiedTypes([], []))->setRootExpr($expr); }, dependencies: $dependencies, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/InterpolatedStringHandler.php b/src/Analyser/ExprHandler/InterpolatedStringHandler.php index fb56c7db132..6952eb23ed8 100644 --- a/src/Analyser/ExprHandler/InterpolatedStringHandler.php +++ b/src/Analyser/ExprHandler/InterpolatedStringHandler.php @@ -109,6 +109,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: Dependencies::merge(...$dependencies), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/IssetHandler.php b/src/Analyser/ExprHandler/IssetHandler.php index 122fffaa642..75d371919fe 100644 --- a/src/Analyser/ExprHandler/IssetHandler.php +++ b/src/Analyser/ExprHandler/IssetHandler.php @@ -140,14 +140,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static function (bool $nativeTypesPromoted) use ($varResults, $afterScope): Type { $issetResult = true; foreach ($varResults as $varResult) { - $result = $varResult->getIssetabilityResolution($nativeTypesPromoted ? $afterScope->doNotTreatPhpDocTypesAsCertain() : $afterScope, false)->isSet(static function (Type $type): ?bool { + $result = $varResult->getIssetabilityResolution($nativeTypesPromoted ? $afterScope->doNotTreatPhpDocTypesAsCertain() : $afterScope, false, false)->isSet(static function (Type $type): ?bool { $isNull = $type->isNull(); if ($isNull->maybe()) { return null; } return !$isNull->yes(); - }); + }, null); if ($result !== null) { if (!$result) { return new ConstantBooleanType($result); @@ -263,6 +263,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex return $this->defaultNarrowingHelper->createIssetTruthyChainTypes($evaluationScope, $issetExpr, $readType, $expr, $context); }, dependencies: Dependencies::merge(...array_map(static fn (ExpressionResult $result) => $result->getDependencies(), $varResults)), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/MatchHandler.php b/src/Analyser/ExprHandler/MatchHandler.php index 546a7187a15..ac916446be5 100644 --- a/src/Analyser/ExprHandler/MatchHandler.php +++ b/src/Analyser/ExprHandler/MatchHandler.php @@ -276,7 +276,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $conditionCaseType = new UnionType($conditionCases); } - $filteringExpr = $this->getFilteringExprForMatchArm($expr, $conditionExprs); + $filteringExpr = $this->getFilteringExprForMatchArm($expr, $conditionExprs, []); $condNarrowedScope = $matchScope->addTypeToExpression( $expr->cond, $conditionCaseType, @@ -525,7 +525,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $this->capturedArmResults[spl_object_id($expr)] = [$expr, $armTypeResults]; - $variableFlow = VariableFlow::throwing(new ObjectType(UnhandledMatchError::class), false); + $variableFlow = VariableFlow::throwing(new ObjectType(UnhandledMatchError::class), false, false); foreach ($expr->arms as $i => $arm) { if ($arm->conds !== null) { continue; @@ -570,6 +570,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: Dependencies::merge(...$dependencies), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } @@ -577,7 +585,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex * @param Expr[] $conditions * @param list $condData the conditions' walk results, keyed like $conditions */ - private function getFilteringExprForMatchArm(Match_ $expr, array $conditions, array $condData = []): BinaryOp\Identical|FuncCall + private function getFilteringExprForMatchArm(Match_ $expr, array $conditions, array $condData): BinaryOp\Identical|FuncCall { if (count($conditions) === 1) { return new BinaryOp\Identical($expr->cond, $conditions[0]); diff --git a/src/Analyser/ExprHandler/MethodCallHandler.php b/src/Analyser/ExprHandler/MethodCallHandler.php index 79c730ef67e..a3c479b2e43 100644 --- a/src/Analyser/ExprHandler/MethodCallHandler.php +++ b/src/Analyser/ExprHandler/MethodCallHandler.php @@ -188,6 +188,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $storage, $nodeCallback, $context, + null, ); $resolvedParametersAcceptor = $argsResult->getResolvedParametersAcceptor(); $scope = $argsResult->getScope(); @@ -294,6 +295,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex specifyTypesCallback: $specifyTypesCallback, createTypesCallback: $createTypesCallback, argsResult: $argsResult, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + variableFlow: null, + dependencies: null, ); $nodeScopeResolver->storeExpressionResult($storage, $expr, $preliminaryResult); @@ -340,7 +348,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex } else { $nodeScopeResolver->callNodeCallback($nodeCallback, new InvalidateExprNode($normalizedExpr->var), $scope, $storage); $scope = $scope->invalidateExpression($normalizedExpr->var, true); - $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr); + $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr, null); } if ( $methodReflection === null @@ -361,7 +369,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex // the short-circuited world evaluates none of the arguments $mayShortCircuit ? VariableFlow::choice($argumentsFlow, null) : $argumentsFlow, VariableFlowBuilder::throws($expr, $throwPoints), - $isAlwaysTerminating ? VariableFlow::exit(VariableFlow::STOP) : null, + $isAlwaysTerminating ? VariableFlow::exit(VariableFlow::STOP, 1, null) : null, ); // the call's scope effects (@param-out, @phpstan-self-out, invalidations) @@ -380,6 +388,9 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $beforeScope->getFile(), [$varResult->getType(), $preliminaryResult->getType(), ...($walkMethodReflection !== null ? DependencyTypes::ofCalledMethod($walkMethodReflection, true) : [])], $walkMethodReflection !== null ? [$walkMethodReflection->getDeclaringClass()->getName()] : [], + [], + [], + [], ), ); $result = $preliminaryResult->finalize($scope, $hasYield, $isAlwaysTerminating, $throwPoints, $impurePoints, $variableFlow, $dependencies); @@ -499,7 +510,7 @@ private function resolveReturnType(MutatingScope $reflectionScope, bool $nativeT * @param MethodCall $expr * @param MethodCall $normalizedExpr */ - private function specifyTypes(MutatingScope $scope, Expr $expr, Expr $normalizedExpr, ExpressionResult $varResult, ?ParametersAcceptor $resolvedParametersAcceptor, ?ExtendedMethodReflection $walkMethodReflection, TypeSpecifierContext $context, ?ArgsResult $argsResult = null): SpecifiedTypes + private function specifyTypes(MutatingScope $scope, Expr $expr, Expr $normalizedExpr, ExpressionResult $varResult, ?ParametersAcceptor $resolvedParametersAcceptor, ?ExtendedMethodReflection $walkMethodReflection, TypeSpecifierContext $context, ?ArgsResult $argsResult): SpecifiedTypes { if (!$expr->name instanceof Identifier) { return $this->defaultMethodCallNarrowing($scope, $expr, $varResult, $context); diff --git a/src/Analyser/ExprHandler/NewHandler.php b/src/Analyser/ExprHandler/NewHandler.php index 61244aa9fbe..7b52330d610 100644 --- a/src/Analyser/ExprHandler/NewHandler.php +++ b/src/Analyser/ExprHandler/NewHandler.php @@ -218,7 +218,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $className = $objectClasses[0]; $additionalThrowPoints = $objectExprResult->getThrowPoints(); } else { - $additionalThrowPoints = [InternalThrowPoint::createImplicit($scope, $expr)]; + $additionalThrowPoints = [InternalThrowPoint::createImplicit($scope, $expr, null)]; } $throwPoints = array_merge($throwPoints, $additionalThrowPoints); @@ -244,7 +244,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $variants = $constructorReflection !== null ? $constructorReflection->getVariants() : []; $namedArgumentsVariants = $constructorReflection !== null ? $constructorReflection->getNamedArgumentsVariants() : null; $scopeBeforeArgs = $scope; - $argsResult = $this->argumentsHandler->processArgs($nodeScopeResolver, $stmt, $constructorReflection, null, $variants, $namedArgumentsVariants, $normalizedExpr, $scope, $storage, $nodeCallback, $context); + $argsResult = $this->argumentsHandler->processArgs($nodeScopeResolver, $stmt, $constructorReflection, null, $variants, $namedArgumentsVariants, $normalizedExpr, $scope, $storage, $nodeCallback, $context, null); $resolvedParametersAcceptor = $argsResult->getResolvedParametersAcceptor(); $scope = $argsResult->getScope(); $this->argumentsHandler->processDroppedArgs($nodeScopeResolver, $stmt, $expr, $normalizedExpr, $scope, $storage, $context); @@ -298,6 +298,16 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: [], typeCallback: $typeCallback, specifyTypesCallback: $specifyTypesCallback, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); $nodeScopeResolver->storeExpressionResult($storage, $expr, $preliminaryResult); @@ -308,7 +318,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $throwPoints[] = $constructorThrowPoint; } } elseif ($classReflection === null || ($isDynamic && $constructorReflection === null && !$classReflection->isFinal())) { - $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr); + $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr, null); } $calleeKnown = $classReflection !== null && !($isDynamic && !$classReflection->isFinal()); @@ -323,14 +333,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $classResult !== null ? $classResult->getVariableFlow() : null, VariableFlowBuilder::arguments($expr, $argsResult, $storage), VariableFlowBuilder::throws($expr, $throwPoints), - $isAlwaysTerminating ? VariableFlow::exit(VariableFlow::STOP) : null, + $isAlwaysTerminating ? VariableFlow::exit(VariableFlow::STOP, 1, null) : null, ); // the instantiated class - named, or named by a string the type system resolved if ($expr->class instanceof Name) { - $ownDependencies = Dependencies::create($beforeScope->getFile(), classNames: [$beforeScope->resolveName($expr->class)]); + $ownDependencies = Dependencies::create($beforeScope->getFile(), classNames: [$beforeScope->resolveName($expr->class)], types: [], reflections: [], filePaths: [], usedTraits: []); } elseif ($classResult !== null) { - $ownDependencies = Dependencies::create($beforeScope->getFile(), [$preliminaryResult->getType()], DependencyTypes::classNamesOfClassString($classResult->getType())); + $ownDependencies = Dependencies::create($beforeScope->getFile(), [$preliminaryResult->getType()], DependencyTypes::classNamesOfClassString($classResult->getType()), [], [], []); } else { $ownDependencies = null; } @@ -464,7 +474,7 @@ private function getConstructorThrowPoint(MethodReflection $constructorReflectio } } elseif ($this->implicitThrows) { if (!$context->isInThrow() || !$constructorReflection->getDeclaringClass()->is(Throwable::class)) { - return InternalThrowPoint::createImplicit($scope, $new); + return InternalThrowPoint::createImplicit($scope, $new, null); } } @@ -480,7 +490,7 @@ private function getConstructorThrowPoint(MethodReflection $constructorReflectio * * @param New_ $expr */ - private function resolveReturnType(MutatingScope $scope, Expr $expr, ?ParametersAcceptor $preResolvedAcceptor, ?Type $classExprType, ?ArgsResult $argsResult = null, bool $allowUnresolved = true): Type + private function resolveReturnType(MutatingScope $scope, Expr $expr, ?ParametersAcceptor $preResolvedAcceptor, ?Type $classExprType, ?ArgsResult $argsResult, bool $allowUnresolved): Type { if ($expr->class instanceof Name) { return $this->exactInstantiation($scope, $expr, $expr->class, $preResolvedAcceptor, $argsResult, $allowUnresolved); @@ -502,7 +512,7 @@ private function resolveReturnType(MutatingScope $scope, Expr $expr, ?Parameters /** * @param bool $allowUnresolved false for the native flavour, which never carries UnresolvedTemplateArgumentType */ - private function exactInstantiation(MutatingScope $scope, New_ $node, Name $className, ?ParametersAcceptor $preResolvedAcceptor, ?ArgsResult $argsResult = null, bool $allowUnresolved = true): Type + private function exactInstantiation(MutatingScope $scope, New_ $node, Name $className, ?ParametersAcceptor $preResolvedAcceptor, ?ArgsResult $argsResult, bool $allowUnresolved): Type { $resolvedClassName = $scope->resolveName($className); $isStatic = false; diff --git a/src/Analyser/ExprHandler/NullsafeMethodCallHandler.php b/src/Analyser/ExprHandler/NullsafeMethodCallHandler.php index ebbc5946959..3d8e77004d7 100644 --- a/src/Analyser/ExprHandler/NullsafeMethodCallHandler.php +++ b/src/Analyser/ExprHandler/NullsafeMethodCallHandler.php @@ -226,6 +226,12 @@ static function () use ($beforeScope, $leftTypes, &$leftFalseyScope): MutatingSc ->setRootExpr($expr); }, dependencies: Dependencies::merge($exprResult->getDependencies(), $processedReceiverResult->getDependencies()), + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/NullsafePropertyFetchHandler.php b/src/Analyser/ExprHandler/NullsafePropertyFetchHandler.php index b54f05529d5..b6845cf5ef9 100644 --- a/src/Analyser/ExprHandler/NullsafePropertyFetchHandler.php +++ b/src/Analyser/ExprHandler/NullsafePropertyFetchHandler.php @@ -204,6 +204,12 @@ static function () use ($beforeScope, $leftTypes, &$leftFalseyScope): MutatingSc ->setRootExpr($expr); }, dependencies: Dependencies::merge($exprResult->getDependencies(), $processedReceiverResult->getDependencies()), + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/PipeHandler.php b/src/Analyser/ExprHandler/PipeHandler.php index 69fde471764..9d997cb4ebf 100644 --- a/src/Analyser/ExprHandler/PipeHandler.php +++ b/src/Analyser/ExprHandler/PipeHandler.php @@ -96,6 +96,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: [], typeCallback: static fn (bool $nativeTypesPromoted): Type => ($nativeTypesPromoted ? $callableNodeResult->getNativeType() : $callableNodeResult->getType()), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, )); } @@ -114,6 +123,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => ($nativeTypesPromoted ? $callResult->getNativeType() : $callResult->getType()), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $callResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/PostDecHandler.php b/src/Analyser/ExprHandler/PostDecHandler.php index 5d56dbeabf0..3a7299945ad 100644 --- a/src/Analyser/ExprHandler/PostDecHandler.php +++ b/src/Analyser/ExprHandler/PostDecHandler.php @@ -66,6 +66,16 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: [], typeCallback: $this->incDecTypeHelper->getTypeCallback($expr->var, $varResult, false), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($virtualExpr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); // processVirtualAssign() emits nodes (PropertyAssignNode) carrying the @@ -88,7 +98,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $assignedScope, beforeScope: $scope, expr: $expr, - variableFlow: VariableFlow::sequence($varResult->getVariableFlow(), $valueFlowWrite !== null && $context->isValueConsumed() ? VariableFlow::inputs($valueFlowWrite->getId(), $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null) : null, VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_POST_DEC, $assignedScope, $storage)), + variableFlow: VariableFlow::sequence($varResult->getVariableFlow(), $valueFlowWrite !== null && $context->isValueConsumed() ? VariableFlow::inputs($valueFlowWrite->getId(), $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null) : null, VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_POST_DEC, $assignedScope, $storage, null)), hasYield: $varResult->hasYield(), isAlwaysTerminating: $varResult->isAlwaysTerminating(), throwPoints: $varResult->getThrowPoints(), @@ -97,6 +107,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => ($nativeTypesPromoted ? $varResult->getNativeType() : $varResult->getType()), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $varResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/PostIncHandler.php b/src/Analyser/ExprHandler/PostIncHandler.php index 1451c193ba0..1d0779655f5 100644 --- a/src/Analyser/ExprHandler/PostIncHandler.php +++ b/src/Analyser/ExprHandler/PostIncHandler.php @@ -66,6 +66,16 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: [], typeCallback: $this->incDecTypeHelper->getTypeCallback($expr->var, $varResult, true), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($virtualExpr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); // processVirtualAssign() emits nodes (PropertyAssignNode) carrying the @@ -88,7 +98,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $assignedScope, beforeScope: $scope, expr: $expr, - variableFlow: VariableFlow::sequence($varResult->getVariableFlow(), $valueFlowWrite !== null && $context->isValueConsumed() ? VariableFlow::inputs($valueFlowWrite->getId(), $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null) : null, VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_POST_INC, $assignedScope, $storage)), + variableFlow: VariableFlow::sequence($varResult->getVariableFlow(), $valueFlowWrite !== null && $context->isValueConsumed() ? VariableFlow::inputs($valueFlowWrite->getId(), $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null) : null, VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_POST_INC, $assignedScope, $storage, null)), hasYield: $varResult->hasYield(), isAlwaysTerminating: $varResult->isAlwaysTerminating(), throwPoints: $varResult->getThrowPoints(), @@ -97,6 +107,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => ($nativeTypesPromoted ? $varResult->getNativeType() : $varResult->getType()), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $varResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/PreDecHandler.php b/src/Analyser/ExprHandler/PreDecHandler.php index b7bc7515ffa..a89dce186d2 100644 --- a/src/Analyser/ExprHandler/PreDecHandler.php +++ b/src/Analyser/ExprHandler/PreDecHandler.php @@ -67,6 +67,16 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: $varResult->getImpurePoints(), typeCallback: $typeCallback, specifyTypesCallback: $specifyTypesCallback, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); // processVirtualAssign() emits nodes (PropertyAssignNode) whose rules ask @@ -92,7 +102,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex expr: $expr, variableFlow: VariableFlow::sequence( $varResult->getVariableFlow(), - VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_PRE_DEC, $assignedScope, $storage), + VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_PRE_DEC, $assignedScope, $storage, null), $valueFlowWrite !== null && $context->isValueConsumed() ? VariableFlowBuilder::targetRead($expr->var, $storage, true, $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null) : null, ), hasYield: $varResult->hasYield(), @@ -102,6 +112,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: $typeCallback, specifyTypesCallback: $specifyTypesCallback, dependencies: $varResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/PreIncHandler.php b/src/Analyser/ExprHandler/PreIncHandler.php index 854627dc21c..bd7d736461c 100644 --- a/src/Analyser/ExprHandler/PreIncHandler.php +++ b/src/Analyser/ExprHandler/PreIncHandler.php @@ -67,6 +67,16 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: $varResult->getImpurePoints(), typeCallback: $typeCallback, specifyTypesCallback: $specifyTypesCallback, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); // processVirtualAssign() emits nodes (PropertyAssignNode) whose rules ask @@ -92,7 +102,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex expr: $expr, variableFlow: VariableFlow::sequence( $varResult->getVariableFlow(), - VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_PRE_INC, $assignedScope, $storage), + VariableFlowBuilder::targetWrite($expr->var, VariableWrite::KIND_PRE_INC, $assignedScope, $storage, null), $valueFlowWrite !== null && $context->isValueConsumed() ? VariableFlowBuilder::targetRead($expr->var, $storage, true, $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null) : null, ), hasYield: $varResult->hasYield(), @@ -102,6 +112,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: $typeCallback, specifyTypesCallback: $specifyTypesCallback, dependencies: $varResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/PrintHandler.php b/src/Analyser/ExprHandler/PrintHandler.php index 1abafc147fb..cf704328913 100644 --- a/src/Analyser/ExprHandler/PrintHandler.php +++ b/src/Analyser/ExprHandler/PrintHandler.php @@ -70,6 +70,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => new ConstantIntegerType(1), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/PropertyFetchHandler.php b/src/Analyser/ExprHandler/PropertyFetchHandler.php index 2095791b11c..21c2039265d 100644 --- a/src/Analyser/ExprHandler/PropertyFetchHandler.php +++ b/src/Analyser/ExprHandler/PropertyFetchHandler.php @@ -116,7 +116,7 @@ public function composeResult(NodeScopeResolver $nodeScopeResolver, PropertyFetc $scope = $scope->mergeWith($varResult->getScope()); } if ($this->phpVersion->supportsPropertyHooks()) { - $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr); + $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr, null); } } @@ -194,6 +194,13 @@ public function composeResult(NodeScopeResolver $nodeScopeResolver, PropertyFetc return new MixedType(); }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypesWithNullsafeFan($expr, $context, $beforeScope, $nativeTypesPromoted), + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); return $result->withDependencies(Dependencies::merge( $varResult->getDependencies(), @@ -217,7 +224,7 @@ private function getDependencies(MutatingScope $scope, PropertyFetch $expr, Expr } } - return Dependencies::create($scope->getFile(), [$fetchedOnType, $result->getType()], $classNames); + return Dependencies::create($scope->getFile(), [$fetchedOnType, $result->getType()], $classNames, [], [], []); } private function propertyFetchType(MutatingScope $scope, Type $fetchedOnType, string $propertyName, PropertyFetch $propertyFetch): ?Type diff --git a/src/Analyser/ExprHandler/ScalarHandler.php b/src/Analyser/ExprHandler/ScalarHandler.php index 58c241785e0..71a56ad4c67 100644 --- a/src/Analyser/ExprHandler/ScalarHandler.php +++ b/src/Analyser/ExprHandler/ScalarHandler.php @@ -59,6 +59,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), type: $type, nativeType: $type, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); } diff --git a/src/Analyser/ExprHandler/ShellExecHandler.php b/src/Analyser/ExprHandler/ShellExecHandler.php index ba5bb3a8a33..ef29aa22da0 100644 --- a/src/Analyser/ExprHandler/ShellExecHandler.php +++ b/src/Analyser/ExprHandler/ShellExecHandler.php @@ -91,6 +91,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => TypeCombinator::union(new StringType(), new ConstantBooleanType(false), new NullType()), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: Dependencies::merge(...$dependencies), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/StaticCallHandler.php b/src/Analyser/ExprHandler/StaticCallHandler.php index a90ba1d98b2..aeeaad25147 100644 --- a/src/Analyser/ExprHandler/StaticCallHandler.php +++ b/src/Analyser/ExprHandler/StaticCallHandler.php @@ -204,7 +204,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }; } } else { - $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr); + $throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr, null); } } elseif ($expr->class instanceof Expr) { // the class expr was processed above as the receiver; read its @@ -244,7 +244,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $objectExprResult = $nodeScopeResolver->processExprNode($stmt, new StaticCall(new Name($objectClasses[0]), $expr->name, []), $scope, $storage, new NoopNodeCallback(), $context->enterDeep()->withoutTemplateArgumentResolution()); $additionalThrowPoints = $objectExprResult->getThrowPoints(); } else { - $additionalThrowPoints = [InternalThrowPoint::createImplicit($scope, $expr)]; + $additionalThrowPoints = [InternalThrowPoint::createImplicit($scope, $expr, null)]; } foreach ($additionalThrowPoints as $throwPoint) { $throwPoints[] = $throwPoint; @@ -354,6 +354,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex specifyTypesCallback: $specifyTypesCallback, createTypesCallback: $createTypesCallback, argsResult: $argsResult, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + variableFlow: null, + dependencies: null, ); $nodeScopeResolver->storeExpressionResult($storage, $expr, $preliminaryResult); @@ -430,7 +437,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex // the short-circuited world evaluates none of the arguments $mayShortCircuit ? VariableFlow::choice($argumentsFlow, null) : $argumentsFlow, VariableFlowBuilder::throws($expr, $throwPoints), - $isAlwaysTerminating ? VariableFlow::exit(VariableFlow::STOP) : null, + $isAlwaysTerminating ? VariableFlow::exit(VariableFlow::STOP, 1, null) : null, ); // the call's scope effects (@param-out, invalidations) only happened in the @@ -456,7 +463,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $classResult !== null ? $classResult->getDependencies() : null, $nameResult !== null ? $nameResult->getDependencies() : null, $argsResult->getDependencies(), - Dependencies::create($beforeScope->getFile(), $calledOnTypes, $calledOnClassNames), + Dependencies::create($beforeScope->getFile(), $calledOnTypes, $calledOnClassNames, [], [], []), ); return $preliminaryResult->finalize($scope, $hasYield, $isAlwaysTerminating, $throwPoints, $impurePoints, $variableFlow, $dependencies); } @@ -572,7 +579,7 @@ private function resolveReturnType(MutatingScope $reflectionScope, bool $nativeT * @param StaticCall $expr * @param StaticCall $normalizedExpr */ - private function specifyTypes(MutatingScope $scope, Expr $expr, Expr $normalizedExpr, ?ExpressionResult $classResult, ?ParametersAcceptor $resolvedParametersAcceptor, ?ExtendedMethodReflection $walkMethodReflection, TypeSpecifierContext $context, ?ArgsResult $argsResult = null): SpecifiedTypes + private function specifyTypes(MutatingScope $scope, Expr $expr, Expr $normalizedExpr, ?ExpressionResult $classResult, ?ParametersAcceptor $resolvedParametersAcceptor, ?ExtendedMethodReflection $walkMethodReflection, TypeSpecifierContext $context, ?ArgsResult $argsResult): SpecifiedTypes { if (!$expr->name instanceof Identifier) { return $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context); diff --git a/src/Analyser/ExprHandler/StaticPropertyFetchHandler.php b/src/Analyser/ExprHandler/StaticPropertyFetchHandler.php index c3742ccd17d..4bcbc02e10e 100644 --- a/src/Analyser/ExprHandler/StaticPropertyFetchHandler.php +++ b/src/Analyser/ExprHandler/StaticPropertyFetchHandler.php @@ -206,6 +206,13 @@ public function composeResult(StaticPropertyFetch $expr, ?ExpressionResult $clas return new MixedType(); }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); return $result->withDependencies(Dependencies::merge( $classResult !== null ? $classResult->getDependencies() : null, @@ -245,7 +252,7 @@ private function getDependencies(MutatingScope $scope, StaticPropertyFetch $expr } } - return Dependencies::create($scope->getFile(), $types, $classNames); + return Dependencies::create($scope->getFile(), $types, $classNames, [], [], []); } private function propertyFetchType(MutatingScope $scope, Type $fetchedOnType, string $propertyName, StaticPropertyFetch $propertyFetch): ?Type diff --git a/src/Analyser/ExprHandler/TernaryHandler.php b/src/Analyser/ExprHandler/TernaryHandler.php index 0e9880711fb..fd2a3e86d7a 100644 --- a/src/Analyser/ExprHandler/TernaryHandler.php +++ b/src/Analyser/ExprHandler/TernaryHandler.php @@ -360,6 +360,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex )->setRootExpr($expr); }, dependencies: Dependencies::merge($ternaryCondResult->getDependencies(), $ifResult !== null ? $ifResult->getDependencies() : null, $elseResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/ThrowHandler.php b/src/Analyser/ExprHandler/ThrowHandler.php index aa78d44cd00..893ee347ce2 100644 --- a/src/Analyser/ExprHandler/ThrowHandler.php +++ b/src/Analyser/ExprHandler/ThrowHandler.php @@ -50,7 +50,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $scope, beforeScope: $scope, expr: $expr, - variableFlow: VariableFlow::sequence($exprResult->getVariableFlow(), VariableFlow::throwing($exprResult->getType(), false)), + variableFlow: VariableFlow::sequence($exprResult->getVariableFlow(), VariableFlow::throwing($exprResult->getType(), false, false)), hasYield: false, isAlwaysTerminating: true, throwPoints: array_merge($exprResult->getThrowPoints(), [InternalThrowPoint::createExplicit($scope, $exprResult->getType(), $expr, false)]), @@ -58,6 +58,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => new NonAcceptingNeverType(), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/UnaryMinusHandler.php b/src/Analyser/ExprHandler/UnaryMinusHandler.php index ed3de1bd254..37432eb5a4e 100644 --- a/src/Analyser/ExprHandler/UnaryMinusHandler.php +++ b/src/Analyser/ExprHandler/UnaryMinusHandler.php @@ -64,6 +64,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/UnaryPlusHandler.php b/src/Analyser/ExprHandler/UnaryPlusHandler.php index cda7fdef773..bbbb6fe4e4f 100644 --- a/src/Analyser/ExprHandler/UnaryPlusHandler.php +++ b/src/Analyser/ExprHandler/UnaryPlusHandler.php @@ -63,6 +63,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/VariableHandler.php b/src/Analyser/ExprHandler/VariableHandler.php index 3ace8c463f7..4b5023c9cc8 100644 --- a/src/Analyser/ExprHandler/VariableHandler.php +++ b/src/Analyser/ExprHandler/VariableHandler.php @@ -62,7 +62,7 @@ public function supports(Expr $expr): bool * * @return Closure(bool $nativeTypesPromoted): Type */ - private function createTypeCallback(Variable $expr, NodeScopeResolver $nodeScopeResolver, MutatingScope $beforeScope, ?ExpressionResult $nameResult = null, ?ExpressionResult $nameArgResult = null): Closure + private function createTypeCallback(Variable $expr, NodeScopeResolver $nodeScopeResolver, MutatingScope $beforeScope, ?ExpressionResult $nameResult, ?ExpressionResult $nameArgResult): Closure { return function (bool $nativeTypesPromoted) use ($expr, $nameResult, $nameArgResult, $nodeScopeResolver, $beforeScope): Type { $readScope = $nativeTypesPromoted ? $beforeScope->doNotTreatPhpDocTypesAsCertain() : $beforeScope; @@ -97,6 +97,16 @@ private function createTypeCallback(Variable $expr, NodeScopeResolver $nodeScope impurePoints: [], typeCallback: static fn (): Type => $constantString, specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); $specifiedTypes = $this->identicalNarrowingHelper->specifyIdentical( $nodeScopeResolver, @@ -143,7 +153,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex * walking a dynamic name; AssignHandler::prepareTarget() calls it to price a * read-modify-write target without re-walking it. */ - public function composeResult(NodeScopeResolver $nodeScopeResolver, Variable $expr, ?ExpressionResult $nameResult, ExpressionResultStorage $storage, MutatingScope $beforeScope, ?ExpressionContext $context = null): ExpressionResult + public function composeResult(NodeScopeResolver $nodeScopeResolver, Variable $expr, ?ExpressionResult $nameResult, ExpressionResultStorage $storage, MutatingScope $beforeScope, ?ExpressionContext $context): ExpressionResult { $scope = $beforeScope; $hasYield = false; @@ -152,13 +162,13 @@ public function composeResult(NodeScopeResolver $nodeScopeResolver, Variable $ex $isAlwaysTerminating = false; $variableFlow = null; if (is_string($expr->name)) { - $variableFlow = ($context !== null && $context->isUnsetTarget() ? VariableFlow::mention($expr->name) : VariableFlow::read($expr->name, $context !== null && $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null, $context !== null && $context->isArrayDimFetchRoot())); + $variableFlow = ($context !== null && $context->isUnsetTarget() ? VariableFlow::mention($expr->name) : VariableFlow::read($expr->name, $context !== null && $context->getValueFlowTarget() !== null ? $context->getValueFlowTarget()->getId() : null, $context !== null && $context->isArrayDimFetchRoot(), null)); if (in_array($expr->name, Scope::SUPERGLOBAL_VARIABLES, true)) { $impurePoints[] = new ImpurePoint($scope, $expr, 'superglobal', 'access to superglobal variable', true); } } elseif ($nameResult !== null) { $names = $nameResult->getType()->getConstantStrings(); - $variableFlow = VariableFlow::sequence($nameResult->getVariableFlow(), $names === [] ? VariableFlow::all(VariableFlow::READ_ALL) : VariableFlow::sequence(...array_map(static fn ($name) => VariableFlow::read($name->getValue()), $names))); + $variableFlow = VariableFlow::sequence($nameResult->getVariableFlow(), $names === [] ? VariableFlow::all(VariableFlow::READ_ALL) : VariableFlow::sequence(...array_map(static fn ($name) => VariableFlow::read($name->getValue(), null, false, null), $names))); $hasYield = $nameResult->hasYield(); $throwPoints = $nameResult->getThrowPoints(); $impurePoints = $nameResult->getImpurePoints(); @@ -179,6 +189,13 @@ public function composeResult(NodeScopeResolver $nodeScopeResolver, Variable $ex typeCallback: $this->createTypeCallback($expr, $nodeScopeResolver, $beforeScope, $nameResult, is_string($expr->name) ? null : $this->identicalNarrowingHelper->captureFirstArgResult($expr->name, $storage)), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $nameResult !== null ? $nameResult->getDependencies() : null, + containsNullsafe: false, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/Virtual/AlwaysRememberedExprHandler.php b/src/Analyser/ExprHandler/Virtual/AlwaysRememberedExprHandler.php index a7678793a6e..6449336bea5 100644 --- a/src/Analyser/ExprHandler/Virtual/AlwaysRememberedExprHandler.php +++ b/src/Analyser/ExprHandler/Virtual/AlwaysRememberedExprHandler.php @@ -83,6 +83,13 @@ public function processExpr( ); }, dependencies: $innerResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/Virtual/ExistingArrayDimFetchHandler.php b/src/Analyser/ExprHandler/Virtual/ExistingArrayDimFetchHandler.php index 99fc5d3aa05..ea1e44795ec 100644 --- a/src/Analyser/ExprHandler/Virtual/ExistingArrayDimFetchHandler.php +++ b/src/Analyser/ExprHandler/Virtual/ExistingArrayDimFetchHandler.php @@ -55,6 +55,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex typeCallback: static fn (bool $nativeTypesPromoted): Type => ($nativeTypesPromoted ? $arrayDimFetchResult->getNativeType() : $arrayDimFetchResult->getType()), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), dependencies: $arrayDimFetchResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, ); } diff --git a/src/Analyser/ExprHandler/Virtual/FunctionCallableNodeHandler.php b/src/Analyser/ExprHandler/Virtual/FunctionCallableNodeHandler.php index a62d4cb0ddf..1b825e94517 100644 --- a/src/Analyser/ExprHandler/Virtual/FunctionCallableNodeHandler.php +++ b/src/Analyser/ExprHandler/Virtual/FunctionCallableNodeHandler.php @@ -83,6 +83,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: $impurePoints, typeCallback: fn (bool $nativeTypesPromoted): Type => $this->resolveType($nativeTypesPromoted ? $beforeScope->doNotTreatPhpDocTypesAsCertain() : $beforeScope, $expr, $nameResult), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); return $result->withDependencies(Dependencies::merge( @@ -122,7 +131,7 @@ private function getDependencies(MutatingScope $scope, FunctionCallableNode $exp } } - return Dependencies::create($scope->getFile(), $types, reflections: $reflections); + return Dependencies::create($scope->getFile(), $types, reflections: $reflections, classNames: [], filePaths: [], usedTraits: []); } private function resolveType(MutatingScope $scope, FunctionCallableNode $expr, ?ExpressionResult $nameResult): Type diff --git a/src/Analyser/ExprHandler/Virtual/InstantiationCallableNodeHandler.php b/src/Analyser/ExprHandler/Virtual/InstantiationCallableNodeHandler.php index c7544de5346..2ffc418ead7 100644 --- a/src/Analyser/ExprHandler/Virtual/InstantiationCallableNodeHandler.php +++ b/src/Analyser/ExprHandler/Virtual/InstantiationCallableNodeHandler.php @@ -73,6 +73,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: $impurePoints, typeCallback: fn (bool $nativeTypesPromoted): Type => $this->initializerExprTypeResolver->getFirstClassCallableType($expr->getOriginalNode(), InitializerExprContext::fromScope($beforeScope), $nativeTypesPromoted), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); return $result->withDependencies(Dependencies::merge( @@ -95,13 +104,13 @@ private function getDependencies(MutatingScope $scope, InstantiationCallableNode } $class = $expr->getClass(); if ($class instanceof Name) { - return Dependencies::create($scope->getFile(), $types, [$scope->resolveName($class)]); + return Dependencies::create($scope->getFile(), $types, [$scope->resolveName($class)], [], [], []); } if ($classResult === null) { - return Dependencies::create($scope->getFile(), $types); + return Dependencies::create($scope->getFile(), $types, [], [], [], []); } - return Dependencies::create($scope->getFile(), $types, DependencyTypes::classNamesOfClassString($classResult->getType())); + return Dependencies::create($scope->getFile(), $types, DependencyTypes::classNamesOfClassString($classResult->getType()), [], [], []); } } diff --git a/src/Analyser/ExprHandler/Virtual/IssetExprHandler.php b/src/Analyser/ExprHandler/Virtual/IssetExprHandler.php index bf4f42a89ae..d0d674f2ee8 100644 --- a/src/Analyser/ExprHandler/Virtual/IssetExprHandler.php +++ b/src/Analyser/ExprHandler/Virtual/IssetExprHandler.php @@ -60,6 +60,16 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: [], typeCallback: static fn (bool $nativeTypesPromoted): Type => $nodeScopeResolver->readScopeStateOrSyntheticType($expr->getExpr(), $nativeTypesPromoted ? $scope->doNotTreatPhpDocTypesAsCertain() : $scope), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); } diff --git a/src/Analyser/ExprHandler/Virtual/MethodCallableNodeHandler.php b/src/Analyser/ExprHandler/Virtual/MethodCallableNodeHandler.php index 58bce0b5903..d92294acac3 100644 --- a/src/Analyser/ExprHandler/Virtual/MethodCallableNodeHandler.php +++ b/src/Analyser/ExprHandler/Virtual/MethodCallableNodeHandler.php @@ -83,6 +83,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: $impurePoints, typeCallback: fn (bool $nativeTypesPromoted): Type => $this->resolveType($nativeTypesPromoted ? $beforeScope->doNotTreatPhpDocTypesAsCertain() : $beforeScope, $expr, $varResult), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); return $result->withDependencies(Dependencies::merge( @@ -116,7 +125,7 @@ private function getDependencies(MutatingScope $scope, MethodCallableNode $expr, } } - return Dependencies::create($scope->getFile(), $types, $classNames); + return Dependencies::create($scope->getFile(), $types, $classNames, [], [], []); } private function resolveType(MutatingScope $scope, MethodCallableNode $expr, ExpressionResult $varResult): Type diff --git a/src/Analyser/ExprHandler/Virtual/SetExistingOffsetValueTypeExprHandler.php b/src/Analyser/ExprHandler/Virtual/SetExistingOffsetValueTypeExprHandler.php index 035a0bd408c..7ea23c1fa15 100644 --- a/src/Analyser/ExprHandler/Virtual/SetExistingOffsetValueTypeExprHandler.php +++ b/src/Analyser/ExprHandler/Virtual/SetExistingOffsetValueTypeExprHandler.php @@ -61,6 +61,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex ), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), dependencies: Dependencies::merge($varResult->getDependencies(), $dimResult->getDependencies(), $valueResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, ); } diff --git a/src/Analyser/ExprHandler/Virtual/SetOffsetValueTypeExprHandler.php b/src/Analyser/ExprHandler/Virtual/SetOffsetValueTypeExprHandler.php index 8bf7082064c..4da625a595b 100644 --- a/src/Analyser/ExprHandler/Virtual/SetOffsetValueTypeExprHandler.php +++ b/src/Analyser/ExprHandler/Virtual/SetOffsetValueTypeExprHandler.php @@ -62,6 +62,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex ), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), dependencies: Dependencies::merge($varResult->getDependencies(), $dimResult !== null ? $dimResult->getDependencies() : null, $valueResult->getDependencies()), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + variableFlow: null, ); } diff --git a/src/Analyser/ExprHandler/Virtual/StaticMethodCallableNodeHandler.php b/src/Analyser/ExprHandler/Virtual/StaticMethodCallableNodeHandler.php index 776c5324f26..fecccdb418e 100644 --- a/src/Analyser/ExprHandler/Virtual/StaticMethodCallableNodeHandler.php +++ b/src/Analyser/ExprHandler/Virtual/StaticMethodCallableNodeHandler.php @@ -86,6 +86,15 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex impurePoints: $impurePoints, typeCallback: fn (bool $nativeTypesPromoted): Type => $this->initializerExprTypeResolver->getFirstClassCallableType($expr->getOriginalNode(), InitializerExprContext::fromScope($beforeScope), $nativeTypesPromoted), specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, + dependencies: null, ); return $result->withDependencies(Dependencies::merge( @@ -133,7 +142,7 @@ private function getDependencies(MutatingScope $scope, StaticMethodCallableNode $types = [...$types, ...DependencyTypes::ofCalledMethod($methodReflection, false)]; } - return Dependencies::create($scope->getFile(), $types, $classNames); + return Dependencies::create($scope->getFile(), $types, $classNames, [], [], []); } } diff --git a/src/Analyser/ExprHandler/YieldFromHandler.php b/src/Analyser/ExprHandler/YieldFromHandler.php index 2900f82838a..b078e8c2504 100644 --- a/src/Analyser/ExprHandler/YieldFromHandler.php +++ b/src/Analyser/ExprHandler/YieldFromHandler.php @@ -52,13 +52,13 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex $scope = $exprResult->getScope(); $scope = $scope->addTemplateArgumentConstraints($nodeScopeResolver->collectYieldFromSend($scope, $exprResult->getType())); - $throwPoint = InternalThrowPoint::createImplicit($scope, $expr); + $throwPoint = InternalThrowPoint::createImplicit($scope, $expr, null); return $this->expressionResultFactory->create( $scope, beforeScope: $beforeScope, expr: $expr, - variableFlow: VariableFlow::sequence($exprResult->getVariableFlow(), VariableFlow::throwing($throwPoint->getType(), true)), + variableFlow: VariableFlow::sequence($exprResult->getVariableFlow(), VariableFlow::throwing($throwPoint->getType(), true, false)), hasYield: true, isAlwaysTerminating: $exprResult->isAlwaysTerminating(), throwPoints: array_merge($exprResult->getThrowPoints(), [$throwPoint]), @@ -74,6 +74,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: $exprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExprHandler/YieldHandler.php b/src/Analyser/ExprHandler/YieldHandler.php index c418ed316cd..7281771da31 100644 --- a/src/Analyser/ExprHandler/YieldHandler.php +++ b/src/Analyser/ExprHandler/YieldHandler.php @@ -51,7 +51,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex { $beforeScope = $scope; $throwPoints = [ - InternalThrowPoint::createImplicit($scope, $expr), + InternalThrowPoint::createImplicit($scope, $expr, null), ]; $impurePoints = [ new ImpurePoint( @@ -114,6 +114,14 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex }, specifyTypesCallback: fn (TypeSpecifierContext $context, bool $nativeTypesPromoted) => $this->defaultNarrowingHelper->specifyDefaultTypes($expr, $context), dependencies: Dependencies::merge($keyResult !== null ? $keyResult->getDependencies() : null, $valueResult !== null ? $valueResult->getDependencies() : null), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); } diff --git a/src/Analyser/ExpressionContext.php b/src/Analyser/ExpressionContext.php index 7e81817c4e7..251b40277f8 100644 --- a/src/Analyser/ExpressionContext.php +++ b/src/Analyser/ExpressionContext.php @@ -38,12 +38,12 @@ private function __construct( { } - public static function createTopLevel(bool $resolveTemplateArguments = true): self + public static function createTopLevel(bool $resolveTemplateArguments): self { return new self(isDeep: false, inAssignRightSideVariableName: null, inAssignRightSideExpr: null, resolveTemplateArguments: $resolveTemplateArguments); } - public static function createDeep(bool $resolveTemplateArguments = true): self + public static function createDeep(bool $resolveTemplateArguments): self { return new self(isDeep: true, inAssignRightSideVariableName: null, inAssignRightSideExpr: null, resolveTemplateArguments: $resolveTemplateArguments); } diff --git a/src/Analyser/ExpressionResult.php b/src/Analyser/ExpressionResult.php index 9f69558d9b1..bd48d4e1977 100644 --- a/src/Analyser/ExpressionResult.php +++ b/src/Analyser/ExpressionResult.php @@ -73,15 +73,15 @@ public function __construct( private array $impurePoints, ?callable $typeCallback, callable $specifyTypesCallback, - private bool $containsNullsafe = false, - private ?IssetabilityDescriptor $issetabilityDescriptor = null, - private ?ExpressionResult $truthyScopeOverrideResult = null, - private ?ExpressionResult $falseyScopeOverrideResult = null, - ?callable $createTypesCallback = null, - private ?Type $type = null, - private ?Type $nativeType = null, - private ?ArgsResult $argsResult = null, - private ?VariableFlow $variableFlow = null, + private bool $containsNullsafe, + private ?IssetabilityDescriptor $issetabilityDescriptor, + private ?ExpressionResult $truthyScopeOverrideResult, + private ?ExpressionResult $falseyScopeOverrideResult, + ?callable $createTypesCallback, + private ?Type $type, + private ?Type $nativeType, + private ?ArgsResult $argsResult, + private ?VariableFlow $variableFlow, private array $specifiedTypes = [], private ?Type $cachedType = null, bool $extensionsDeclined = false, @@ -241,7 +241,7 @@ public function containsNullsafe(): bool * expression's own type when it is not a chain link (e.g. a method-call-rooted * base like $this->getFoo()['x']). $useNativeTypes selects native vs phpdoc. */ - public function getIssetabilityResolution(MutatingScope $scope, bool $useNativeTypes, bool $reprocessUntrackedLinks = false): IssetabilityResolution + public function getIssetabilityResolution(MutatingScope $scope, bool $useNativeTypes, bool $reprocessUntrackedLinks): IssetabilityResolution { if ($this->issetabilityDescriptor !== null) { return $this->issetabilityDescriptor->resolve($scope, $useNativeTypes, $this->expr, $reprocessUntrackedLinks); @@ -613,7 +613,7 @@ public function getSpecifiedTypesForScope(MutatingScope $scope, TypeSpecifierCon * narrowing is applied to - so one memoized SpecifiedTypes serves every * asking position. */ - public function getSpecifiedTypes(TypeSpecifierContext $context, bool $nativeTypesPromoted = false): SpecifiedTypes + public function getSpecifiedTypes(TypeSpecifierContext $context, bool $nativeTypesPromoted): SpecifiedTypes { $key = (spl_object_id($context) << 1) | ($nativeTypesPromoted ? 1 : 0); @@ -640,7 +640,7 @@ public function getCreatedTypesForScope(MutatingScope $scope, Type $type, TypeSp * computed at the expression's own evaluation point - the asking scope * reduces to its flavour bit, like getSpecifiedTypes(). */ - public function getCreatedTypes(Type $type, TypeSpecifierContext $context, bool $nativeTypesPromoted = false): ?SpecifiedTypes + public function getCreatedTypes(Type $type, TypeSpecifierContext $context, bool $nativeTypesPromoted): ?SpecifiedTypes { if ($this->createTypesCallback === null) { return null; @@ -699,7 +699,7 @@ public function answersOnScope(MutatingScope $scope, bool $useNativeTypes): bool $useNativeTypes = $useNativeTypes || $scope->nativeTypesPromoted; $readScope = $useNativeTypes ? $scope->doNotTreatPhpDocTypesAsCertain() : $scope; - return $this->isScopeAuthoritative($readScope) || $this->askScopeVariableStateMatches($scope, $useNativeTypes); + return $this->isScopeAuthoritative($readScope) || $this->askScopeVariableStateMatches($scope, $useNativeTypes, false); } /** @@ -740,7 +740,7 @@ private function isScopeAuthoritative(MutatingScope $scope): bool * Engine-side consumers keep the strict direction: any state divergence - * including a variable removed since the walk - forces re-pricing. */ - public function askScopeVariableStateMatches(MutatingScope $scope, bool $useNativeTypes, bool $ruleFacingAsk = false): bool + public function askScopeVariableStateMatches(MutatingScope $scope, bool $useNativeTypes, bool $ruleFacingAsk): bool { // same unpromoted position implies same promoted position - skip the // flavour derivation for the common same-position ask @@ -845,6 +845,8 @@ public function atAskPosition(MutatingScope $scope): self projectedNativeType: $fromScope ? null : $this->projectedNativeType, readVariableNames: $this->readVariableNames, dependencies: $this->dependencies, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, ); } diff --git a/src/Analyser/ExpressionResultFactory.php b/src/Analyser/ExpressionResultFactory.php index d59f35546b5..eace2fc4139 100644 --- a/src/Analyser/ExpressionResultFactory.php +++ b/src/Analyser/ExpressionResultFactory.php @@ -26,16 +26,16 @@ public function create( array $impurePoints, ?callable $typeCallback, callable $specifyTypesCallback, - bool $containsNullsafe = false, - ?IssetabilityDescriptor $issetabilityDescriptor = null, - ?ExpressionResult $truthyScopeOverrideResult = null, - ?ExpressionResult $falseyScopeOverrideResult = null, - ?callable $createTypesCallback = null, - ?Type $type = null, - ?Type $nativeType = null, - ?ArgsResult $argsResult = null, - ?VariableFlow $variableFlow = null, - ?Dependencies $dependencies = null, + bool $containsNullsafe, + ?IssetabilityDescriptor $issetabilityDescriptor, + ?ExpressionResult $truthyScopeOverrideResult, + ?ExpressionResult $falseyScopeOverrideResult, + ?callable $createTypesCallback, + ?Type $type, + ?Type $nativeType, + ?ArgsResult $argsResult, + ?VariableFlow $variableFlow, + ?Dependencies $dependencies, ): ExpressionResult; } diff --git a/src/Analyser/FinalizerResult.php b/src/Analyser/FinalizerResult.php index 36416a4c39d..2373c3acbb3 100644 --- a/src/Analyser/FinalizerResult.php +++ b/src/Analyser/FinalizerResult.php @@ -14,8 +14,8 @@ public function __construct( private AnalyserResult $analyserResult, private array $collectorErrors, private array $locallyIgnoredCollectorErrors, - private array $collectedDataRuleResults = [], - private int $reusedRulesCount = 0, + private array $collectedDataRuleResults, + private int $reusedRulesCount, ) { } diff --git a/src/Analyser/Generics/TemplateArgumentConstraints.php b/src/Analyser/Generics/TemplateArgumentConstraints.php index 8eebfe8add5..fe2fc67a519 100644 --- a/src/Analyser/Generics/TemplateArgumentConstraints.php +++ b/src/Analyser/Generics/TemplateArgumentConstraints.php @@ -23,17 +23,17 @@ final class TemplateArgumentConstraints * @param self|null $until where the walk of $right stops - see withRecordedFacts() */ private function __construct( - private readonly ?self $left = null, - private readonly ?self $right = null, - private readonly ?array $fact = null, - private readonly ?self $until = null, + private readonly ?self $left, + private readonly ?self $right, + private readonly ?array $fact, + private readonly ?self $until, ) { } public static function createEmpty(): self { - return new self(); + return new self(null, null, null, null); } public function isEmpty(): bool @@ -50,7 +50,7 @@ public function merge(self $other): self return $other; } - return new self($this, $other); + return new self($this, $other, null, null); } /** @@ -67,7 +67,7 @@ public function withRecordedFacts(?self $entry, self $exit): self return $this; } - return new self($this, $exit, until: $entry); + return new self($this, $exit, until: $entry, fact: null); } public function withSite(UnresolvedTemplateArgumentType $marker): self @@ -76,22 +76,22 @@ public function withSite(UnresolvedTemplateArgumentType $marker): self return $this; } - return new self($this, fact: [$marker, null, null, false]); + return new self($this, fact: [$marker, null, null, false], right: null, until: null); } public function withSend(UnresolvedTemplateArgumentType $marker, Type $type, TemplateTypeVariance $variance): self { - return new self($this, fact: [$marker, $type, $variance, false]); + return new self($this, fact: [$marker, $type, $variance, false], right: null, until: null); } public function withLowerBound(UnresolvedTemplateArgumentType $marker, Type $type): self { - return new self($this, fact: [$marker, $type, null, false]); + return new self($this, fact: [$marker, $type, null, false], right: null, until: null); } public function withUnconstrainingSend(UnresolvedTemplateArgumentType $marker): self { - return new self($this, fact: [$marker, null, null, true]); + return new self($this, fact: [$marker, null, null, true], right: null, until: null); } /** @return iterable */ diff --git a/src/Analyser/Generics/TemplateArgumentFrame.php b/src/Analyser/Generics/TemplateArgumentFrame.php index 87481248043..aae18246d0a 100644 --- a/src/Analyser/Generics/TemplateArgumentFrame.php +++ b/src/Analyser/Generics/TemplateArgumentFrame.php @@ -44,7 +44,7 @@ final class TemplateArgumentFrame * with the inferred template arguments unresolved/resolved under the * scope's frame, the legacy (generalizing) one otherwise. */ - public static function returnTypeOfCall(ParametersAcceptor $acceptor, MutatingScope $scope, Expr $site, ?bool $allowUnresolved = null): Type + public static function returnTypeOfCall(ParametersAcceptor $acceptor, MutatingScope $scope, Expr $site, ?bool $allowUnresolved): Type { $frame = $scope->getCurrentTemplateArgumentFrame(); if ($frame === null || !$acceptor instanceof ResolvedFunctionVariant) { @@ -71,15 +71,15 @@ public static function returnTypeOfCall(ParametersAcceptor $acceptor, MutatingSc */ public function __construct( private readonly ?self $parent, - private readonly ?array $resolutions = null, - private readonly array $siteStatementIndexes = [], - private readonly ?Node $closureSignatureBody = null, - private readonly array $closureSignatureStmts = [], - private readonly array $settledClosureSites = [], - private readonly bool $observingClosures = false, - private readonly array $byRefSites = [], - private readonly array $staticVariableTypes = [], - private readonly array $staticVariableConditionalExpressions = [], + private readonly ?array $resolutions, + private readonly array $siteStatementIndexes, + private readonly ?Node $closureSignatureBody, + private readonly array $closureSignatureStmts, + private readonly array $settledClosureSites, + private readonly bool $observingClosures, + private readonly array $byRefSites, + private readonly array $staticVariableTypes, + private readonly array $staticVariableConditionalExpressions, ) { } @@ -118,7 +118,7 @@ public function getStaticVariableConditionalExpressions(Node\Stmt\Static_ $stmt) * @param array $statementIndexes * @param array}> $conditionalExpressions */ - public function withStaticVariableTypes(array $staticVariableTypes, array $statementIndexes, array $conditionalExpressions = []): self + public function withStaticVariableTypes(array $staticVariableTypes, array $statementIndexes, array $conditionalExpressions): self { return new self( $this->parent, @@ -178,7 +178,7 @@ public function getLocalByRefSites(): array * @param array $settledClosureSites * @param array $byRefSites */ - public function withObservedClosures(array $closureResolutions, array $closureSiteStatementIndexes, array $settledClosureSites, array $byRefSites = []): self + public function withObservedClosures(array $closureResolutions, array $closureSiteStatementIndexes, array $settledClosureSites, array $byRefSites): self { return new self( $this->parent, @@ -190,6 +190,7 @@ public function withObservedClosures(array $closureResolutions, array $closureSi byRefSites: $byRefSites, staticVariableTypes: $this->staticVariableTypes, staticVariableConditionalExpressions: $this->staticVariableConditionalExpressions, + observingClosures: false, ); } diff --git a/src/Analyser/Generics/TemplateArgumentObserver.php b/src/Analyser/Generics/TemplateArgumentObserver.php index 43d9cfa68e4..99b3fa36ecd 100644 --- a/src/Analyser/Generics/TemplateArgumentObserver.php +++ b/src/Analyser/Generics/TemplateArgumentObserver.php @@ -53,7 +53,7 @@ public function collectSites(Type $type): TemplateArgumentConstraints } /** Skip ordinary recursive generic relationships that cannot contribute a constraint. */ - private function containsMarker(Type $type, bool $templateArgumentsOnly = false): bool + private function containsMarker(Type $type, bool $templateArgumentsOnly): bool { $contains = false; TypeTraverser::map($type, static function (Type $type, callable $traverse) use (&$contains, $templateArgumentsOnly): Type { @@ -67,7 +67,7 @@ private function containsMarker(Type $type, bool $templateArgumentsOnly = false) public function collectSend(Type $declared, Type $actual): TemplateArgumentConstraints { - $constraints = $this->observeSend(TemplateArgumentConstraints::createEmpty(), $declared, $actual); + $constraints = $this->observeSend(TemplateArgumentConstraints::createEmpty(), $declared, $actual, false); return $this->observeClosureSend($constraints, $declared, $actual); } @@ -292,7 +292,7 @@ private function escapeClosures(TemplateArgumentConstraints $constraints, Type $ return $constraints->merge(ClosureSignatureInference::collectEscapes($type)); } - public function collectArgument(Type $parameterType, Type $argumentType, bool $isPure = false): TemplateArgumentConstraints + public function collectArgument(Type $parameterType, Type $argumentType, bool $isPure): TemplateArgumentConstraints { // A pure consumer accepting anything cannot initialize an empty object. if ($isPure && $parameterType instanceof MixedType && !$parameterType instanceof TemplateType) { @@ -308,7 +308,7 @@ public function collectArgument(Type $parameterType, Type $argumentType, bool $i * * @param array $argumentTypes */ - public function collectCall(Expr $site, ParametersAcceptor $acceptor, array $argumentTypes, ?TemplateTypeMap $classTemplates = null): TemplateArgumentConstraints + public function collectCall(Expr $site, ParametersAcceptor $acceptor, array $argumentTypes, ?TemplateTypeMap $classTemplates): TemplateArgumentConstraints { $constraints = TemplateArgumentConstraints::createEmpty(); if ($acceptor instanceof ResolvedFunctionVariant) { @@ -371,7 +371,7 @@ private function replaceInferableTemplates(Type $type, Expr $site, TemplateTypeM $members[] = $member; if ($member instanceof UnresolvedTemplateArgumentType) { $naked[] = $member; - } elseif ($this->containsMarker($member)) { + } elseif ($this->containsMarker($member, false)) { $structural[] = $member; } } @@ -418,9 +418,9 @@ private function replaceInferableTemplates(Type $type, Expr $site, TemplateTypeM * $actual flows into $declared: a property's writable type, a parameter * type, a declared return type, a @var type. */ - private function observeSend(TemplateArgumentConstraints $constraints, Type $declared, Type $actual, bool $isCallArgument = false): TemplateArgumentConstraints + private function observeSend(TemplateArgumentConstraints $constraints, Type $declared, Type $actual, bool $isCallArgument): TemplateArgumentConstraints { - if ($declared instanceof TemplateType || !$this->containsMarker($actual)) { + if ($declared instanceof TemplateType || !$this->containsMarker($actual, false)) { return $constraints; } if ($isCallArgument && $declared instanceof MixedType) { @@ -595,7 +595,7 @@ private function observeArgument(TemplateArgumentConstraints $constraints, Type private function observeLowerBound(TemplateArgumentConstraints $constraints, Type $parameterType, Type $argumentType): TemplateArgumentConstraints { - if (!$this->containsMarker($parameterType)) { + if (!$this->containsMarker($parameterType, false)) { return $constraints; } if ($parameterType instanceof UnresolvedTemplateArgumentType) { @@ -624,7 +624,7 @@ private function observeLowerBound(TemplateArgumentConstraints $constraints, Typ if ($member instanceof UnresolvedTemplateArgumentType) { continue; } - if (!$this->containsMarker($member)) { + if (!$this->containsMarker($member, false)) { if ($member->isSuperTypeOf($argumentMember)->yes()) { $taken = true; } diff --git a/src/Analyser/Generics/TemplateArgumentResolver.php b/src/Analyser/Generics/TemplateArgumentResolver.php index 9a7c80b12ef..66fd8b706c3 100644 --- a/src/Analyser/Generics/TemplateArgumentResolver.php +++ b/src/Analyser/Generics/TemplateArgumentResolver.php @@ -32,7 +32,7 @@ final class TemplateArgumentResolver * @param list $statementStartTokenPositions * @param Node\Stmt[] $closureSignatureStmts */ - public function resolve(TemplateArgumentConstraints $constraints, ?TemplateArgumentFrame $parent, array $statementStartTokenPositions, ?Node $closureSignatureBody = null, array $closureSignatureStmts = []): TemplateArgumentFrame + public function resolve(TemplateArgumentConstraints $constraints, ?TemplateArgumentFrame $parent, array $statementStartTokenPositions, ?Node $closureSignatureBody, array $closureSignatureStmts): TemplateArgumentFrame { $closureSiteIds = []; [$observations, $siteIndexes] = $this->collectObservations($constraints, $statementStartTokenPositions, false, $closureSiteIds); @@ -55,17 +55,17 @@ public function resolve(TemplateArgumentConstraints $constraints, ?TemplateArgum $closureKeys[$key] = true; } if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('closureObservationPasses'); + TemplateArgumentStats::increment('closureObservationPasses', 1); } - return new TemplateArgumentFrame($parent, array_diff_key($resolutions, $closureKeys), $templateSiteStatementIndexes, $closureSignatureBody, $closureSignatureStmts, observingClosures: true); + return new TemplateArgumentFrame($parent, array_diff_key($resolutions, $closureKeys), $templateSiteStatementIndexes, $closureSignatureBody, $closureSignatureStmts, observingClosures: true, settledClosureSites: [], byRefSites: [], staticVariableTypes: [], staticVariableConditionalExpressions: []); } if (TemplateArgumentStats::$enabled && count($settledClosureSites) > 0) { TemplateArgumentStats::increment('closureSitesSettled', count($settledClosureSites)); } - return new TemplateArgumentFrame($parent, $resolutions, $this->collectSiteStatementIndexes($siteIndexes, $settledClosureSites), $closureSignatureBody, $closureSignatureStmts, $settledClosureSites, byRefSites: $this->collectByRefSites($observations, $siteIndexes)); + return new TemplateArgumentFrame($parent, $resolutions, $this->collectSiteStatementIndexes($siteIndexes, $settledClosureSites), $closureSignatureBody, $closureSignatureStmts, $settledClosureSites, byRefSites: $this->collectByRefSites($observations, $siteIndexes), observingClosures: false, staticVariableTypes: [], staticVariableConditionalExpressions: []); } /** @@ -143,7 +143,7 @@ private function collectObservations(TemplateArgumentConstraints $constraints, a continue; } - TemplateArgumentStats::increment($isClosureMarker ? 'closureSitesCreated' : 'sitesCreated'); + TemplateArgumentStats::increment($isClosureMarker ? 'closureSitesCreated' : 'sitesCreated', 1); } return [$observations, $siteIndexes]; diff --git a/src/Analyser/Generics/TemplateArgumentSolver.php b/src/Analyser/Generics/TemplateArgumentSolver.php index 25fcb53900b..2f3acbd807a 100644 --- a/src/Analyser/Generics/TemplateArgumentSolver.php +++ b/src/Analyser/Generics/TemplateArgumentSolver.php @@ -255,7 +255,7 @@ private function resolveObservation(array $observation): Type } if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('resolvedBySend'); + TemplateArgumentStats::increment('resolvedBySend', 1); } return $sent; } @@ -265,7 +265,7 @@ private function resolveObservation(array $observation): Type } if ($covariantFallback !== null) { if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('resolvedBySend'); + TemplateArgumentStats::increment('resolvedBySend', 1); } return $covariantFallback; } @@ -288,14 +288,14 @@ private function resolveObservation(array $observation): Type return $initial; } if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('resolvedUnconstrained'); + TemplateArgumentStats::increment('resolvedUnconstrained', 1); } return TemplateArgumentFrame::resolveUnconstrained($observation['marker']->getSite(), $observation['marker']->getTemplate(), fn (Expr $site, string $templateName): ?Type => $this->resolve($site, $templateName)); } if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment(count($lowerBounds) > 0 ? 'resolvedWithLowerBounds' : 'resolvedToInitial'); + TemplateArgumentStats::increment(count($lowerBounds) > 0 ? 'resolvedWithLowerBounds' : 'resolvedToInitial', 1); } return TypeCombinator::union(...$parts); } @@ -356,7 +356,7 @@ private function resolveClosureSignatureObservation(array $observation): Type $declared = $marker->getDelegate(); if ($observation['unconstrainingSend']) { if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('closureParametersEscaped'); + TemplateArgumentStats::increment('closureParametersEscaped', 1); } return $declared; } @@ -366,7 +366,7 @@ private function resolveClosureSignatureObservation(array $observation): Type } if ($lowerBounds === []) { if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('closureParametersUnobserved'); + TemplateArgumentStats::increment('closureParametersUnobserved', 1); } return $declared; } @@ -380,14 +380,14 @@ private function resolveClosureSignatureObservation(array $observation): Type // an invocation the declared type rejects is reported against the // declared type, which is also all the body can rely on if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('closureParametersDeclared'); + TemplateArgumentStats::increment('closureParametersDeclared', 1); } return $declared; } $resolved = MutatingScope::intersectButNotNever($declared, $inferred); if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment($resolved->equals($declared) ? 'closureParametersDeclared' : 'closureParametersInferred'); + TemplateArgumentStats::increment($resolved->equals($declared) ? 'closureParametersDeclared' : 'closureParametersInferred', 1); } return $resolved; diff --git a/src/Analyser/Generics/TemplateArgumentStats.php b/src/Analyser/Generics/TemplateArgumentStats.php index 89b20e386fd..7fae86d21c4 100644 --- a/src/Analyser/Generics/TemplateArgumentStats.php +++ b/src/Analyser/Generics/TemplateArgumentStats.php @@ -80,7 +80,7 @@ public static function enableFromEnvironment(): void }); } - public static function increment(string $counter, int $by = 1): void + public static function increment(string $counter, int $by): void { self::$counters[$counter] += $by; } diff --git a/src/Analyser/InternalScopeFactoryFactory.php b/src/Analyser/InternalScopeFactoryFactory.php index 2587b31c05f..7f01faf5a98 100644 --- a/src/Analyser/InternalScopeFactoryFactory.php +++ b/src/Analyser/InternalScopeFactoryFactory.php @@ -12,6 +12,8 @@ interface InternalScopeFactoryFactory */ public function create( ?callable $nodeCallback, + bool $createsNodeCallbackScopes, + ?ExpressionResultStorageStack $expressionResultStorageStack, ): InternalScopeFactory; } diff --git a/src/Analyser/InternalThrowPoint.php b/src/Analyser/InternalThrowPoint.php index 17d03489df3..8a72cc6e0e2 100644 --- a/src/Analyser/InternalThrowPoint.php +++ b/src/Analyser/InternalThrowPoint.php @@ -46,7 +46,7 @@ public static function createExplicit(MutatingScope $scope, Type $type, Node $no /** * @param Node\Expr|Node\Stmt $node */ - public static function createImplicit(MutatingScope $scope, Node $node, ?Type $type = null): self + public static function createImplicit(MutatingScope $scope, Node $node, ?Type $type): self { return new self($scope, $type ?? new ObjectType(Throwable::class), $node, explicit: false, canContainAnyThrowable: true); } diff --git a/src/Analyser/IssetabilityDescriptor.php b/src/Analyser/IssetabilityDescriptor.php index 3c8d3b53ed4..a12497e58b2 100644 --- a/src/Analyser/IssetabilityDescriptor.php +++ b/src/Analyser/IssetabilityDescriptor.php @@ -40,24 +40,24 @@ final class IssetabilityDescriptor */ private function __construct( private string $kind, - private ?string $variableName = null, - private ?ExpressionResult $varResult = null, - private ?ExpressionResult $dimResult = null, - private ?ExpressionResult $innerResult = null, - private ?Closure $reflectionResolver = null, - private ?Expr $propertyFetch = null, + private ?string $variableName, + private ?ExpressionResult $varResult, + private ?ExpressionResult $dimResult, + private ?ExpressionResult $innerResult, + private ?Closure $reflectionResolver, + private ?Expr $propertyFetch, ) { } public static function variable(string $variableName): self { - return new self(self::KIND_VARIABLE, variableName: $variableName); + return new self(self::KIND_VARIABLE, variableName: $variableName, varResult: null, dimResult: null, innerResult: null, reflectionResolver: null, propertyFetch: null); } public static function offset(ExpressionResult $varResult, ExpressionResult $dimResult): self { - return new self(self::KIND_OFFSET, varResult: $varResult, dimResult: $dimResult); + return new self(self::KIND_OFFSET, varResult: $varResult, dimResult: $dimResult, variableName: null, innerResult: null, reflectionResolver: null, propertyFetch: null); } /** @@ -66,7 +66,7 @@ public static function offset(ExpressionResult $varResult, ExpressionResult $dim */ public static function property(?ExpressionResult $innerResult, Closure $reflectionResolver, Expr $propertyFetch): self { - return new self(self::KIND_PROPERTY, innerResult: $innerResult, reflectionResolver: $reflectionResolver, propertyFetch: $propertyFetch); + return new self(self::KIND_PROPERTY, innerResult: $innerResult, reflectionResolver: $reflectionResolver, propertyFetch: $propertyFetch, variableName: null, varResult: null, dimResult: null); } /** @@ -75,7 +75,7 @@ public static function property(?ExpressionResult $innerResult, Closure $reflect * ExpressionResult::getIssetabilityResolution); $useNativeTypes selects native * vs phpdoc types (the rule's treatPhpDocTypesAsCertain). */ - public function resolve(MutatingScope $scope, bool $useNativeTypes, Expr $expr, bool $reprocessUntrackedLinks = false): IssetabilityResolution + public function resolve(MutatingScope $scope, bool $useNativeTypes, Expr $expr, bool $reprocessUntrackedLinks): IssetabilityResolution { if ($this->kind === self::KIND_VARIABLE) { $variableName = $this->variableName; diff --git a/src/Analyser/IssetabilityLinkInfo.php b/src/Analyser/IssetabilityLinkInfo.php index 975844080e9..90824e5809e 100644 --- a/src/Analyser/IssetabilityLinkInfo.php +++ b/src/Analyser/IssetabilityLinkInfo.php @@ -27,36 +27,36 @@ final class IssetabilityLinkInfo private function __construct( private string $kind, - private ?string $variableName = null, - private ?TrinaryLogic $hasVariable = null, - private ?TrinaryLogic $isOffsetAccessible = null, - private ?TrinaryLogic $hasOffsetValue = null, - private bool $hasExpressionTypeOfExpr = false, - private ?Type $varType = null, - private ?Type $dimType = null, - private ?Type $valueType = null, - private ?FoundPropertyReflection $propertyReflection = null, - private ?Expr $propertyFetch = null, - private bool $reflectionNative = false, - private bool $hasNativeType = false, - private ?TrinaryLogic $isVirtual = null, - private ?Type $nativeType = null, - private bool $hasExpressionTypeOfFetch = false, - private bool $initializedThisProperty = false, - private bool $nativeReflectionExists = false, - private bool $nativeIsPromoted = false, - private bool $nativeIsReadOnly = false, - private bool $nativeIsHooked = false, - private bool $nativeHasDefaultValue = false, - private ?Expr $leafExpr = null, - private bool $leafIsNullsafePropertyFetch = false, + private ?string $variableName, + private ?TrinaryLogic $hasVariable, + private ?TrinaryLogic $isOffsetAccessible, + private ?TrinaryLogic $hasOffsetValue, + private bool $hasExpressionTypeOfExpr, + private ?Type $varType, + private ?Type $dimType, + private ?Type $valueType, + private ?FoundPropertyReflection $propertyReflection, + private ?Expr $propertyFetch, + private bool $reflectionNative, + private bool $hasNativeType, + private ?TrinaryLogic $isVirtual, + private ?Type $nativeType, + private bool $hasExpressionTypeOfFetch, + private bool $initializedThisProperty, + private bool $nativeReflectionExists, + private bool $nativeIsPromoted, + private bool $nativeIsReadOnly, + private bool $nativeIsHooked, + private bool $nativeHasDefaultValue, + private ?Expr $leafExpr, + private bool $leafIsNullsafePropertyFetch, ) { } public static function variable(string $variableName, TrinaryLogic $hasVariable, Type $valueType): self { - return new self(self::KIND_VARIABLE, variableName: $variableName, hasVariable: $hasVariable, valueType: $valueType); + return new self(self::KIND_VARIABLE, variableName: $variableName, hasVariable: $hasVariable, valueType: $valueType, isOffsetAccessible: null, hasOffsetValue: null, hasExpressionTypeOfExpr: false, varType: null, dimType: null, propertyReflection: null, propertyFetch: null, reflectionNative: false, hasNativeType: false, isVirtual: null, nativeType: null, hasExpressionTypeOfFetch: false, initializedThisProperty: false, nativeReflectionExists: false, nativeIsPromoted: false, nativeIsReadOnly: false, nativeIsHooked: false, nativeHasDefaultValue: false, leafExpr: null, leafIsNullsafePropertyFetch: false); } public static function offset(TrinaryLogic $isOffsetAccessible, TrinaryLogic $hasOffsetValue, bool $hasExpressionTypeOfExpr, Type $varType, Type $dimType, Type $valueType): self @@ -69,6 +69,23 @@ public static function offset(TrinaryLogic $isOffsetAccessible, TrinaryLogic $ha varType: $varType, dimType: $dimType, valueType: $valueType, + variableName: null, + hasVariable: null, + propertyReflection: null, + propertyFetch: null, + reflectionNative: false, + hasNativeType: false, + isVirtual: null, + nativeType: null, + hasExpressionTypeOfFetch: false, + initializedThisProperty: false, + nativeReflectionExists: false, + nativeIsPromoted: false, + nativeIsReadOnly: false, + nativeIsHooked: false, + nativeHasDefaultValue: false, + leafExpr: null, + leafIsNullsafePropertyFetch: false, ); } @@ -105,12 +122,21 @@ public static function property( nativeIsReadOnly: $nativeIsReadOnly, nativeIsHooked: $nativeIsHooked, nativeHasDefaultValue: $nativeHasDefaultValue, + variableName: null, + hasVariable: null, + isOffsetAccessible: null, + hasOffsetValue: null, + hasExpressionTypeOfExpr: false, + varType: null, + dimType: null, + leafExpr: null, + leafIsNullsafePropertyFetch: false, ); } public static function leaf(Type $valueType, Expr $leafExpr, bool $leafIsNullsafePropertyFetch): self { - return new self(self::KIND_LEAF, valueType: $valueType, leafExpr: $leafExpr, leafIsNullsafePropertyFetch: $leafIsNullsafePropertyFetch); + return new self(self::KIND_LEAF, valueType: $valueType, leafExpr: $leafExpr, leafIsNullsafePropertyFetch: $leafIsNullsafePropertyFetch, variableName: null, hasVariable: null, isOffsetAccessible: null, hasOffsetValue: null, hasExpressionTypeOfExpr: false, varType: null, dimType: null, propertyReflection: null, propertyFetch: null, reflectionNative: false, hasNativeType: false, isVirtual: null, nativeType: null, hasExpressionTypeOfFetch: false, initializedThisProperty: false, nativeReflectionExists: false, nativeIsPromoted: false, nativeIsReadOnly: false, nativeIsHooked: false, nativeHasDefaultValue: false); } public function isVariable(): bool diff --git a/src/Analyser/IssetabilityResolution.php b/src/Analyser/IssetabilityResolution.php index 0c7de688f70..b9a2564ba67 100644 --- a/src/Analyser/IssetabilityResolution.php +++ b/src/Analyser/IssetabilityResolution.php @@ -40,7 +40,7 @@ public function getInner(): ?IssetabilityResolution * * @param callable(Type): ?bool $typeCallback */ - public function isSet(callable $typeCallback, ?bool $result = null): ?bool + public function isSet(callable $typeCallback, ?bool $result): ?bool { $link = $this->link; @@ -173,7 +173,7 @@ public function notEmpty(): ?bool } return !$isFalsey->yes(); - }); + }, null); } } diff --git a/src/Analyser/LazyInternalScopeFactory.php b/src/Analyser/LazyInternalScopeFactory.php index c40ea12abbc..1264197e19c 100644 --- a/src/Analyser/LazyInternalScopeFactory.php +++ b/src/Analyser/LazyInternalScopeFactory.php @@ -44,8 +44,8 @@ final class LazyInternalScopeFactory implements InternalScopeFactory public function __construct( private Container $container, private $nodeCallback, - private bool $createsNodeCallbackScopes = false, - ?ExpressionResultStorageStack $expressionResultStorageStack = null, + private bool $createsNodeCallbackScopes, + ?ExpressionResultStorageStack $expressionResultStorageStack, ) { $this->currentSimpleVersionParser = $this->container->getService('currentPhpVersionSimpleParser'); diff --git a/src/Analyser/MutatingScope.php b/src/Analyser/MutatingScope.php index 85867200a20..821cdd4dc24 100644 --- a/src/Analyser/MutatingScope.php +++ b/src/Analyser/MutatingScope.php @@ -700,7 +700,7 @@ public function invalidateVolatileExpressions(): self $changed = VolatileExpressionHelper::invalidateVolatileFunctionCalls($expressionTypes, $nativeExpressionTypes); $changed = VolatileExpressionHelper::invalidateSuperglobals($expressionTypes, $nativeExpressionTypes) || $changed; - $changed = VolatileExpressionHelper::invalidateNegativeExistenceChecks($this, $expressionTypes, $nativeExpressionTypes) || $changed; + $changed = VolatileExpressionHelper::invalidateNegativeExistenceChecks($this, $expressionTypes, $nativeExpressionTypes, VolatileExpressionHelper::EXISTENCE_CHECK_FUNCTION_NAMES, null) || $changed; if (!$changed) { return $this; @@ -1036,7 +1036,7 @@ public function duplicateWith( * * @param list|null $relevantRoots */ - public function getClosureScopeCacheKey(?array $relevantRoots = null): string + public function getClosureScopeCacheKey(?array $relevantRoots): string { $parts = []; foreach ($this->expressionTypes as $exprString => $expressionTypeHolder) { @@ -1137,7 +1137,7 @@ private function resolveTypeOfNewWorldHandlerNode(Expr $node): Type // expression reads, e.g. array_filter pricing its callback body // per constant element) must re-price the node on that scope - // the memoized walk-position type answers a different question - $counterfactualAsk = !$result->askScopeVariableStateMatches($scope, $scope->nativeTypesPromoted); + $counterfactualAsk = !$result->askScopeVariableStateMatches($scope, $scope->nativeTypesPromoted, false); if (!$counterfactualAsk) { return $result->getTypeOnScope($scope, $scope->nativeTypesPromoted); } @@ -1153,7 +1153,7 @@ private function resolveTypeOfNewWorldHandlerNode(Expr $node): Type // whose result NodeScopeResolver stores without an eager type. // getClosureType()'s own depth guard answers the self-by-ref ask. if ($node instanceof Expr\Closure || $node instanceof Expr\ArrowFunction) { - return $this->services->container->getByType(ClosureTypeResolver::class)->getClosureType($scope, $node, false, $storage); + return $this->services->container->getByType(ClosureTypeResolver::class)->getClosureType($scope, $node, false, $storage, null); } if (!$counterfactualAsk && $storage !== null && $storage->findExpressionResult($node) !== null) { @@ -2460,7 +2460,7 @@ public function enterAnonymousFunction( ?array $nativeCallableParameters = null, ): self { - $anonymousFunctionReflection = $this->services->container->getByType(ClosureTypeResolver::class)->getClosureType($this, $closure, true, $this->getCurrentExpressionResultStorage()); + $anonymousFunctionReflection = $this->services->container->getByType(ClosureTypeResolver::class)->getClosureType($this, $closure, true, $this->getCurrentExpressionResultStorage(), null); $scope = $this->enterAnonymousFunctionWithoutReflection($closure, $callableParameters, $nativeCallableParameters); @@ -2687,7 +2687,7 @@ private function invalidateStaticExpressions(array $expressionTypes): array */ public function enterArrowFunction(Expr\ArrowFunction $arrowFunction, ?array $callableParameters, ?array $nativeCallableParameters = null): self { - $anonymousFunctionReflection = $this->services->container->getByType(ClosureTypeResolver::class)->getClosureType($this, $arrowFunction, true, $this->getCurrentExpressionResultStorage()); + $anonymousFunctionReflection = $this->services->container->getByType(ClosureTypeResolver::class)->getClosureType($this, $arrowFunction, true, $this->getCurrentExpressionResultStorage(), null); $scope = $this->enterArrowFunctionWithoutReflection($arrowFunction, $callableParameters, $nativeCallableParameters); @@ -3000,7 +3000,7 @@ public function enterCatchType(Type $catchType, ?string $variableName): self ); } - public function enterExpressionAssign(Expr $expr, bool $isPlainWrite = true): self + public function enterExpressionAssign(Expr $expr, bool $isPlainWrite): self { $exprString = $this->getNodeKey($expr); $currentlyAssignedExpressions = $this->currentlyAssignedExpressions; @@ -4369,7 +4369,7 @@ private function collectAbsorbedClosures(self $ours, self $theirs): ?TemplateArg return $constraints; } - private function mergeWithVariableState(?self $otherScope, bool $preserveVacuousConditionals = false): self + private function mergeWithVariableState(?self $otherScope, bool $preserveVacuousConditionals): self { if ($otherScope === null || $this === $otherScope) { return $this; @@ -4869,7 +4869,7 @@ public function processAlwaysIterableForeachScopeWithoutPollute(self $finalScope /** * @param array|null $writableVariableNames variables the loop can write, null when unknown */ - public function generalizeWith(self $otherScope, ?array $writableVariableNames = null): self + public function generalizeWith(self $otherScope, ?array $writableVariableNames): self { return $this->generalizeWithVariableState($otherScope, $writableVariableNames)->addTemplateArgumentConstraints($otherScope->getTemplateArgumentConstraints()); } @@ -4949,7 +4949,7 @@ private function generalizeVariableTypeHolders( $newVariableTypeHolders = []; foreach ($variableTypeHolders as $variableExprString => $variableTypeHolder) { foreach ($generalizedExpressions as $generalizedExprString => $generalizedExpr) { - if (!ScopeOps::shouldInvalidateExpression($this, $this->services->exprPrinter, $generalizedExprString, $generalizedExpr, $variableTypeHolder->getExpr(), $variableExprString)) { + if (!ScopeOps::shouldInvalidateExpression($this, $this->services->exprPrinter, $generalizedExprString, $generalizedExpr, $variableTypeHolder->getExpr(), $variableExprString, false, null, false)) { continue; } diff --git a/src/Analyser/NodeScopeResolver.php b/src/Analyser/NodeScopeResolver.php index b85f94a6b81..e9f6fc5754a 100644 --- a/src/Analyser/NodeScopeResolver.php +++ b/src/Analyser/NodeScopeResolver.php @@ -579,6 +579,14 @@ public function processExprOnDemand(Expr $expr, MutatingScope $scope, Expression specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), type: $mixed, nativeType: $mixed, + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + argsResult: null, + variableFlow: null, + dependencies: null, ); } @@ -778,7 +786,7 @@ public function processExprNode( // re-processes the node on its own scope instead. In CONSUME mode the // divergence is intentional (an ensured-non-null device) and the // stored result is consumed unconditionally, re-anchored below. - if ($storedResult !== null && ($consume || $storedResult->askScopeVariableStateMatches($scope, $scope->nativeTypesPromoted))) { + if ($storedResult !== null && ($consume || $storedResult->askScopeVariableStateMatches($scope, $scope->nativeTypesPromoted, false))) { // a foreign-position answer must not thread its original walk // scopes into THIS walk - re-anchor it to the asking position so // subsequent operands keep evaluating on the asking scope @@ -843,6 +851,14 @@ private function processExprNodeInternal( typeCallback: static fn (bool $nativeTypesPromoted): Type => ($nativeTypesPromoted ? $newExprResult->getNativeType() : $newExprResult->getType()), specifyTypesCallback: SpecifiedTypes::emptySpecifyCallback(), dependencies: $newExprResult->getDependencies(), + containsNullsafe: false, + issetabilityDescriptor: null, + truthyScopeOverrideResult: null, + falseyScopeOverrideResult: null, + createTypesCallback: null, + type: null, + nativeType: null, + argsResult: null, ); $this->storeExpressionResult($storage, $expr, $expressionResult); return $expressionResult; diff --git a/src/Analyser/ParametersProcessor.php b/src/Analyser/ParametersProcessor.php index 3f146ce1228..4e88cdaa695 100644 --- a/src/Analyser/ParametersProcessor.php +++ b/src/Analyser/ParametersProcessor.php @@ -42,7 +42,7 @@ public function processParams( continue; } - $dependencies[] = $nodeScopeResolver->processExprNode($stmt, $param->default, $scope, $storage, $nodeCallback, ExpressionContext::createDeep())->getDependencies(); + $dependencies[] = $nodeScopeResolver->processExprNode($stmt, $param->default, $scope, $storage, $nodeCallback, ExpressionContext::createDeep(true))->getDependencies(); } return Dependencies::merge(...$dependencies); diff --git a/src/Analyser/PreparedAssignTarget.php b/src/Analyser/PreparedAssignTarget.php index 40b111cb1b9..8d59580c734 100644 --- a/src/Analyser/PreparedAssignTarget.php +++ b/src/Analyser/PreparedAssignTarget.php @@ -55,22 +55,22 @@ public function __construct( private array $throwPoints, private array $impurePoints, private bool $isAlwaysTerminating, - private ?Expr $rootVar = null, - private ?ExpressionResult $varResult = null, - private ?array $dimFetchStack = null, - private ?Expr $assignedPropertyExpr = null, - private ?array $offsetTypes = null, - private ?array $offsetNativeTypes = null, - private ?array $existingOffsetTypes = null, - private ?array $existingOffsetNativeTypes = null, - private ?ExpressionResult $offsetSetTargetResult = null, - private ?ExpressionResult $objectResult = null, - private ?string $propertyName = null, - private ?Type $propertyHolderType = null, - private ?ExpressionResult $targetReadResult = null, - private array $targetChainResults = [], - private ?ExpressionResult $variableNameResult = null, - private ?Dependencies $dependencies = null, + private ?Expr $rootVar, + private ?ExpressionResult $varResult, + private ?array $dimFetchStack, + private ?Expr $assignedPropertyExpr, + private ?array $offsetTypes, + private ?array $offsetNativeTypes, + private ?array $existingOffsetTypes, + private ?array $existingOffsetNativeTypes, + private ?ExpressionResult $offsetSetTargetResult, + private ?ExpressionResult $objectResult, + private ?string $propertyName, + private ?Type $propertyHolderType, + private ?ExpressionResult $targetReadResult, + private array $targetChainResults, + private ?ExpressionResult $variableNameResult, + private ?Dependencies $dependencies, ) { } diff --git a/src/Analyser/PropertyHookThrowPointsResolver.php b/src/Analyser/PropertyHookThrowPointsResolver.php index ca62060cfb2..028216cd038 100644 --- a/src/Analyser/PropertyHookThrowPointsResolver.php +++ b/src/Analyser/PropertyHookThrowPointsResolver.php @@ -56,7 +56,7 @@ public function getThrowPointsFromPropertyHook( } if ($this->implicitThrows) { - return [InternalThrowPoint::createImplicit($scope, $propertyFetch)]; + return [InternalThrowPoint::createImplicit($scope, $propertyFetch, null)]; } return []; @@ -70,7 +70,7 @@ public function getThrowPointsFromPropertyHook( return [InternalThrowPoint::createExplicit($scope, $throwType, $propertyFetch, true)]; } } elseif ($this->implicitThrows) { - return [InternalThrowPoint::createImplicit($scope, $propertyFetch)]; + return [InternalThrowPoint::createImplicit($scope, $propertyFetch, null)]; } return []; diff --git a/src/Analyser/PropertyHooksProcessor.php b/src/Analyser/PropertyHooksProcessor.php index 9f1b16ceed8..2bf7c50759d 100644 --- a/src/Analyser/PropertyHooksProcessor.php +++ b/src/Analyser/PropertyHooksProcessor.php @@ -98,7 +98,7 @@ public function processPropertyHooks( $propertyReflection = $classReflection->getNativeProperty($propertyName); - $dependencies[] = Dependencies::create($hookScope->getFile(), DependencyTypes::ofDeclaration($hookReflection, false)); + $dependencies[] = Dependencies::create($hookScope->getFile(), DependencyTypes::ofDeclaration($hookReflection, false), [], [], [], []); $nodeScopeResolver->callNodeCallback($nodeCallback, new InPropertyHookNode( $classReflection, $hookReflection, diff --git a/src/Analyser/ResultCache/ResultCache.php b/src/Analyser/ResultCache/ResultCache.php index cde318c1d01..86b1feafe8f 100644 --- a/src/Analyser/ResultCache/ResultCache.php +++ b/src/Analyser/ResultCache/ResultCache.php @@ -51,7 +51,7 @@ public function __construct( private CachedExportedNodes $cachedExportedNodes, private array $projectExtensionFiles, private array $currentFileHashes, - private array $collectedDataRuleResults = [], + private array $collectedDataRuleResults, ) { } diff --git a/src/Analyser/ResultCache/ResultCacheManager.php b/src/Analyser/ResultCache/ResultCacheManager.php index 0296a633cc5..b6728935746 100644 --- a/src/Analyser/ResultCache/ResultCacheManager.php +++ b/src/Analyser/ResultCache/ResultCacheManager.php @@ -292,6 +292,7 @@ private function fullAnalysis( cachedExportedNodes: CachedExportedNodes::createEmpty(), projectExtensionFiles: [], currentFileHashes: $currentFileHashes, + collectedDataRuleResults: [], ); } diff --git a/src/Analyser/RicherScopeGetTypeHelper.php b/src/Analyser/RicherScopeGetTypeHelper.php index 16a05eaf4a2..da3644a99c3 100644 --- a/src/Analyser/RicherScopeGetTypeHelper.php +++ b/src/Analyser/RicherScopeGetTypeHelper.php @@ -30,7 +30,7 @@ public function __construct( /** * @return TypeResult */ - public function getIdenticalResult(Scope $scope, Identical $expr, ?NodeScopeResolver $nodeScopeResolver = null, ?Type $leftType = null, ?Type $rightType = null): TypeResult + public function getIdenticalResult(Scope $scope, Identical $expr, ?NodeScopeResolver $nodeScopeResolver, ?Type $leftType, ?Type $rightType): TypeResult { if ( $expr->left instanceof Variable @@ -89,7 +89,7 @@ public function getIdenticalResult(Scope $scope, Identical $expr, ?NodeScopeReso /** * @return TypeResult */ - public function getNotIdenticalResult(Scope $scope, Node\Expr\BinaryOp\NotIdentical $expr, ?NodeScopeResolver $nodeScopeResolver = null, ?Type $leftType = null, ?Type $rightType = null): TypeResult + public function getNotIdenticalResult(Scope $scope, Node\Expr\BinaryOp\NotIdentical $expr, ?NodeScopeResolver $nodeScopeResolver, ?Type $leftType, ?Type $rightType): TypeResult { $identicalResult = $this->getIdenticalResult($scope, new Identical($expr->left, $expr->right), $nodeScopeResolver, $leftType, $rightType); $identicalType = $identicalResult->type; diff --git a/src/Analyser/ScopeFactory.php b/src/Analyser/ScopeFactory.php index 604c95500cf..f77b5899a4c 100644 --- a/src/Analyser/ScopeFactory.php +++ b/src/Analyser/ScopeFactory.php @@ -23,7 +23,7 @@ public function __construct( */ public function create(ScopeContext $context, ?callable $nodeCallback = null): MutatingScope { - return $this->internalScopeFactoryFactory->create($nodeCallback)->create($context); + return $this->internalScopeFactoryFactory->create($nodeCallback, false, null)->create($context); } } diff --git a/src/Analyser/ScopeOps.php b/src/Analyser/ScopeOps.php index 268620c4706..be4c65a9147 100644 --- a/src/Analyser/ScopeOps.php +++ b/src/Analyser/ScopeOps.php @@ -201,7 +201,7 @@ public static function scopeWith( * @param array $differingKeys * @return array */ - public static function mergeVariableHolders(array $ourVariableTypeHolders, array $theirVariableTypeHolders, array &$differingKeys = []): array + public static function mergeVariableHolders(array $ourVariableTypeHolders, array $theirVariableTypeHolders, array &$differingKeys): array { $intersectedVariableTypeHolders = []; $globalVariableCallback = static fn (Node $node) => $node instanceof Variable && is_string($node->name) && in_array($node->name, Scope::SUPERGLOBAL_VARIABLES, true); @@ -314,13 +314,15 @@ public static function finishMerge( unset($theirNativeExpressionTypes[$exprString]); } + $differingNativeKeys = []; + return [ $mergedExpressionTypes, // + instead of array_merge: the key sets are disjoint (matching entries were // unset from both native maps above), and array_merge would renumber // integer-coerced expression keys (an expression printing as '5' is stored // under int key 5), corrupting them. The native implementation preserves keys. - $mergedNativeExpressionTypes + array_filter(self::mergeVariableHolders($ourNativeExpressionTypes, $theirNativeExpressionTypes), $filter), + $mergedNativeExpressionTypes + array_filter(self::mergeVariableHolders($ourNativeExpressionTypes, $theirNativeExpressionTypes, $differingNativeKeys), $filter), ]; } @@ -709,7 +711,7 @@ public static function invalidateExpressionEntries( array $expressionTypes, array $nativeExpressionTypes, array $conditionalExpressions, - bool $keepPropertyFetches = false, + bool $keepPropertyFetches, ): ?array { $invalidated = false; @@ -782,7 +784,7 @@ public static function invalidateExpressionEntries( $shouldKeep = true; $conditionalTypeHolders = $holder->getConditionExpressionTypeHolders(); foreach ($conditionalTypeHolders as $conditionalTypeHolderExprString => $conditionalTypeHolder) { - if (self::shouldInvalidateExpression($scope, $exprPrinter, $exprStringToInvalidate, $expressionToInvalidate, $conditionalTypeHolder->getExpr(), $conditionalTypeHolderExprString, invalidatingClass: $invalidatingClass, keepPropertyFetches: $keepPropertyFetches)) { + if (self::shouldInvalidateExpression($scope, $exprPrinter, $exprStringToInvalidate, $expressionToInvalidate, $conditionalTypeHolder->getExpr(), $conditionalTypeHolderExprString, invalidatingClass: $invalidatingClass, keepPropertyFetches: $keepPropertyFetches, requireMoreCharacters: false)) { $invalidated = true; $shouldKeep = false; break; @@ -869,7 +871,7 @@ private static function containsExpressionToInvalidate(Scope $scope, ExprPrinter /** * Mirrors the former MutatingScope::shouldInvalidateExpression(). */ - public static function shouldInvalidateExpression(MutatingScope $scope, ExprPrinter $exprPrinter, string $exprStringToInvalidate, Expr $exprToInvalidate, Expr $expr, string $exprString, bool $requireMoreCharacters = false, ?ClassReflection $invalidatingClass = null, bool $keepPropertyFetches = false): bool + public static function shouldInvalidateExpression(MutatingScope $scope, ExprPrinter $exprPrinter, string $exprStringToInvalidate, Expr $exprToInvalidate, Expr $expr, string $exprString, bool $requireMoreCharacters, ?ClassReflection $invalidatingClass, bool $keepPropertyFetches): bool { if ( $expr instanceof IntertwinedVariableByReferenceWithExpr diff --git a/src/Analyser/StatementsHandler.php b/src/Analyser/StatementsHandler.php index e8db16423f1..760790b77e3 100644 --- a/src/Analyser/StatementsHandler.php +++ b/src/Analyser/StatementsHandler.php @@ -251,7 +251,7 @@ private function resolveBackwardGotoScope( } if ($count >= NodeScopeResolver::GENERALIZE_AFTER_ITERATION) { - $bodyScope = $prevScope->generalizeWith($bodyScope); + $bodyScope = $prevScope->generalizeWith($bodyScope, null); } $count++; } while ($count < NodeScopeResolver::LOOP_SCOPE_ITERATIONS); @@ -394,6 +394,7 @@ public function doProcessStmtNodes( $parentNode, $statementResult->toPublic(), $returnTypeNode !== null, + null, ), $scope, $storage); } @@ -798,9 +799,9 @@ private function processBodyStmtNodesTwoPass( } $parentFrame = $scope->getCurrentTemplateArgumentFrame(); $parentConstraints = $scope->getTemplateArgumentConstraints(); - $frame = new TemplateArgumentFrame($parentFrame, closureSignatureBody: $parentNode, closureSignatureStmts: $stmts); + $frame = new TemplateArgumentFrame($parentFrame, closureSignatureBody: $parentNode, closureSignatureStmts: $stmts, resolutions: null, siteStatementIndexes: [], settledClosureSites: [], observingClosures: false, byRefSites: [], staticVariableTypes: [], staticVariableConditionalExpressions: []); if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('bodiesWalked'); + TemplateArgumentStats::increment('bodiesWalked', 1); TemplateArgumentStats::increment('statementsTotal', count($stmts)); } $scope = $scope->withTemplateArgumentFrame($frame)->withTemplateArgumentConstraints(null); @@ -856,7 +857,7 @@ private function processBodyStmtNodesTwoPass( } if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('bodiesWithSites'); + TemplateArgumentStats::increment('bodiesWithSites', 1); TemplateArgumentStats::increment('statementsReplayed', $firstSiteStatementIndex); } // the second pass: the statements before the first site stand as @@ -877,7 +878,7 @@ private function processBodyStmtNodesTwoPass( if ($differingRoots === [] && !$frame->hasSiteAtOrAfter($i)) { // converged with the observation pass: the rest of its recording stands if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('earlyExits'); + TemplateArgumentStats::increment('earlyExits', 1); TemplateArgumentStats::increment('statementsReplayed', $stmtCount - $i); } $nodeScopeResolver->replayRecordingRange($recording, $offset, $recording->count(), $nodeCallback, $storage, $scope); @@ -907,14 +908,14 @@ private function processBodyStmtNodesTwoPass( } if ($reWalk) { if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('statementsReWalked'); + TemplateArgumentStats::increment('statementsReWalked', 1); } $this->processStatementStep($nodeScopeResolver, $parentNode, $stmts, $i, $stmt, $state, $storage, $nodeCallback, $context, true); continue; } if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('statementsReplayed'); + TemplateArgumentStats::increment('statementsReplayed', 1); } $nodeScopeResolver->replayRecordingRange($recording, $offset, $nextOffset, $nodeCallback, $storage, $scope); $this->appendRecordedStatementResults($state, $recordedEntry, $recordedExit); @@ -985,7 +986,7 @@ private function inferStaticVariableTypes( [$type, $nativeType] = $types[$name]; $siteTypes[spl_object_id($var)] = [$var, $type, $nativeType]; } - $frame = (new TemplateArgumentFrame($parentFrame, closureSignatureBody: $parentNode, closureSignatureStmts: $stmts))->withStaticVariableTypes($siteTypes, $staticStatementIndexes, $conditionalExpressions); + $frame = (new TemplateArgumentFrame($parentFrame, closureSignatureBody: $parentNode, closureSignatureStmts: $stmts, resolutions: null, siteStatementIndexes: [], settledClosureSites: [], observingClosures: false, byRefSites: [], staticVariableTypes: [], staticVariableConditionalExpressions: []))->withStaticVariableTypes($siteTypes, $staticStatementIndexes, $conditionalExpressions); $state = clone $entries[$start][0]; $state->scope = $state->scope->withTemplateArgumentFrame($frame); @@ -1140,8 +1141,8 @@ private function replayStaticVariableWalk( [$start, $state, $walkRecording, $walkStorage, $walkLog] = $staticWalk; $stmtCount = count($stmts); if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('bodiesWithSites'); - TemplateArgumentStats::increment('staticVariableWalksReplayed'); + TemplateArgumentStats::increment('bodiesWithSites', 1); + TemplateArgumentStats::increment('staticVariableWalksReplayed', 1); } $nodeScopeResolver->replayRecordingRange($recording, 0, $entries[$start][1], $nodeCallback, $storage, $scope); $storage->mergeResults($walkStorage); @@ -1663,14 +1664,14 @@ private function observeClosureSignatures( || $this->statementMentionsAnyVariable($stmt, $differingRoots) ) { if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('closureObservationStatements'); + TemplateArgumentStats::increment('closureObservationStatements', 1); } $this->processStatementStep($nodeScopeResolver, $parentNode, $stmts, $i, $stmt, $state, $storage, $nodeCallback, $context, true); continue; } if (TemplateArgumentStats::$enabled) { - TemplateArgumentStats::increment('closureObservationStatementsReplayed'); + TemplateArgumentStats::increment('closureObservationStatementsReplayed', 1); } $recordedExit = $entries[$i + 1][0]; $this->appendRecordedStatementResults($state, $recordedEntry, $recordedExit); @@ -1877,7 +1878,7 @@ public function getVarTagDependencies(Node\Stmt $stmt, MutatingScope $scope): ?D } } - return Dependencies::create($scope->getFile(), $types); + return Dependencies::create($scope->getFile(), $types, [], [], [], []); } /** diff --git a/src/Analyser/StmtHandler/BreakContinueHandler.php b/src/Analyser/StmtHandler/BreakContinueHandler.php index 416eef1ea48..b568ff61a13 100644 --- a/src/Analyser/StmtHandler/BreakContinueHandler.php +++ b/src/Analyser/StmtHandler/BreakContinueHandler.php @@ -60,6 +60,7 @@ public function processStmt( ], throwPoints: $throwPoints, impurePoints: $impurePoints, variableFlow: VariableFlow::exit( $stmt instanceof Break_ ? VariableFlow::BREAK : VariableFlow::CONTINUE, $stmt->num instanceof Int_ ? $stmt->num->value : 1, + null, ), dependencies: Dependencies::merge(...$dependencies)); } diff --git a/src/Analyser/StmtHandler/ClassLikeHandler.php b/src/Analyser/StmtHandler/ClassLikeHandler.php index 88ae6f66543..e3e310df5dd 100644 --- a/src/Analyser/StmtHandler/ClassLikeHandler.php +++ b/src/Analyser/StmtHandler/ClassLikeHandler.php @@ -153,7 +153,7 @@ public function processStmt( $declarationDependencies, $attributesDependencies, // the code of a trait is analysed as a part of every class using it - Dependencies::create($classScope->getFile(), usedTraits: array_values($classReflection->getTraits(true))), + Dependencies::create($classScope->getFile(), usedTraits: array_values($classReflection->getTraits(true)), types: [], classNames: [], reflections: [], filePaths: []), $bodyResult->getDependencies(), )); } @@ -184,7 +184,7 @@ private function getDeclarationDependencies(MutatingScope $scope, ClassLike $stm } } - return Dependencies::create($scope->getFile(), classNames: $classNames); + return Dependencies::create($scope->getFile(), classNames: $classNames, types: [], reflections: [], filePaths: [], usedTraits: []); } private function getCurrentClassReflection(Node\Stmt\ClassLike $stmt, string $className, Scope $scope): ClassReflection diff --git a/src/Analyser/StmtHandler/ClassMethodHandler.php b/src/Analyser/StmtHandler/ClassMethodHandler.php index 1d07acea04c..cdab189eb49 100644 --- a/src/Analyser/StmtHandler/ClassMethodHandler.php +++ b/src/Analyser/StmtHandler/ClassMethodHandler.php @@ -135,7 +135,7 @@ public function processStmt( $phpDoc = $param->getDocComment()->getText(); } $promotedNativeType = $param->type !== null ? ParserNodeTypeToPHPStanType::resolve($param->type, $classReflection) : null; - $dependencies[] = Dependencies::create($methodScope->getFile(), [$promotedNativeType, $phpDocParameterTypes[$param->var->name] ?? null]); + $dependencies[] = Dependencies::create($methodScope->getFile(), [$promotedNativeType, $phpDocParameterTypes[$param->var->name] ?? null], [], [], [], []); $nodeScopeResolver->callNodeCallback($nodeCallback, new ClassPropertyNode( $param->var->name, $param->flags, @@ -172,7 +172,7 @@ public function processStmt( if (!$methodReflection instanceof PhpMethodFromParserNodeReflection) { throw new ShouldNotHappenException(); } - $dependencies[] = Dependencies::create($methodScope->getFile(), [...DependencyTypes::ofDeclaration($methodReflection, true), $methodReflection->getSelfOutType()]); + $dependencies[] = Dependencies::create($methodScope->getFile(), [...DependencyTypes::ofDeclaration($methodReflection, true), $methodReflection->getSelfOutType()], [], [], [], []); $nodeScopeResolver->callNodeCallback($nodeCallback, new InClassMethodNode($classReflection, $methodReflection, $stmt), $methodScope, $storage); } diff --git a/src/Analyser/StmtHandler/DoWhileHandler.php b/src/Analyser/StmtHandler/DoWhileHandler.php index f05e8967912..080b757776b 100644 --- a/src/Analyser/StmtHandler/DoWhileHandler.php +++ b/src/Analyser/StmtHandler/DoWhileHandler.php @@ -207,7 +207,7 @@ public function processStmt( throwPoints: array_merge($throwPoints, $bodyScopeResult->getThrowPoints()), impurePoints: array_merge($impurePoints, $bodyScopeResult->getImpurePoints()), // the body runs once, then may repeat or not whatever the condition says - variableFlow: VariableFlow::loop(null, $bodyScopeResult->getVariableFlow(), $condResult->getVariableFlow(), true, true), + variableFlow: VariableFlow::loop(null, $bodyScopeResult->getVariableFlow(), $condResult->getVariableFlow(), true, true, true), dependencies: Dependencies::merge($bodyScopeResult->getDependencies(), $condResult->getDependencies()), ); } diff --git a/src/Analyser/StmtHandler/ForHandler.php b/src/Analyser/StmtHandler/ForHandler.php index 7a95e2c5710..375ce2004b0 100644 --- a/src/Analyser/StmtHandler/ForHandler.php +++ b/src/Analyser/StmtHandler/ForHandler.php @@ -289,7 +289,7 @@ public function processStmt( $dependencies[] = $loopResult->getDependencies(); $loopScope = $loopResult->getScope(); } - $finalScope = $finalScope->generalizeWith($loopScope); + $finalScope = $finalScope->generalizeWith($loopScope, null); if ($lastCondExpr !== null) { // the loop condition narrows the post-loop scope to its falsey branch, @@ -349,7 +349,7 @@ public function processStmt( $update = VariableFlow::sequence(...$updateFlow); // the body may run or not whatever the condition says: a write in it // does not make an earlier write dead, and a usage in it counts - $loop = VariableFlow::loop($condition, $finalScopeResult->getVariableFlow(), $update, false, true); + $loop = VariableFlow::loop($condition, $finalScopeResult->getVariableFlow(), $update, false, true, true); $initWrites = VariableFlowBuilder::writes(VariableFlow::sequence(...$initFlow)); $bindings = []; foreach ($initWrites as $write) { diff --git a/src/Analyser/StmtHandler/ForeachHandler.php b/src/Analyser/StmtHandler/ForeachHandler.php index 2ba5323bf7b..daf17b6a0c0 100644 --- a/src/Analyser/StmtHandler/ForeachHandler.php +++ b/src/Analyser/StmtHandler/ForeachHandler.php @@ -110,7 +110,8 @@ public function processStmt( { $entryScope = $scope; if ($stmt->expr instanceof Variable && is_string($stmt->expr->name)) { - $scope = $this->varAnnotationProcessor->processVarAnnotation($scope, [$stmt->expr->name], $stmt); + $changed = false; + $scope = $this->varAnnotationProcessor->processVarAnnotation($scope, [$stmt->expr->name], $stmt, $changed); } $condResult = $nodeScopeResolver->processExprNode($stmt, $stmt->expr, $scope, $storage, $nodeCallback, ExpressionContext::createDeep($context->shouldResolveTemplateArguments())); $nodeScopeResolver->callNodeCallback($nodeCallback, $stmt, $entryScope, $storage); @@ -495,16 +496,16 @@ static function () use ($condResult, $emptyArrayType): Type { } $bindingFlow = VariableFlow::sequence( - $stmt->keyVar !== null ? VariableFlowBuilder::targetRead($stmt->keyVar, $storage, false) : null, - $stmt->keyVar !== null ? VariableFlowBuilder::targetWrite($stmt->keyVar, VariableWrite::KIND_FOREACH_KEY, $finalScope, $storage) : null, - VariableFlowBuilder::targetRead($stmt->valueVar, $storage, false), - VariableFlowBuilder::targetWrite($stmt->valueVar, $stmt->keyVar !== null ? VariableWrite::KIND_FOREACH_VALUE_WITH_KEY : VariableWrite::KIND_FOREACH_VALUE, $finalScope, $storage), + $stmt->keyVar !== null ? VariableFlowBuilder::targetRead($stmt->keyVar, $storage, false, null) : null, + $stmt->keyVar !== null ? VariableFlowBuilder::targetWrite($stmt->keyVar, VariableWrite::KIND_FOREACH_KEY, $finalScope, $storage, null) : null, + VariableFlowBuilder::targetRead($stmt->valueVar, $storage, false, null), + VariableFlowBuilder::targetWrite($stmt->valueVar, $stmt->keyVar !== null ? VariableWrite::KIND_FOREACH_VALUE_WITH_KEY : VariableWrite::KIND_FOREACH_VALUE, $finalScope, $storage, null), $stmt->byRef && $stmt->valueVar instanceof Variable && is_string($stmt->valueVar->name) ? VariableFlow::escape($stmt->valueVar->name) : null, ); // the body may run or not whatever the iterated type says: a write in it // does not make an earlier write dead, and a read in it counts even // when the iterated value is inferred empty - $loopFlow = VariableFlow::loop($traversableThrowPoint !== null ? VariableFlow::throwing($traversableThrowPoint->getType(), true) : null, VariableFlow::sequence($bindingFlow, $finalScopeResult->getVariableFlow()), null, false, true); + $loopFlow = VariableFlow::loop($traversableThrowPoint !== null ? VariableFlow::throwing($traversableThrowPoint->getType(), true, false) : null, VariableFlow::sequence($bindingFlow, $finalScopeResult->getVariableFlow()), null, false, true, true); $bindingWrites = VariableFlowBuilder::writes($bindingFlow); $bindings = []; foreach ($bindingWrites as $write) { @@ -526,7 +527,7 @@ static function () use ($condResult, $emptyArrayType): Type { $condResult->getDependencies(), $finalScopeResult->getDependencies(), // the classes in the types of the keys and the values iterated over - Dependencies::create($entryScope->getFile(), [$stmt->keyVar !== null ? $entryScope->getIterableKeyType($foreachIterateeType) : null, $entryScope->getIterableValueType($foreachIterateeType)]), + Dependencies::create($entryScope->getFile(), [$stmt->keyVar !== null ? $entryScope->getIterableKeyType($foreachIterateeType) : null, $entryScope->getIterableValueType($foreachIterateeType)], [], [], [], []), ), ); } @@ -537,7 +538,8 @@ static function () use ($condResult, $emptyArrayType): Type { private function enterForeach(NodeScopeResolver $nodeScopeResolver, MutatingScope $scope, ExpressionResultStorage $storage, MutatingScope $originalScope, Foreach_ $stmt, Type $iterateeType, Type $nativeIterateeType, callable $nodeCallback): MutatingScope { if ($stmt->expr instanceof Variable && is_string($stmt->expr->name)) { - $scope = $this->varAnnotationProcessor->processVarAnnotation($scope, [$stmt->expr->name], $stmt); + $changed = false; + $scope = $this->varAnnotationProcessor->processVarAnnotation($scope, [$stmt->expr->name], $stmt, $changed); } if ( @@ -659,7 +661,8 @@ private function enterForeach(NodeScopeResolver $nodeScopeResolver, MutatingScop } } - return $this->varAnnotationProcessor->processVarAnnotation($scope, $vars, $stmt); + $changed = false; + return $this->varAnnotationProcessor->processVarAnnotation($scope, $vars, $stmt, $changed); } /** @@ -919,7 +922,7 @@ private function getTraversableForeachThrowPoint(MutatingScope $scope, Expr $ite } } - return InternalThrowPoint::createImplicit($scope, $iteratee); + return InternalThrowPoint::createImplicit($scope, $iteratee, null); } /** diff --git a/src/Analyser/StmtHandler/FunctionHandler.php b/src/Analyser/StmtHandler/FunctionHandler.php index 1c1611ee03f..e291832bf49 100644 --- a/src/Analyser/StmtHandler/FunctionHandler.php +++ b/src/Analyser/StmtHandler/FunctionHandler.php @@ -103,7 +103,7 @@ public function processStmt( throw new ShouldNotHappenException(); } - $dependencies[] = Dependencies::create($scope->getFile(), DependencyTypes::ofDeclaration($functionReflection, true)); + $dependencies[] = Dependencies::create($scope->getFile(), DependencyTypes::ofDeclaration($functionReflection, true), [], [], [], []); $nodeScopeResolver->callNodeCallback($nodeCallback, new InFunctionNode($functionReflection, $stmt), $functionScope, $storage); $gatheredReturnStatements = []; diff --git a/src/Analyser/StmtHandler/GlobalHandler.php b/src/Analyser/StmtHandler/GlobalHandler.php index cf83b087130..f88df3282b7 100644 --- a/src/Analyser/StmtHandler/GlobalHandler.php +++ b/src/Analyser/StmtHandler/GlobalHandler.php @@ -86,7 +86,7 @@ public function processStmt( $scope = $nodeScopeResolver->lookForSetAllowedUndefinedExpressions($scope, $var); $varResult = $nodeScopeResolver->processExprNode($stmt, $var, $scope, $storage, $nodeCallback, ExpressionContext::createDeep($context->shouldResolveTemplateArguments())); $dependencies[] = $varResult->getDependencies(); - $variableFlows[] = VariableFlow::sequence(VariableFlowBuilder::escapeRoot($var), VariableFlowBuilder::targetRead($var, $storage, false)); + $variableFlows[] = VariableFlow::sequence(VariableFlowBuilder::escapeRoot($var), VariableFlowBuilder::targetRead($var, $storage, false, null)); $impurePoints = array_merge($impurePoints, $varResult->getImpurePoints()); $scope = $nodeScopeResolver->lookForUnsetAllowedUndefinedExpressions($scope, $var); @@ -98,7 +98,8 @@ public function processStmt( $scope = $scope->assignVariable($var->name, $varType, $varType, TrinaryLogic::createYes()); $vars[] = $var->name; } - $scope = $this->varAnnotationProcessor->processVarAnnotation($scope, $vars, $stmt); + $changed = false; + $scope = $this->varAnnotationProcessor->processVarAnnotation($scope, $vars, $stmt, $changed); return new InternalStatementResult($scope, hasYield: false, isAlwaysTerminating: false, exitPoints: [], throwPoints: [], impurePoints: $impurePoints, variableFlow: VariableFlow::sequence(...$variableFlows), dependencies: Dependencies::merge(...$dependencies)); } diff --git a/src/Analyser/StmtHandler/PropertyHandler.php b/src/Analyser/StmtHandler/PropertyHandler.php index fbe313f8612..00fcd0b152e 100644 --- a/src/Analyser/StmtHandler/PropertyHandler.php +++ b/src/Analyser/StmtHandler/PropertyHandler.php @@ -104,7 +104,7 @@ public function processStmt( $scope, $storage, ); - $dependencies[] = Dependencies::create($scope->getFile(), [$nativePropertyType, $phpDocType]); + $dependencies[] = Dependencies::create($scope->getFile(), [$nativePropertyType, $phpDocType], [], [], [], []); } if (count($stmt->hooks) > 0) { diff --git a/src/Analyser/StmtHandler/ReturnHandler.php b/src/Analyser/StmtHandler/ReturnHandler.php index 35b38b81e00..12031fd7ce7 100644 --- a/src/Analyser/StmtHandler/ReturnHandler.php +++ b/src/Analyser/StmtHandler/ReturnHandler.php @@ -76,7 +76,7 @@ public function processStmt( new InternalStatementExitPoint($stmt, $scope), ], throwPoints: $throwPoints, impurePoints: $impurePoints, variableFlow: VariableFlow::sequence( $variableFlow, - VariableFlow::exit(VariableFlow::RETURN, name: $stmt->expr instanceof Variable && is_string($stmt->expr->name) ? $stmt->expr->name : null), + VariableFlow::exit(VariableFlow::RETURN, name: $stmt->expr instanceof Variable && is_string($stmt->expr->name) ? $stmt->expr->name : null, level: 1), ), dependencies: Dependencies::merge(...$dependencies)); } diff --git a/src/Analyser/StmtHandler/StaticVariableHandler.php b/src/Analyser/StmtHandler/StaticVariableHandler.php index cd06719e02b..8608af3ebd3 100644 --- a/src/Analyser/StmtHandler/StaticVariableHandler.php +++ b/src/Analyser/StmtHandler/StaticVariableHandler.php @@ -80,7 +80,7 @@ public function processStmt( $impurePoints = array_merge($impurePoints, $defaultExprResult->getImpurePoints()); } - $scope = $scope->enterExpressionAssign($var->var); + $scope = $scope->enterExpressionAssign($var->var, true); $variableFlows[] = VariableFlow::escape($var->var->name); $varResult = $nodeScopeResolver->processExprNode($stmt, $var->var, $scope, $storage, $nodeCallback, ExpressionContext::createDeep($context->shouldResolveTemplateArguments())); $dependencies[] = $varResult->getDependencies(); @@ -99,7 +99,8 @@ public function processStmt( $vars[] = $var->var->name; } - $scope = $this->varAnnotationProcessor->processVarAnnotation($scope, $vars, $stmt); + $changed = false; + $scope = $this->varAnnotationProcessor->processVarAnnotation($scope, $vars, $stmt, $changed); // how the types of a run of `static` variables depend on each other - // see StaticVariableInference::getRuns() diff --git a/src/Analyser/StmtHandler/TraitHandler.php b/src/Analyser/StmtHandler/TraitHandler.php index ac9b82ea70d..1d61d9632a3 100644 --- a/src/Analyser/StmtHandler/TraitHandler.php +++ b/src/Analyser/StmtHandler/TraitHandler.php @@ -56,7 +56,7 @@ public function processStmt( foreach ($this->reflectionProvider->getClass($stmt->namespacedName->toString())->getRequireImplementsTags() as $implementsTag) { $requiredTypes[] = $implementsTag->getType(); } - $dependencies = Dependencies::create($scope->getFile(), $requiredTypes); + $dependencies = Dependencies::create($scope->getFile(), $requiredTypes, [], [], [], []); } return new InternalStatementResult($scope, hasYield: false, isAlwaysTerminating: false, exitPoints: [], throwPoints: [], impurePoints: [], dependencies: $dependencies); diff --git a/src/Analyser/StmtHandler/TraitUseHandler.php b/src/Analyser/StmtHandler/TraitUseHandler.php index 9630ba19ff7..6394e3515d9 100644 --- a/src/Analyser/StmtHandler/TraitUseHandler.php +++ b/src/Analyser/StmtHandler/TraitUseHandler.php @@ -112,7 +112,7 @@ private function getDependencies(MutatingScope $scope, Node\Stmt\TraitUse $stmt) } } - return Dependencies::create($scope->getFile(), $types, $classNames); + return Dependencies::create($scope->getFile(), $types, $classNames, [], [], []); } /** diff --git a/src/Analyser/StmtHandler/TryCatchHandler.php b/src/Analyser/StmtHandler/TryCatchHandler.php index c41c2168982..4aa38073d1b 100644 --- a/src/Analyser/StmtHandler/TryCatchHandler.php +++ b/src/Analyser/StmtHandler/TryCatchHandler.php @@ -110,7 +110,7 @@ public function processStmt( foreach ($catchNode->types as $catchNodeType) { $caughtClassNames[] = $scope->resolveName($catchNodeType); } - $dependencies[] = Dependencies::create($scope->getFile(), classNames: $caughtClassNames); + $dependencies[] = Dependencies::create($scope->getFile(), classNames: $caughtClassNames, types: [], reflections: [], filePaths: [], usedTraits: []); $originalCatchTypes = []; $catchTypes = []; @@ -270,7 +270,7 @@ public function processStmt( $dependencies[] = $catchScopeResult->getDependencies(); $catchScopeForFinally = $catchScopeResult->getScope(); $blockScopes[] = $catchScopeForFinally; - $catchFlows[] = [$originalCatchType, VariableFlow::sequence($catchNode->var !== null ? VariableFlowBuilder::targetWrite($catchNode->var, VariableWrite::KIND_CATCH, $catchScopeForFinally, $storage) : null, $catchScopeResult->getVariableFlow())]; + $catchFlows[] = [$originalCatchType, VariableFlow::sequence($catchNode->var !== null ? VariableFlowBuilder::targetWrite($catchNode->var, VariableWrite::KIND_CATCH, $catchScopeForFinally, $storage, null) : null, $catchScopeResult->getVariableFlow())]; $finalScope = $catchScopeResult->isAlwaysTerminating() ? $finalScope : $catchScopeResult->getScope()->mergeWith($finalScope); $alwaysTerminating = $alwaysTerminating && $catchScopeResult->isAlwaysTerminating(); diff --git a/src/Analyser/StmtHandler/UnsetHandler.php b/src/Analyser/StmtHandler/UnsetHandler.php index 79654c84c9e..7335aa0c467 100644 --- a/src/Analyser/StmtHandler/UnsetHandler.php +++ b/src/Analyser/StmtHandler/UnsetHandler.php @@ -78,14 +78,14 @@ public function processStmt( $scope = $nodeScopeResolver->lookForSetAllowedUndefinedExpressions($scope, $var); $exprResult = $nodeScopeResolver->processExprNode($stmt, $var, $scope, $storage, $nodeCallback, ExpressionContext::createDeep($context->shouldResolveTemplateArguments())->enterUnsetTarget()); $dependencies[] = $exprResult->getDependencies(); - $variableFlows[] = VariableFlowBuilder::targetRead($var, $storage, $this->hasDestructionSideEffects($exprResult->getType())); + $variableFlows[] = VariableFlowBuilder::targetRead($var, $storage, $this->hasDestructionSideEffects($exprResult->getType()), null); $root = $var; while ($root instanceof ArrayDimFetch) { $root = $root->var; } if ($root instanceof Expr\Variable && is_string($root->name)) { $dimResult = $var instanceof ArrayDimFetch && $var->dim !== null ? $storage->findExpressionResult($var->dim) : null; - $variableFlows[] = VariableFlow::discard(new VariableWrite($root->name, $var, spl_object_id($var), VariableWrite::KIND_ASSIGN, $var instanceof ArrayDimFetch, $dimResult !== null ? VariableWriteOffset::fromType($dimResult->getType()) : null, replacesOffset: !($var instanceof ArrayDimFetch) || $var->var === $root)); + $variableFlows[] = VariableFlow::discard(new VariableWrite($root->name, $var, spl_object_id($var), VariableWrite::KIND_ASSIGN, $var instanceof ArrayDimFetch, $dimResult !== null ? VariableWriteOffset::fromType($dimResult->getType()) : null, replacesOffset: !($var instanceof ArrayDimFetch) || $var->var === $root, parentId: null)); } $scope = $exprResult->getScope(); $scope = $nodeScopeResolver->lookForUnsetAllowedUndefinedExpressions($scope, $var); diff --git a/src/Analyser/StmtHandler/WhileHandler.php b/src/Analyser/StmtHandler/WhileHandler.php index aa198450901..b2b47fb9a58 100644 --- a/src/Analyser/StmtHandler/WhileHandler.php +++ b/src/Analyser/StmtHandler/WhileHandler.php @@ -256,7 +256,7 @@ public function processStmt( impurePoints: $impurePoints, // the body may run or not whatever the condition says: a write in // it does not make an earlier write dead, and a usage in it counts - variableFlow: VariableFlow::loop($bodyCondResult->getVariableFlow(), $finalScopeResult->getVariableFlow(), null, false, true), + variableFlow: VariableFlow::loop($bodyCondResult->getVariableFlow(), $finalScopeResult->getVariableFlow(), null, false, true, true), dependencies: Dependencies::merge($bodyCondResult->getDependencies(), $finalScopeResult->getDependencies()), ); } diff --git a/src/Analyser/VarAnnotationProcessor.php b/src/Analyser/VarAnnotationProcessor.php index 56c985e27ec..6a2685a298c 100644 --- a/src/Analyser/VarAnnotationProcessor.php +++ b/src/Analyser/VarAnnotationProcessor.php @@ -25,7 +25,7 @@ public function __construct( /** * @param array $variableNames */ - public function processVarAnnotation(MutatingScope $scope, array $variableNames, Node\Stmt $node, bool &$changed = false): MutatingScope + public function processVarAnnotation(MutatingScope $scope, array $variableNames, Node\Stmt $node, bool &$changed): MutatingScope { $function = $scope->getFunction(); $varTags = []; diff --git a/src/Analyser/VariableAccessFlow.php b/src/Analyser/VariableAccessFlow.php index cf728fef5ff..bcbeb7a3b13 100644 --- a/src/Analyser/VariableAccessFlow.php +++ b/src/Analyser/VariableAccessFlow.php @@ -17,11 +17,11 @@ final class VariableAccessFlow extends VariableFlow public function __construct( string $kind, public readonly string $name, - public readonly ?VariableWrite $write = null, - public readonly ?Type $type = null, - public readonly ?int $targetId = null, - public readonly bool $container = false, - public readonly mixed $offset = null, + public readonly ?VariableWrite $write, + public readonly ?Type $type, + public readonly ?int $targetId, + public readonly bool $container, + public readonly mixed $offset, ) { parent::__construct($kind); diff --git a/src/Analyser/VariableControlFlow.php b/src/Analyser/VariableControlFlow.php index 1fc64c7dd82..32108754eb4 100644 --- a/src/Analyser/VariableControlFlow.php +++ b/src/Analyser/VariableControlFlow.php @@ -23,20 +23,20 @@ final class VariableControlFlow extends VariableFlow */ public function __construct( string $kind, - public readonly array $children = [], - public readonly ?string $name = null, - public readonly ?Type $type = null, - public readonly int $level = 1, - public readonly bool $atLeastOnce = false, - public readonly bool $canExit = true, - public readonly array $catches = [], - public readonly ?ArrowFunction $arrow = null, - public readonly array $cases = [], - public readonly bool $canRepeat = true, - public readonly bool $canContainAnyThrowable = false, - public readonly Foreach_|For_|null $stmt = null, - public readonly array $bindings = [], - public readonly array $ownWrites = [], + public readonly array $children, + public readonly ?string $name, + public readonly ?Type $type, + public readonly int $level, + public readonly bool $atLeastOnce, + public readonly bool $canExit, + public readonly array $catches, + public readonly ?ArrowFunction $arrow, + public readonly array $cases, + public readonly bool $canRepeat, + public readonly bool $canContainAnyThrowable, + public readonly Foreach_|For_|null $stmt, + public readonly array $bindings, + public readonly array $ownWrites, ) { parent::__construct($kind); diff --git a/src/Analyser/VariableFlow.php b/src/Analyser/VariableFlow.php index 158d1ec2305..cde685d664b 100644 --- a/src/Analyser/VariableFlow.php +++ b/src/Analyser/VariableFlow.php @@ -80,17 +80,17 @@ public static function choice(?self ...$branches): ?self public static function arrow(ArrowFunction $arrow, ?self $body, ?self $outputs): self { - return new VariableControlFlow(self::ARROW, [$body, $outputs], arrow: $arrow); + return new VariableControlFlow(self::ARROW, [$body, $outputs], arrow: $arrow, name: null, type: null, level: 1, atLeastOnce: false, canExit: true, catches: [], cases: [], canRepeat: true, canContainAnyThrowable: false, stmt: null, bindings: [], ownWrites: []); } /** @param int|string|null $offset */ - public static function read(string $name, ?int $targetId = null, bool $container = false, $offset = null): ?self + public static function read(string $name, ?int $targetId, bool $container, $offset): ?self { if ($name === 'this' || in_array($name, Scope::SUPERGLOBAL_VARIABLES, true)) { return null; } - return new VariableAccessFlow(self::READ, $name, targetId: $targetId, container: $container, offset: $offset); + return new VariableAccessFlow(self::READ, $name, targetId: $targetId, container: $container, offset: $offset, write: null, type: null); } public static function conditional(?self $condition, ?self $if, ?self $else): ?self @@ -101,17 +101,17 @@ public static function conditional(?self $condition, ?self $if, ?self $else): ?s /** @param list $cases */ public static function switch(?self $condition, array $cases, bool $exhaustive): self { - return new VariableControlFlow(self::SWITCH, [$condition], canExit: !$exhaustive, cases: $cases); + return new VariableControlFlow(self::SWITCH, [$condition], canExit: !$exhaustive, cases: $cases, name: null, type: null, level: 1, atLeastOnce: false, catches: [], arrow: null, canRepeat: true, canContainAnyThrowable: false, stmt: null, bindings: [], ownWrites: []); } - public static function write(VariableWrite $write, ?Type $redundantType = null): self + public static function write(VariableWrite $write, ?Type $redundantType): self { - return new VariableAccessFlow($write->getParentId() === null ? self::WRITE : self::DEFINE, $write->getVariableName(), $write, $redundantType); + return new VariableAccessFlow($write->getParentId() === null ? self::WRITE : self::DEFINE, $write->getVariableName(), $write, $redundantType, null, false, null); } public static function discard(VariableWrite $write): self { - return new VariableAccessFlow(self::DISCARD, $write->getVariableName(), $write); + return new VariableAccessFlow(self::DISCARD, $write->getVariableName(), $write, null, null, false, null); } /** The enclosing expression consumes a write's inputs, without reading its target. */ @@ -122,34 +122,34 @@ public static function inputs(int $writeId, ?int $targetId): self public static function escape(string $name): self { - return new VariableAccessFlow(self::ESCAPE, $name); + return new VariableAccessFlow(self::ESCAPE, $name, null, null, null, false, null); } public static function mention(string $name): self { - return new VariableAccessFlow(self::MENTION, $name); + return new VariableAccessFlow(self::MENTION, $name, null, null, null, false, null); } /** @param self::READ_ALL|self::MENTION_ALL|self::OPAQUE $kind */ public static function all(string $kind): self { - return new VariableControlFlow($kind); + return new VariableControlFlow($kind, [], null, null, 1, false, true, [], null, [], true, false, null, [], []); } /** @param self::RETURN|self::BREAK|self::CONTINUE|self::STOP $kind */ - public static function exit(string $kind, int $level = 1, ?string $name = null): self + public static function exit(string $kind, int $level, ?string $name): self { - return new VariableControlFlow($kind, name: $name, level: $level); + return new VariableControlFlow($kind, name: $name, level: $level, children: [], type: null, atLeastOnce: false, canExit: true, catches: [], arrow: null, cases: [], canRepeat: true, canContainAnyThrowable: false, stmt: null, bindings: [], ownWrites: []); } - public static function throwing(Type $type, bool $canContinue, bool $canContainAnyThrowable = false): self + public static function throwing(Type $type, bool $canContinue, bool $canContainAnyThrowable): self { - return new VariableControlFlow(self::THROW, type: $type, canExit: $canContinue, canContainAnyThrowable: $canContainAnyThrowable); + return new VariableControlFlow(self::THROW, type: $type, canExit: $canContinue, canContainAnyThrowable: $canContainAnyThrowable, children: [], name: null, level: 1, atLeastOnce: false, catches: [], arrow: null, cases: [], canRepeat: true, stmt: null, bindings: [], ownWrites: []); } - public static function loop(?self $condition, ?self $body, ?self $update, bool $atLeastOnce, bool $canExit, bool $canRepeat = true): self + public static function loop(?self $condition, ?self $body, ?self $update, bool $atLeastOnce, bool $canExit, bool $canRepeat): self { - return new VariableControlFlow(self::LOOP, [$condition, $body, $update], atLeastOnce: $atLeastOnce, canExit: $canExit, canRepeat: $canRepeat); + return new VariableControlFlow(self::LOOP, [$condition, $body, $update], atLeastOnce: $atLeastOnce, canExit: $canExit, canRepeat: $canRepeat, name: null, type: null, level: 1, catches: [], arrow: null, cases: [], canContainAnyThrowable: false, stmt: null, bindings: [], ownWrites: []); } /** @@ -168,13 +168,13 @@ public static function loopStatement(Foreach_|For_ $stmt, ?self $flow, array $bi return $flow; } - return new VariableControlFlow(self::LOOP_STATEMENT, [$flow], stmt: $stmt, bindings: $bindings, ownWrites: $ownWrites); + return new VariableControlFlow(self::LOOP_STATEMENT, [$flow], stmt: $stmt, bindings: $bindings, ownWrites: $ownWrites, name: null, type: null, level: 1, atLeastOnce: false, canExit: true, catches: [], arrow: null, cases: [], canRepeat: true, canContainAnyThrowable: false); } /** @param list $catches */ public static function tryCatch(?self $body, array $catches, ?self $finally): self { - return new VariableControlFlow(self::TRY_CATCH, [$body, $finally], catches: $catches); + return new VariableControlFlow(self::TRY_CATCH, [$body, $finally], catches: $catches, name: null, type: null, level: 1, atLeastOnce: false, canExit: true, arrow: null, cases: [], canRepeat: true, canContainAnyThrowable: false, stmt: null, bindings: [], ownWrites: []); } } diff --git a/src/Analyser/VariableFlowBuilder.php b/src/Analyser/VariableFlowBuilder.php index 2f9be103c60..adeb031ef56 100644 --- a/src/Analyser/VariableFlowBuilder.php +++ b/src/Analyser/VariableFlowBuilder.php @@ -70,10 +70,10 @@ public static function child(?Node $node, ExpressionResultStorage $storage): ?Va return null; } - public static function targetRead(Expr $target, ExpressionResultStorage $storage, bool $read, ?int $targetId = null): ?VariableFlow + public static function targetRead(Expr $target, ExpressionResultStorage $storage, bool $read, ?int $targetId): ?VariableFlow { if ($target instanceof Expr\Variable) { - return is_string($target->name) ? ($read ? VariableFlow::read($target->name, $targetId) : null) : self::child($target->name, $storage); + return is_string($target->name) ? ($read ? VariableFlow::read($target->name, $targetId, false, null) : null) : self::child($target->name, $storage); } if ($target instanceof Expr\List_ || $target instanceof Expr\Array_) { return null; @@ -122,7 +122,7 @@ public static function writes(?VariableFlow $flow): array } /** @param VariableWrite::KIND_* $kind */ - public static function targetWrite(Expr $target, int $kind, MutatingScope $scope, ExpressionResultStorage $storage, ?Type $redundant = null): ?VariableFlow + public static function targetWrite(Expr $target, int $kind, MutatingScope $scope, ExpressionResultStorage $storage, ?Type $redundant): ?VariableFlow { if ($target instanceof Expr\List_ || $target instanceof Expr\Array_) { $writes = []; @@ -130,7 +130,7 @@ public static function targetWrite(Expr $target, int $kind, MutatingScope $scope if ($item === null) { continue; } - $writes[] = VariableFlow::sequence(self::child($item->key, $storage), self::targetRead($item->value, $storage, false), self::targetWrite($item->value, VariableWrite::KIND_LIST_ITEM, $scope, $storage), $item->byRef ? self::escapeRoot($item->value) : null); + $writes[] = VariableFlow::sequence(self::child($item->key, $storage), self::targetRead($item->value, $storage, false, null), self::targetWrite($item->value, VariableWrite::KIND_LIST_ITEM, $scope, $storage, null), $item->byRef ? self::escapeRoot($item->value) : null); } return VariableFlow::sequence(...$writes); } @@ -175,7 +175,7 @@ public static function writeSite(Expr $target, int $kind, MutatingScope $scope, if ($target->name === 'this' || in_array($target->name, Scope::SUPERGLOBAL_VARIABLES, true)) { return null; } - return new VariableWrite($target->name, $target, spl_object_id($target), $kind); + return new VariableWrite($target->name, $target, spl_object_id($target), $kind, false, null, null, true); } if (!$target instanceof Expr\ArrayDimFetch) { return null; @@ -196,7 +196,7 @@ public static function writeSite(Expr $target, int $kind, MutatingScope $scope, } $dimResult = $first->dim !== null ? $storage->findExpressionResult($first->dim) : null; $offset = $dimResult !== null ? VariableWriteOffset::fromType($dimResult->getType()) : null; - return new VariableWrite($root->name, $target, spl_object_id($target), $kind, true, $offset, replacesOffset: $first === $target); + return new VariableWrite($root->name, $target, spl_object_id($target), $kind, true, $offset, replacesOffset: $first === $target, parentId: null); } public static function escapeRoot(Expr $expr): ?VariableFlow diff --git a/src/Analyser/VariableFlowContext.php b/src/Analyser/VariableFlowContext.php index ba8c30b3ce6..c5f9d4fccff 100644 --- a/src/Analyser/VariableFlowContext.php +++ b/src/Analyser/VariableFlowContext.php @@ -17,10 +17,10 @@ final class VariableFlowContext */ public function __construct( public readonly array $return, - public readonly array $breaks = [], - public readonly array $continues = [], - public readonly array $catches = [], - public readonly array $uncaught = [], + public readonly array $breaks, + public readonly array $continues, + public readonly array $catches, + public readonly array $uncaught, ) { } diff --git a/src/Analyser/VariableLivenessResolver.php b/src/Analyser/VariableLivenessResolver.php index af9cf05481e..afc32a0acb8 100644 --- a/src/Analyser/VariableLivenessResolver.php +++ b/src/Analyser/VariableLivenessResolver.php @@ -129,7 +129,7 @@ public static function resolve(Node\FunctionLike $function, ?VariableFlow $flow) $self->escapedNames[$param->var->name] = true; continue; } - $imports[] = VariableFlow::write(new VariableWrite($param->var->name, $param->var, spl_object_id($param->var), VariableWrite::KIND_PARAMETER)); + $imports[] = VariableFlow::write(new VariableWrite($param->var->name, $param->var, spl_object_id($param->var), VariableWrite::KIND_PARAMETER, false, null, null, true), null); } if ($function instanceof Node\Expr\Closure) { foreach ($function->uses as $use) { @@ -140,14 +140,14 @@ public static function resolve(Node\FunctionLike $function, ?VariableFlow $flow) $self->escapedNames[$use->var->name] = true; continue; } - $imports[] = VariableFlow::write(new VariableWrite($use->var->name, $use->var, spl_object_id($use->var), VariableWrite::KIND_CLOSURE_USE)); + $imports[] = VariableFlow::write(new VariableWrite($use->var->name, $use->var, spl_object_id($use->var), VariableWrite::KIND_CLOSURE_USE, false, null, null, true), null); } } $body = VariableFlow::sequence(...[...$imports, $flow]); $self->collect($body); if ($self->writes !== [] && !$self->opaque) { $self->compileAccesses(); - $self->liveBefore($body, [], new VariableFlowContext([])); + $self->liveBefore($body, [], new VariableFlowContext([], [], [], [], [])); $self->resolveDependencies(); $self->resolveCoverage(); } @@ -245,7 +245,7 @@ private function liveBefore(?VariableFlow $flow, array $next, VariableFlowContex // a by-reference capture aliases the variable - the value it // holds at that point is observable through the alias if ($flow->kind === VariableFlow::ESCAPE && $this->loopStatements !== []) { - $next = $this->passBindingProbes($next, $flow->name, null); + $next = $this->passBindingProbes($next, $flow->name, null, false); } return $next + ($this->readKeys[spl_object_id($flow)] ?? []); } @@ -317,8 +317,8 @@ private function liveBefore(?VariableFlow $flow, array $next, VariableFlowContex return $names; } if ($flow->kind === VariableFlow::ARROW && $flow->arrow !== null) { - $outputs = $this->liveBefore($flow->children[1], [], new VariableFlowContext([])); - $names = $this->liveBefore($flow->children[0], $outputs, new VariableFlowContext($outputs, uncaught: $outputs)); + $outputs = $this->liveBefore($flow->children[1], [], new VariableFlowContext([], [], [], [], [])); + $names = $this->liveBefore($flow->children[0], $outputs, new VariableFlowContext($outputs, uncaught: $outputs, breaks: [], continues: [], catches: [])); foreach ($flow->arrow->params as $param) { if (!$param->var instanceof Node\Expr\Variable || !is_string($param->var->name)) { continue; @@ -457,7 +457,7 @@ private static function bindingProbe(VariableWrite $binding, bool $armed): strin * @param array $next * @return array */ - private function passBindingProbes(array $next, string $name, ?VariableWrite $write, bool $discard = false): array + private function passBindingProbes(array $next, string $name, ?VariableWrite $write, bool $discard): array { $prefix = sprintf("\0%s\0", $name); foreach (array_keys($next) as $key) { diff --git a/src/Analyser/VolatileExpressionHelper.php b/src/Analyser/VolatileExpressionHelper.php index b54b2767abc..457df8f5306 100644 --- a/src/Analyser/VolatileExpressionHelper.php +++ b/src/Analyser/VolatileExpressionHelper.php @@ -19,7 +19,7 @@ final class VolatileExpressionHelper private const VOLATILE_FUNCTION_NAMES = ['ob_get_level', 'openssl_error_string']; - private const EXISTENCE_CHECK_FUNCTION_NAMES = [ + public const EXISTENCE_CHECK_FUNCTION_NAMES = [ 'class_exists', 'interface_exists', 'trait_exists', @@ -130,8 +130,8 @@ public static function invalidateNegativeExistenceChecks( Scope $scope, array &$expressionTypes, array &$nativeExpressionTypes, - array $functionNames = self::EXISTENCE_CHECK_FUNCTION_NAMES, - ?string $declaredSymbolName = null, + array $functionNames, + ?string $declaredSymbolName, ): bool { $changed = false; diff --git a/src/Command/AnalyseApplication.php b/src/Command/AnalyseApplication.php index 78a8ea9cb53..83dc4cb1df7 100644 --- a/src/Command/AnalyseApplication.php +++ b/src/Command/AnalyseApplication.php @@ -248,6 +248,7 @@ private function runAnalyser( reachedInternalErrorsCountLimit: false, peakMemoryUsageBytes: 0, processedFiles: [], + workerCount: 0, ); } diff --git a/src/Command/AnalyseCommand.php b/src/Command/AnalyseCommand.php index b8a93670725..af82fb72908 100644 --- a/src/Command/AnalyseCommand.php +++ b/src/Command/AnalyseCommand.php @@ -209,28 +209,28 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($generateBaselineFile === null && $allowEmptyBaseline) { $inceptionResult->getStdOutput()->getStyle()->error('You must pass the --generate-baseline option alongside --allow-empty-baseline.'); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } if ($inceptionResult->getEditorModeTmpFile() !== null) { if ($generateBaselineFile !== null) { $inceptionResult->getStdOutput()->getStyle()->error('Editor mode options --tmp-file and --instead-of cannot be used when generating the baseline.'); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } if ($pro) { $inceptionResult->getStdOutput()->getStyle()->error('Editor mode options --tmp-file and --instead-of cannot be used with PHPStan Pro.'); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } if ($fix) { $inceptionResult->getStdOutput()->getStyle()->error('Editor mode options --tmp-file and --instead-of cannot be used with --fix.'); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } } if ($fix) { if ($generateBaselineFile !== null) { $inceptionResult->getStdOutput()->getStyle()->error('Errors cannot be fixed when generating the baseline.'); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } $inceptionResult->getErrorOutput()->getStyle()->note('The --fix CLI option no longer launches PHPStan Pro. Use --pro instead if you want to launch PHPStan Pro'); @@ -267,13 +267,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int $baselineExtension = pathinfo($generateBaselineFile, PATHINFO_EXTENSION); if ($baselineExtension === '') { $inceptionResult->getStdOutput()->getStyle()->error(sprintf('Baseline filename must have an extension, %s provided instead.', pathinfo($generateBaselineFile, PATHINFO_BASENAME))); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } if (!in_array($baselineExtension, ['neon', 'php'], true)) { $inceptionResult->getStdOutput()->getStyle()->error(sprintf('Baseline filename extension must be .neon or .php, .%s was used instead.', $baselineExtension)); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } } @@ -293,20 +293,20 @@ protected function execute(InputInterface $input, OutputInterface $output): int $inceptionResult->getErrorOutput()->getStyle()->error('No files found to analyse.'); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } if ($inceptionResult->getEditorModeInsteadOfFile() !== null) { if (!in_array($inceptionResult->getEditorModeInsteadOfFile(), $files, true)) { $inceptionResult->getStdOutput()->getStyle()->error(sprintf('File %s passed to --instead-of is not in analysed project files.', $inceptionResult->getEditorModeInsteadOfFile())); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } } if ($inceptionResult->getEditorModeTmpFile() !== null) { if (in_array($inceptionResult->getEditorModeTmpFile(), $files, true)) { $inceptionResult->getStdOutput()->getStyle()->error(sprintf('File %s passed to --tmp-file is already in analysed project files.', $inceptionResult->getEditorModeInsteadOfFile())); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } } @@ -356,7 +356,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($pro) { if ($generateBaselineFile !== null) { $inceptionResult->getStdOutput()->getStyle()->error('You cannot pass the --generate-baseline option when running PHPStan Pro.'); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } return $this->runFixer($inceptionResult, $container, $input, $output, $files); @@ -418,7 +418,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $previous = $previous->getPrevious(); } - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } throw $t; @@ -851,7 +851,7 @@ private function runFixer(InceptionResult $inceptionResult, Container $container if ($ciDetector->isCiDetected()) { $inceptionResult->getStdOutput()->writeLineFormatted('PHPStan Pro can\'t run in CI environment yet. Stay tuned!'); - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } // this process defers bootstrapFiles like the rest of the analyse flow but never @@ -862,7 +862,7 @@ private function runFixer(InceptionResult $inceptionResult, Container $container try { $container->getByType(BootstrapFilesRunner::class)->run($inceptionResult->getErrorOutput(), (bool) $input->getOption('debug')); } catch (InceptionNotSuccessfulException) { - return $inceptionResult->handleReturn(1, null, $this->analysisStartTime); + return $inceptionResult->handleReturn(1, null, $this->analysisStartTime, 0); } /** @var FixerApplication $fixerApplication */ diff --git a/src/Command/AnalyserRunner.php b/src/Command/AnalyserRunner.php index 496bdee4c82..28bfce07678 100644 --- a/src/Command/AnalyserRunner.php +++ b/src/Command/AnalyserRunner.php @@ -74,6 +74,7 @@ public function runAnalyser( reachedInternalErrorsCountLimit: false, peakMemoryUsageBytes: 0, processedFiles: [], + workerCount: 0, ); } diff --git a/src/Command/ClearResultCacheCommand.php b/src/Command/ClearResultCacheCommand.php index 7186dbd9046..8f3bdfade60 100644 --- a/src/Command/ClearResultCacheCommand.php +++ b/src/Command/ClearResultCacheCommand.php @@ -88,6 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int null, null, true, + false, ); } catch (InceptionNotSuccessfulException) { return 1; diff --git a/src/Command/CommandHelper.php b/src/Command/CommandHelper.php index 801dbe4939e..a8667d102a9 100644 --- a/src/Command/CommandHelper.php +++ b/src/Command/CommandHelper.php @@ -97,7 +97,7 @@ public static function begin( ?string $singleReflectionFile, ?string $singleReflectionInsteadOfFile, bool $cleanupContainerCache, - bool $deferBootstrapFiles = false, + bool $deferBootstrapFiles, ): InceptionResult { $stdOutput = new SymfonyOutput($output, new SymfonyStyle(new ErrorsConsoleStyle($input, $output))); diff --git a/src/Command/DiagnoseCommand.php b/src/Command/DiagnoseCommand.php index b489269e01c..b698a3ed6ea 100644 --- a/src/Command/DiagnoseCommand.php +++ b/src/Command/DiagnoseCommand.php @@ -87,6 +87,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int null, null, false, + false, ); } catch (InceptionNotSuccessfulException) { return 1; diff --git a/src/Command/DumpParametersCommand.php b/src/Command/DumpParametersCommand.php index 4ea86d21258..753ca337ddf 100644 --- a/src/Command/DumpParametersCommand.php +++ b/src/Command/DumpParametersCommand.php @@ -89,6 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int null, null, false, + false, ); } catch (InceptionNotSuccessfulException) { return 1; diff --git a/src/Command/FixerWorkerCommand.php b/src/Command/FixerWorkerCommand.php index 60357599096..eb80e3e4514 100644 --- a/src/Command/FixerWorkerCommand.php +++ b/src/Command/FixerWorkerCommand.php @@ -85,6 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int null, null, false, + false, ); } catch (InceptionNotSuccessfulException) { return 1; diff --git a/src/Command/FixerWorkerRunner.php b/src/Command/FixerWorkerRunner.php index e2067070752..27cab09e15e 100644 --- a/src/Command/FixerWorkerRunner.php +++ b/src/Command/FixerWorkerRunner.php @@ -352,6 +352,7 @@ private function runAnalyser(LoopInterface $loop, array $files, array $allAnalys reachedInternalErrorsCountLimit: false, peakMemoryUsageBytes: memory_get_peak_usage(true), processedFiles: [], + workerCount: 0, )); } diff --git a/src/Command/InceptionResult.php b/src/Command/InceptionResult.php index 0999d63329b..ef5a2935ea3 100644 --- a/src/Command/InceptionResult.php +++ b/src/Command/InceptionResult.php @@ -104,7 +104,7 @@ public function getEditorModeInsteadOfFile(): ?string * @param int|null $peakMemoryUsageBytes the heaviest parallel worker's peak, 0 when the * analysis ran in this process */ - public function handleReturn(int $exitCode, ?int $peakMemoryUsageBytes, float $analysisStartTime, int $workerCount = 0): int + public function handleReturn(int $exitCode, ?int $peakMemoryUsageBytes, float $analysisStartTime, int $workerCount): int { if ($this->getErrorOutput()->isVerbose()) { $elapsedTime = round(microtime(true) - $analysisStartTime, 2); diff --git a/src/Dependency/Dependencies.php b/src/Dependency/Dependencies.php index 5861cb6711a..975c849deb9 100644 --- a/src/Dependency/Dependencies.php +++ b/src/Dependency/Dependencies.php @@ -58,11 +58,11 @@ private function __construct( */ public static function create( string $file, - array $types = [], - array $classNames = [], - array $reflections = [], - array $filePaths = [], - array $usedTraits = [], + array $types, + array $classNames, + array $reflections, + array $filePaths, + array $usedTraits, ): ?self { $nonNullTypes = []; diff --git a/src/DependencyInjection/ContainerFactory.php b/src/DependencyInjection/ContainerFactory.php index 653e493b906..890253b575f 100644 --- a/src/DependencyInjection/ContainerFactory.php +++ b/src/DependencyInjection/ContainerFactory.php @@ -253,7 +253,7 @@ private function detectDuplicateIncludedFiles( array $loaderParameters, ): array { - $neonAdapter = new NeonCachedFileReader([]); + $neonAdapter = new NeonCachedFileReader([], []); $phpAdapter = new PhpAdapter(); $allConfigFiles = []; $configArray = []; diff --git a/src/DependencyInjection/NeonAdapter.php b/src/DependencyInjection/NeonAdapter.php index 6d76e7bcad3..52cb9bf5a9c 100644 --- a/src/DependencyInjection/NeonAdapter.php +++ b/src/DependencyInjection/NeonAdapter.php @@ -45,7 +45,7 @@ final class NeonAdapter implements Adapter * @param array $parameters the parameters already known when the config is loaded * (rootDir, currentWorkingDirectory, env), see LoaderFactory */ - public function __construct(private array $expandRelativePaths, private array $parameters = []) + public function __construct(private array $expandRelativePaths, private array $parameters) { } diff --git a/src/DependencyInjection/NeonCachedFileReader.php b/src/DependencyInjection/NeonCachedFileReader.php index cd10be69acd..aabfaa68aa3 100644 --- a/src/DependencyInjection/NeonCachedFileReader.php +++ b/src/DependencyInjection/NeonCachedFileReader.php @@ -21,7 +21,7 @@ final class NeonCachedFileReader implements Adapter * @param list $expandRelativePaths * @param array $parameters */ - public function __construct(private array $expandRelativePaths, array $parameters = []) + public function __construct(private array $expandRelativePaths, array $parameters) { $this->adapter = new NeonAdapter($this->expandRelativePaths, $parameters); } diff --git a/src/File/DeduplicatingFileReader.php b/src/File/DeduplicatingFileReader.php index a02a7992999..711975251ff 100644 --- a/src/File/DeduplicatingFileReader.php +++ b/src/File/DeduplicatingFileReader.php @@ -30,7 +30,7 @@ final class DeduplicatingFileReader public function __construct() { - $this->contentsByFile = new LruCache(self::CONTENTS_COUNT_LIMIT); + $this->contentsByFile = new LruCache(self::CONTENTS_COUNT_LIMIT, 0, 0); } /** diff --git a/src/File/DirectoryWalker.php b/src/File/DirectoryWalker.php index 6808646295b..285d71bcc1a 100644 --- a/src/File/DirectoryWalker.php +++ b/src/File/DirectoryWalker.php @@ -86,7 +86,7 @@ final class DirectoryWalker public function __construct( private FileStatSignatures $fileStatSignatures, #[AutowiredParameter] - private string $tmpDir = '', + private string $tmpDir, ) { } diff --git a/src/Internal/LruCache.php b/src/Internal/LruCache.php index b6000eb7388..eea779d76e7 100644 --- a/src/Internal/LruCache.php +++ b/src/Internal/LruCache.php @@ -39,9 +39,9 @@ final class LruCache * single entry heavier than $maxWeight cannot flush the whole cache on every insertion */ public function __construct( - private int $maxCount = 0, - private int $maxWeight = 0, - private int $weightEvictionFloorCount = 0, + private int $maxCount, + private int $maxWeight, + private int $weightEvictionFloorCount, ) { } diff --git a/src/Node/ClassStatementsGatherer.php b/src/Node/ClassStatementsGatherer.php index 71a56858423..95d09a67308 100644 --- a/src/Node/ClassStatementsGatherer.php +++ b/src/Node/ClassStatementsGatherer.php @@ -371,6 +371,7 @@ private function tryToApplyPropertyWritesFromAncestorConstructor(StaticCall $anc new PropertyFetch(new Expr\Variable('this'), new Identifier($property->getName()), $attributes), $scope, false, + null, ); } } diff --git a/src/Node/CollectedDataNode.php b/src/Node/CollectedDataNode.php index db5f89ff32e..fc753bc294b 100644 --- a/src/Node/CollectedDataNode.php +++ b/src/Node/CollectedDataNode.php @@ -18,7 +18,7 @@ final class CollectedDataNode extends NodeAbstract implements VirtualNode /** * @param CollectorData $collectedData */ - public function __construct(private array $collectedData, private bool $onlyFiles, private ?CollectedDataNodeReads $reads = null) + public function __construct(private array $collectedData, private bool $onlyFiles, private ?CollectedDataNodeReads $reads) { parent::__construct([]); } diff --git a/src/Node/ExecutionEndNode.php b/src/Node/ExecutionEndNode.php index 8096cff469d..0f8339fe59b 100644 --- a/src/Node/ExecutionEndNode.php +++ b/src/Node/ExecutionEndNode.php @@ -20,7 +20,7 @@ public function __construct( private Node\Stmt $node, private StatementResult $statementResult, private bool $hasNativeReturnTypehint, - private ?ExpressionResult $exprResult = null, + private ?ExpressionResult $exprResult, ) { parent::__construct($node->getAttributes()); diff --git a/src/Node/FunctionCallExpressionNode.php b/src/Node/FunctionCallExpressionNode.php index 4c213c5d163..e3e904f0155 100644 --- a/src/Node/FunctionCallExpressionNode.php +++ b/src/Node/FunctionCallExpressionNode.php @@ -25,7 +25,7 @@ final class FunctionCallExpressionNode extends NodeAbstract implements VirtualNo public function __construct( private FuncCall $originalNode, private ExpressionResult $result, - private ?ArgsResult $argsResult = null, + private ?ArgsResult $argsResult, ) { parent::__construct($originalNode->getAttributes()); diff --git a/src/Node/MethodCallExpressionNode.php b/src/Node/MethodCallExpressionNode.php index 93d88210cd0..a1ae3e088ae 100644 --- a/src/Node/MethodCallExpressionNode.php +++ b/src/Node/MethodCallExpressionNode.php @@ -24,7 +24,7 @@ final class MethodCallExpressionNode extends NodeAbstract implements VirtualNode public function __construct( private MethodCall $originalNode, private ExpressionResult $result, - private ?ArgsResult $argsResult = null, + private ?ArgsResult $argsResult, ) { parent::__construct($originalNode->getAttributes()); diff --git a/src/Node/Property/PropertyWrite.php b/src/Node/Property/PropertyWrite.php index 02d845272ca..331561be03f 100644 --- a/src/Node/Property/PropertyWrite.php +++ b/src/Node/Property/PropertyWrite.php @@ -21,7 +21,7 @@ public function __construct( private PropertyFetch|StaticPropertyFetch $fetch, private Scope $scope, private bool $promotedPropertyWrite, - private ClassPropertyNode|PropertyAssignNode|AssignRef|null $originalNode = null, + private ClassPropertyNode|PropertyAssignNode|AssignRef|null $originalNode, ) { } diff --git a/src/Node/StaticMethodCallExpressionNode.php b/src/Node/StaticMethodCallExpressionNode.php index 2c16b906e7d..6b1ec4dbe84 100644 --- a/src/Node/StaticMethodCallExpressionNode.php +++ b/src/Node/StaticMethodCallExpressionNode.php @@ -24,7 +24,7 @@ final class StaticMethodCallExpressionNode extends NodeAbstract implements Virtu public function __construct( private StaticCall $originalNode, private ExpressionResult $result, - private ?ArgsResult $argsResult = null, + private ?ArgsResult $argsResult, ) { parent::__construct($originalNode->getAttributes()); diff --git a/src/Node/Variable/VariableWrite.php b/src/Node/Variable/VariableWrite.php index be952ea2e12..efaaafc5c6b 100644 --- a/src/Node/Variable/VariableWrite.php +++ b/src/Node/Variable/VariableWrite.php @@ -42,10 +42,10 @@ public function __construct( private Node $node, private int $id, private int $kind, - private bool $offsetWrite = false, - private $offset = null, - private ?int $parentId = null, - private bool $replacesOffset = true, + private bool $offsetWrite, + private $offset, + private ?int $parentId, + private bool $replacesOffset, ) { } diff --git a/src/Parser/CachedParser.php b/src/Parser/CachedParser.php index 818c6a399b1..c5f9027c93e 100644 --- a/src/Parser/CachedParser.php +++ b/src/Parser/CachedParser.php @@ -67,7 +67,7 @@ public function __construct( $cachedSourceBytesMax, self::SIZE_EVICTION_FLOOR_LIMIT, ); - $this->cachedSourceByFile = new LruCache(maxWeight: self::MEMOIZED_SOURCE_BYTES_LIMIT); + $this->cachedSourceByFile = new LruCache(maxWeight: self::MEMOIZED_SOURCE_BYTES_LIMIT, maxCount: 0, weightEvictionFloorCount: 0); } /** diff --git a/src/PhpDoc/TypeNodeResolver.php b/src/PhpDoc/TypeNodeResolver.php index 832cb06d94c..80b84efd000 100644 --- a/src/PhpDoc/TypeNodeResolver.php +++ b/src/PhpDoc/TypeNodeResolver.php @@ -1253,7 +1253,7 @@ private function resolveArrayShapeOffsetType(ArrayShapeItemNode $itemNode, NameS } if ($isStatic) { - return new ClassConstantAccessType(new StaticType($classReflection), $constantName); + return new ClassConstantAccessType(new StaticType($classReflection), $constantName, null); } $reflectionConstant = $classReflection->getNativeReflection()->getReflectionConstant($constantName); @@ -1348,7 +1348,7 @@ private function resolveConstTypeNode(ConstTypeNode $typeNode, NameScope $nameSc // declaring constants its bound does not - known once the template is resolved. $boundClassReflections = $templateType->getBound()->getObjectClassReflections(); if (count($boundClassReflections) !== 1 || !$boundClassReflections[0]->isFinal()) { - return new ClassConstantAccessType($templateType, $constExpr->name); + return new ClassConstantAccessType($templateType, $constExpr->name, null); } $className = $boundClassReflections[0]->getName(); @@ -1381,7 +1381,7 @@ private function resolveConstTypeNode(ConstTypeNode $typeNode, NameScope $nameSc // A class that is not final can have subclasses declaring constants it does not - what // static:: stands for is known once static is resolved. if ($isStatic) { - return new ClassConstantAccessType(new StaticType($classReflection), $constantName); + return new ClassConstantAccessType(new StaticType($classReflection), $constantName, null); } if (Strings::contains($constantName, '*')) { diff --git a/src/Process/Restart/RestartDiagnoseExtension.php b/src/Process/Restart/RestartDiagnoseExtension.php index d9f0d4df537..9de8d78a459 100644 --- a/src/Process/Restart/RestartDiagnoseExtension.php +++ b/src/Process/Restart/RestartDiagnoseExtension.php @@ -44,7 +44,7 @@ private function describeRestartIfStartedNow(): string // the diagnose command does not restart, so it reports the answer an // analyse run started the same way would get. --xdebug is a per-run // option, so it is reported as not given - $reasons = RestartExtensionRegistry::collectReasons(false); + $reasons = RestartExtensionRegistry::collectReasons(false, null); if ($reasons === []) { return 'no, nothing to neutralize or load'; } diff --git a/src/Process/Restart/RestartExtensionRegistry.php b/src/Process/Restart/RestartExtensionRegistry.php index 55fc5e783d8..9ed89eb81b2 100644 --- a/src/Process/Restart/RestartExtensionRegistry.php +++ b/src/Process/Restart/RestartExtensionRegistry.php @@ -88,7 +88,7 @@ final class RestartExtensionRegistry * * @return list */ - public static function collectReasons(bool $allowXdebug, ?string $pharPath = null): array + public static function collectReasons(bool $allowXdebug, ?string $pharPath): array { $iniSettings = []; foreach (['xdebug.mode', 'pcov.enabled', 'uopz.disable'] as $name) { @@ -133,8 +133,8 @@ public static function collectReasonsFor( array $iniSettings, ?string $turboExtensionPath, bool $allowXdebug, - array $opcacheIniEntries = [], - array $currentOpcacheIniValues = [], + array $opcacheIniEntries, + array $currentOpcacheIniValues, ): array { $reasons = []; @@ -147,6 +147,8 @@ public static function collectReasonsFor( // xdebug reads XDEBUG_MODE in preference to the ini setting, so // flagging the ini alone would be silently overridable environmentVariables: ['XDEBUG_MODE' => 'off'], + strippedExtensions: [], + commandLineArguments: [], ); } @@ -158,6 +160,9 @@ public static function collectReasonsFor( 'pcov', 'pcov.enabled=1', iniSettings: ['pcov.enabled' => '0'], + environmentVariables: [], + strippedExtensions: [], + commandLineArguments: [], ); } @@ -169,6 +174,9 @@ public static function collectReasonsFor( 'uopz', 'uopz.disable=0', iniSettings: ['uopz.disable' => '1'], + environmentVariables: [], + strippedExtensions: [], + commandLineArguments: [], ); } @@ -185,6 +193,9 @@ public static function collectReasonsFor( '-d', TurboExtensionSelector::EXTENSION_PATH_INI . '=' . $turboExtensionPath, ], + iniSettings: [], + environmentVariables: [], + strippedExtensions: [], ); } @@ -196,6 +207,9 @@ public static function collectReasonsFor( 'tideways', 'crashes the turbo extension', strippedExtensions: ['tideways'], + iniSettings: [], + environmentVariables: [], + commandLineArguments: [], ); } @@ -210,6 +224,9 @@ public static function collectReasonsFor( 'opcache', 'not configured the way PHPStan runs fastest', iniSettings: $opcacheSettings, + environmentVariables: [], + strippedExtensions: [], + commandLineArguments: [], ); } @@ -328,7 +345,7 @@ private static function isForkCapable(): bool * The turbo binary the restart should load, null when there is none or * when loading it would not buy anything. */ - public static function findTurboExtensionToLoad(?string $pharPath = null): ?string + public static function findTurboExtensionToLoad(?string $pharPath): ?string { if (!self::isForkCapable()) { // fork mode is impossible here (see ForkParallelChecker) and spawned diff --git a/src/Process/Restart/RestartManager.php b/src/Process/Restart/RestartManager.php index e701548eb7f..1b30379939c 100644 --- a/src/Process/Restart/RestartManager.php +++ b/src/Process/Restart/RestartManager.php @@ -125,7 +125,7 @@ final class RestartManager * @param list|null $extensions restart only for these reasons, null for all of them * @param string $appName prefix of the _ALLOW_XDEBUG environment variable, see TurboProcessRestarter */ - public static function run(array $argv, ?string $pharPath = null, ?array $extensions = null, string $appName = 'phpstan'): void + public static function run(array $argv, ?string $pharPath, ?array $extensions, string $appName): void { self::cleanUpComposedIni(); @@ -156,7 +156,7 @@ public static function run(array $argv, ?string $pharPath = null, ?array $extens * @param list $argv * @return list */ - public static function collectReasons(array $argv, ?string $pharPath = null, string $appName = 'phpstan'): array + public static function collectReasons(array $argv, ?string $pharPath, string $appName): array { if (!self::isEligible($argv)) { return []; @@ -488,7 +488,7 @@ private static function findCommandName(array $argv): ?string * * @param list $argv */ - public static function isXdebugAllowed(array $argv, string $appName = 'phpstan'): bool + public static function isXdebugAllowed(array $argv, string $appName): bool { if (in_array('--xdebug', $argv, true)) { return true; diff --git a/src/Process/Restart/RestartReason.php b/src/Process/Restart/RestartReason.php index 90b1fe2bb4f..e6e13e1b899 100644 --- a/src/Process/Restart/RestartReason.php +++ b/src/Process/Restart/RestartReason.php @@ -42,10 +42,10 @@ final class RestartReason public function __construct( private string $extension, private string $description, - private array $iniSettings = [], - private array $environmentVariables = [], - private array $strippedExtensions = [], - private array $commandLineArguments = [], + private array $iniSettings, + private array $environmentVariables, + private array $strippedExtensions, + private array $commandLineArguments, ) { } diff --git a/src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php b/src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php index 5e202ddbf65..3fa1a42f127 100644 --- a/src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php +++ b/src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php @@ -45,7 +45,7 @@ public function __construct( * With a batch, the directory locators are added to it, and the returned locator cannot be used * before the batch is scanned. */ - public function create(string $projectInstallationPath, ?OptimizedDirectorySourceLocatorBatch $batch = null): ?SourceLocator + public function create(string $projectInstallationPath, ?OptimizedDirectorySourceLocatorBatch $batch): ?SourceLocator { $composer = ComposerHelper::getComposerConfig($projectInstallationPath); @@ -165,7 +165,7 @@ public function create(string $projectInstallationPath, ?OptimizedDirectorySourc } if ($bestDirFound !== null) { - $phpunitBridgeLocator = $this->create($bestDirFound); + $phpunitBridgeLocator = $this->create($bestDirFound, null); if ($phpunitBridgeLocator !== null) { $locators[] = $phpunitBridgeLocator; } diff --git a/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php b/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php index 422d0ce59a4..c41b49723d4 100644 --- a/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php +++ b/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php @@ -43,7 +43,7 @@ public function __construct( private array $classToFile, private array $functionToFiles, private array $constantToFile, - private bool $awaitingScan = false, + private bool $awaitingScan, ) { } diff --git a/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocatorRepository.php b/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocatorRepository.php index c6386018441..839a10927d5 100644 --- a/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocatorRepository.php +++ b/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocatorRepository.php @@ -20,7 +20,7 @@ public function __construct(private OptimizedDirectorySourceLocatorFactory $fact * With a batch, a locator not created yet is added to it, and cannot be used before the batch * is scanned. */ - public function getOrCreate(string $directory, ?OptimizedDirectorySourceLocatorBatch $batch = null): OptimizedDirectorySourceLocator + public function getOrCreate(string $directory, ?OptimizedDirectorySourceLocatorBatch $batch): OptimizedDirectorySourceLocator { if (array_key_exists($directory, $this->locators)) { return $this->locators[$directory]; diff --git a/src/Reflection/InitializerExprTypeResolver.php b/src/Reflection/InitializerExprTypeResolver.php index abf5384f2a4..0f0340df426 100644 --- a/src/Reflection/InitializerExprTypeResolver.php +++ b/src/Reflection/InitializerExprTypeResolver.php @@ -2687,7 +2687,7 @@ private static function shiftLeftOverflows(int $value, int $shift): bool * * @param callable(Expr): Type $getTypeCallback */ - public function getClassConstFetchTypeByReflection(Name|Expr $class, string $constantName, ?ClassReflection $classReflection, callable $getTypeCallback, bool $nativeTypesPromoted = false): Type + public function getClassConstFetchTypeByReflection(Name|Expr $class, string $constantName, ?ClassReflection $classReflection, callable $getTypeCallback, bool $nativeTypesPromoted): Type { $isObject = false; if ($class instanceof Name) { @@ -2874,7 +2874,7 @@ public function getClassConstFetchType(Name|Expr $class, string $constantName, ? $classReflection = $this->getReflectionProvider()->getClass($className); } - return $this->getClassConstFetchTypeByReflection($class, $constantName, $classReflection, $getTypeCallback); + return $this->getClassConstFetchTypeByReflection($class, $constantName, $classReflection, $getTypeCallback, false); } /** diff --git a/src/Reflection/Php/PhpClassReflectionExtension.php b/src/Reflection/Php/PhpClassReflectionExtension.php index 55dbd02acae..640ff265d15 100644 --- a/src/Reflection/Php/PhpClassReflectionExtension.php +++ b/src/Reflection/Php/PhpClassReflectionExtension.php @@ -132,7 +132,7 @@ public function __construct( int $memberCacheKeysMax, ) { - $this->memberCacheOrder = new LruCache($memberCacheKeysMax); + $this->memberCacheOrder = new LruCache($memberCacheKeysMax, 0, 0); } /** diff --git a/src/Reflection/ResolvedFunctionVariantWithOriginal.php b/src/Reflection/ResolvedFunctionVariantWithOriginal.php index af85439f365..dfaaf64dd55 100644 --- a/src/Reflection/ResolvedFunctionVariantWithOriginal.php +++ b/src/Reflection/ResolvedFunctionVariantWithOriginal.php @@ -163,6 +163,9 @@ public function getReturnTypeWithUnresolvableTemplateTypes(): Type $this->resolveResolvableTemplateTypes( $this->narrowTemplateTypesInConditionalTypesForParameter($this->parametersAcceptor->getReturnType()), TemplateTypeVariance::createCovariant(), + null, + null, + true, ), ); } @@ -174,6 +177,9 @@ private function getPhpDocReturnTypeWithUnresolvableTemplateTypes(): Type $this->resolveResolvableTemplateTypes( $this->narrowTemplateTypesInConditionalTypesForParameter($this->parametersAcceptor->getPhpDocReturnType()), TemplateTypeVariance::createCovariant(), + null, + null, + true, ), ); } @@ -279,7 +285,7 @@ public function resolveConditionalTypes(Type $type): Type ); } - private function resolveResolvableTemplateTypes(Type $type, TemplateTypeVariance $positionVariance, ?Expr $site = null, ?TemplateArgumentFrame $frame = null, bool $allowUnresolved = true): Type + private function resolveResolvableTemplateTypes(Type $type, TemplateTypeVariance $positionVariance, ?Expr $site, ?TemplateArgumentFrame $frame, bool $allowUnresolved): Type { $references = $type->getReferencedTemplateTypes($positionVariance); $onlyCovariant = []; diff --git a/src/Rules/Comparison/ImpossibleCheckTypeHelper.php b/src/Rules/Comparison/ImpossibleCheckTypeHelper.php index 49af429e6de..ae6ac986d5c 100644 --- a/src/Rules/Comparison/ImpossibleCheckTypeHelper.php +++ b/src/Rules/Comparison/ImpossibleCheckTypeHelper.php @@ -63,7 +63,7 @@ public function findSpecifiedType( Scope $scope, Expr $node, ExpressionResult $nodeResult, - ?ArgsResult $argsResult = null, + ?ArgsResult $argsResult, array &$reasons = [], ): ?bool { @@ -101,7 +101,7 @@ public function findSpecifiedType( * call - the narrowed expressions of a SpecifiedTypes entry are arbitrary * subexpressions - so the lookup stays a membership query. */ - private function getArgumentType(Scope $scope, ?ArgsResult $argsResult, Expr $expr, bool $phpDocFlavour = false): Type + private function getArgumentType(Scope $scope, ?ArgsResult $argsResult, Expr $expr, bool $phpDocFlavour): Type { if ($argsResult !== null && $scope instanceof MutatingScope) { $argResult = $argsResult->findArgResult($expr); @@ -158,7 +158,7 @@ private function getSpecifiedType( $arg = $args[0]->value; // through the argument's own result (an assign-in-argument // `assert($x = f())` names the variable the argument assigns) - $assertValue = $this->getArgumentType($scope, $argsResult, $arg)->toBoolean(); + $assertValue = $this->getArgumentType($scope, $argsResult, $arg, false)->toBoolean(); $assertValueIsTrue = $assertValue->isTrue()->yes(); if (! $assertValueIsTrue && ! $assertValue->isFalse()->yes()) { return null; @@ -177,7 +177,7 @@ private function getSpecifiedType( return null; } elseif ($functionName === 'in_array' && $argsCount >= 2) { $haystackArg = $args[1]->value; - $haystackType = $this->getArgumentType($scope, $argsResult, $haystackArg); + $haystackType = $this->getArgumentType($scope, $argsResult, $haystackArg, false); if ($haystackType instanceof MixedType) { return null; } @@ -187,7 +187,7 @@ private function getSpecifiedType( } $needleArg = $args[0]->value; - $needleType = $this->getArgumentType($scope, $argsResult, $needleArg); + $needleType = $this->getArgumentType($scope, $argsResult, $needleArg, false); $isStrictComparison = false; if ($argsCount >= 3) { @@ -441,7 +441,7 @@ private function getSpecifiedType( continue; } - $argumentType = $this->getArgumentType($scope, $argsResult, $sureType[0]); + $argumentType = $this->getArgumentType($scope, $argsResult, $sureType[0], false); /** @var Type $resultType */ $resultType = $sureType[1]; diff --git a/src/Rules/Comparison/StrictComparisonOfDifferentTypesRule.php b/src/Rules/Comparison/StrictComparisonOfDifferentTypesRule.php index 4683e2dc2bb..4fca86b7860 100644 --- a/src/Rules/Comparison/StrictComparisonOfDifferentTypesRule.php +++ b/src/Rules/Comparison/StrictComparisonOfDifferentTypesRule.php @@ -52,9 +52,9 @@ public function processNode(Node $node, Scope&NodeCallbackInvoker&CollectedDataE } if ($node instanceof Node\Expr\BinaryOp\Identical) { - $nodeTypeResult = $this->richerScopeGetTypeHelper->getIdenticalResult($this->treatPhpDocTypesAsCertain ? $scope : $scope->doNotTreatPhpDocTypesAsCertain(), $node); + $nodeTypeResult = $this->richerScopeGetTypeHelper->getIdenticalResult($this->treatPhpDocTypesAsCertain ? $scope : $scope->doNotTreatPhpDocTypesAsCertain(), $node, null, null, null); } elseif ($node instanceof Node\Expr\BinaryOp\NotIdentical) { - $nodeTypeResult = $this->richerScopeGetTypeHelper->getNotIdenticalResult($this->treatPhpDocTypesAsCertain ? $scope : $scope->doNotTreatPhpDocTypesAsCertain(), $node); + $nodeTypeResult = $this->richerScopeGetTypeHelper->getNotIdenticalResult($this->treatPhpDocTypesAsCertain ? $scope : $scope->doNotTreatPhpDocTypesAsCertain(), $node, null, null, null); } else { return []; } diff --git a/src/Rules/UnusedParametersCheck.php b/src/Rules/UnusedParametersCheck.php index 75614995cd7..6323b88a8c0 100644 --- a/src/Rules/UnusedParametersCheck.php +++ b/src/Rules/UnusedParametersCheck.php @@ -44,8 +44,8 @@ public function getUnusedParameterErrors( string $unusedParameterMessage, string $identifier, bool $reportExactLine, - ?string $unusedFlowMessage = null, - ?string $unusedFlowIdentifier = null, + ?string $unusedFlowMessage, + ?string $unusedFlowIdentifier, ): array { if ($node->isOpaque()) { diff --git a/src/Rules/Variables/NullCoalesceRule.php b/src/Rules/Variables/NullCoalesceRule.php index a234fb14f17..1944d218be6 100644 --- a/src/Rules/Variables/NullCoalesceRule.php +++ b/src/Rules/Variables/NullCoalesceRule.php @@ -117,7 +117,7 @@ private function checkUnnecessaryNullCoalesce(CoalesceExpressionNode $node, Scop // If the left side is always set, `?? null` (or `??= null`) never changes // anything, so the whole coalesce is redundant. $resolution = $node->getSubjectResult()->getIssetabilityResolution($scope->toWalkScope(), false, true); - if ($resolution->isSet(static fn (): bool => true) !== true) { + if ($resolution->isSet(static fn (): bool => true, null) !== true) { return null; } diff --git a/src/Testing/RuleTestCase.php b/src/Testing/RuleTestCase.php index 99f8770e99c..3a05e9fcc80 100644 --- a/src/Testing/RuleTestCase.php +++ b/src/Testing/RuleTestCase.php @@ -309,7 +309,7 @@ private function gatherAnalyserErrorsWithDelayedErrors(array $files): array ); return [ - $finalizer->finalize($analyserResult, false, true)->getAnalyserResult()->getUnorderedErrors(), + $finalizer->finalize($analyserResult, false, true, null, null, [])->getAnalyserResult()->getUnorderedErrors(), array_merge($classRule->getDelayedErrors(), $traitRule->getDelayedErrors()), ]; } diff --git a/src/Testing/TestCaseSourceLocatorFactory.php b/src/Testing/TestCaseSourceLocatorFactory.php index 3b01851e462..8ea2619b8e6 100644 --- a/src/Testing/TestCaseSourceLocatorFactory.php +++ b/src/Testing/TestCaseSourceLocatorFactory.php @@ -77,7 +77,7 @@ public function create(): SourceLocator continue; } - $composerSourceLocator = $this->composerJsonAndInstalledJsonSourceLocatorMaker->create($composerProjectPath); + $composerSourceLocator = $this->composerJsonAndInstalledJsonSourceLocatorMaker->create($composerProjectPath, null); if ($composerSourceLocator === null) { continue; } diff --git a/src/Turbo/TurboDiagnoseExtension.php b/src/Turbo/TurboDiagnoseExtension.php index 88786f3098c..d8f288b8555 100644 --- a/src/Turbo/TurboDiagnoseExtension.php +++ b/src/Turbo/TurboDiagnoseExtension.php @@ -88,7 +88,7 @@ private function describeStatus(?string $workerBinary): string { if (!TurboExtensionEnabler::isLoaded()) { if ($workerBinary !== null) { - if (RestartExtensionRegistry::findTurboExtensionToLoad() !== null) { + if (RestartExtensionRegistry::findTurboExtensionToLoad(null) !== null) { return 'not loaded here, loaded by the restart an analyse run performs'; } diff --git a/src/Turbo/TurboExtensionSelector.php b/src/Turbo/TurboExtensionSelector.php index c19c6bc9241..f1ac2a4abef 100644 --- a/src/Turbo/TurboExtensionSelector.php +++ b/src/Turbo/TurboExtensionSelector.php @@ -110,7 +110,7 @@ public static function findExtensionForWorkers(?string $pharPath = null): ?strin */ public static function isMissingNextToPhar(): bool { - $platformDirectory = self::getPlatformDirectoryNextToPhar(); + $platformDirectory = self::getPlatformDirectoryNextToPhar(null); if ($platformDirectory === null) { return false; } @@ -128,7 +128,7 @@ public static function isMissingNextToPhar(): bool * Another program that loads PHPStan's phar, Rector for example, passes * the path to that phar: Phar::running() only knows the phar that runs. */ - public static function findExtension(?string $pharPath = null): ?string + public static function findExtension(?string $pharPath): ?string { $platformDirectory = self::getPlatformDirectoryNextToPhar($pharPath); if ($platformDirectory === null) { @@ -162,7 +162,7 @@ public static function findExtension(?string $pharPath = null): ?string * binary is built for this runtime: PHP older than the minimum, a debug * build, a run from source, or a platform without binaries. */ - private static function getPlatformDirectoryNextToPhar(?string $pharPath = null): ?string + private static function getPlatformDirectoryNextToPhar(?string $pharPath): ?string { if (PHP_VERSION_ID < self::MINIMUM_PHP_VERSION_ID) { return null; diff --git a/src/Turbo/TurboProcessRestarter.php b/src/Turbo/TurboProcessRestarter.php index a671244afa4..7ecbd84e53a 100644 --- a/src/Turbo/TurboProcessRestarter.php +++ b/src/Turbo/TurboProcessRestarter.php @@ -30,11 +30,11 @@ final class TurboProcessRestarter public static function restartIfSuitable(array $argv, ?string $pharPath = null, ?string $appName = null): void { if ($appName === null) { - RestartManager::run($argv, $pharPath, ['phpstan_turbo', 'tideways', 'opcache']); + RestartManager::run($argv, $pharPath, ['phpstan_turbo', 'tideways', 'opcache'], 'phpstan'); return; } - RestartManager::run($argv, $pharPath, appName: $appName); + RestartManager::run($argv, $pharPath, appName: $appName, extensions: null); } } diff --git a/src/Type/ClassConstantAccessType.php b/src/Type/ClassConstantAccessType.php index ed55e80967b..f8e7813d61f 100644 --- a/src/Type/ClassConstantAccessType.php +++ b/src/Type/ClassConstantAccessType.php @@ -24,7 +24,7 @@ final class ClassConstantAccessType implements CompoundType, LateResolvableType public function __construct( private Type $type, private string $constantName, - private ?Type $nativeType = null, + private ?Type $nativeType, ) { } diff --git a/src/Type/ClassConstantPatternResolver.php b/src/Type/ClassConstantPatternResolver.php index f19fcbd1c68..1148ff9d973 100644 --- a/src/Type/ClassConstantPatternResolver.php +++ b/src/Type/ClassConstantPatternResolver.php @@ -29,7 +29,7 @@ final class ClassConstantPatternResolver * With the native type of the parameter or of the return type, the result is decided together * with it, as TypehintHelper::decideType() does for other PHPDoc types. */ - public static function resolve(Type $type, string $pattern, ?Type $nativeType = null): Type + public static function resolve(Type $type, string $pattern, ?Type $nativeType): Type { $result = self::resolveConstants($type, $pattern); if ($nativeType === null) { diff --git a/src/Type/FileTypeMapper.php b/src/Type/FileTypeMapper.php index a61ad12860e..5f58e2ee1a7 100644 --- a/src/Type/FileTypeMapper.php +++ b/src/Type/FileTypeMapper.php @@ -96,7 +96,7 @@ public function __construct( // 0 kept one entry here rather than meaning "no limit" as it does for the other bounded // caches: the eviction loop ran before the insertion, emptying the cache and then putting // a single entry back. Preserved rather than normalised - see the PR description. - $this->memoryCache = new LruCache($nameScopeMapMemoryCacheCountMax === 0 ? 1 : $nameScopeMapMemoryCacheCountMax); + $this->memoryCache = new LruCache($nameScopeMapMemoryCacheCountMax === 0 ? 1 : $nameScopeMapMemoryCacheCountMax, 0, 0); } /** @api */ diff --git a/src/Type/Generic/GenericObjectType.php b/src/Type/Generic/GenericObjectType.php index a870460d2a4..7702dc64a12 100644 --- a/src/Type/Generic/GenericObjectType.php +++ b/src/Type/Generic/GenericObjectType.php @@ -32,7 +32,7 @@ use function sprintf; /** @api */ -#[InstanceofDeprecated] +#[InstanceofDeprecated(insteadUse: null)] #[ShadowedByTurboExtension(implementation: __DIR__ . '/../../../turbo-ext/src/GenericObjectType.cpp')] class GenericObjectType extends ObjectType { diff --git a/src/Type/InstanceofDeprecated.php b/src/Type/InstanceofDeprecated.php index 9aad6816df6..6496c9aa139 100644 --- a/src/Type/InstanceofDeprecated.php +++ b/src/Type/InstanceofDeprecated.php @@ -8,7 +8,7 @@ * Marks a class or interface where `instanceof` in user code * is error-prone and deprecated. * - * Reported by ApiInstanceofTypeRule. The optional $insteadUse + * Reported by ApiInstanceofTypeRule. The nullable $insteadUse * describes the Type API to query instead. * * Works thanks to https://github.com/ondrejmirtes/composer-attribute-collector. @@ -17,7 +17,7 @@ final class InstanceofDeprecated { - public function __construct(public ?string $insteadUse = null) + public function __construct(public ?string $insteadUse) { } diff --git a/src/Type/IntersectionType.php b/src/Type/IntersectionType.php index 8052cdde3c2..e9bb54808b5 100644 --- a/src/Type/IntersectionType.php +++ b/src/Type/IntersectionType.php @@ -76,7 +76,7 @@ use const PHP_INT_MAX; /** @api */ -#[InstanceofDeprecated] +#[InstanceofDeprecated(insteadUse: null)] #[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/IntersectionType.cpp')] class IntersectionType implements CompoundType { diff --git a/src/Type/ObjectType.php b/src/Type/ObjectType.php index b358bf41754..966b98b7131 100644 --- a/src/Type/ObjectType.php +++ b/src/Type/ObjectType.php @@ -199,7 +199,7 @@ private static function touchDescriptionCacheKey(string $description): void } self::$lastTouchedDescription = $description; - self::$descriptionCacheOrder ??= new LruCache(self::DESCRIPTION_CACHE_LIMIT); + self::$descriptionCacheOrder ??= new LruCache(self::DESCRIPTION_CACHE_LIMIT, 0, 0); if (self::$descriptionCacheOrder->get($description) !== null) { return; } diff --git a/src/Type/Regex/Parser/RegexNode.php b/src/Type/Regex/Parser/RegexNode.php index a1e7fff28dd..303a35d89df 100644 --- a/src/Type/Regex/Parser/RegexNode.php +++ b/src/Type/Regex/Parser/RegexNode.php @@ -19,9 +19,9 @@ final class RegexNode */ public function __construct( private string $id, - private string $valueToken = '', - private string $valueValue = '', - private array $children = [], + private string $valueToken, + private string $valueValue, + private array $children, ) { } diff --git a/src/Type/Regex/Parser/RegexParser.php b/src/Type/Regex/Parser/RegexParser.php index 533b93dcd14..d7ad72ef059 100644 --- a/src/Type/Regex/Parser/RegexParser.php +++ b/src/Type/Regex/Parser/RegexParser.php @@ -1173,7 +1173,7 @@ public function parse(\Phplrt\Contracts\Source\ReadableInterface $source): mixed private static function reduceExpression(\Phplrt\Parser\Context $ctx, mixed $children): mixed { - return new RegexNode('#expression', children: \is_array($children) ? $children : [$children]); + return new RegexNode('#expression', '', '', \is_array($children) ? $children : [$children]); } private static function reduceAlternation(\Phplrt\Parser\Context $ctx, mixed $children): mixed @@ -1186,14 +1186,14 @@ private static function reduceAlternation(\Phplrt\Parser\Context $ctx, mixed $ch foreach ($children as $child) { if ($child instanceof TokenInterface) { $isAlternation = true; - $child = new RegexNode('token', 'alternation', $child->value); + $child = new RegexNode('token', 'alternation', $child->value, []); } $nodes[] = $child; } if (!$isAlternation) { return $children[0] ?? []; } - return new RegexNode('#alternation', children: $nodes); + return new RegexNode('#alternation', '', '', $nodes); } private static function reduceConcatenation(\Phplrt\Parser\Context $ctx, mixed $children): mixed @@ -1204,13 +1204,13 @@ private static function reduceConcatenation(\Phplrt\Parser\Context $ctx, mixed $ if (\count($children) === 1) { return $children[0]; } - return new RegexNode('#concatenation', children: $children); + return new RegexNode('#concatenation', '', '', $children); } private static function reduceInternalOptions(\Phplrt\Parser\Context $ctx, mixed $children): mixed { - return new RegexNode('#internal_options', children: [ - new RegexNode('token', 'internal_option', $children->value), + return new RegexNode('#internal_options', '', '', [ + new RegexNode('token', 'internal_option', $children->value, []), ]); } @@ -1223,7 +1223,7 @@ private static function reduceAssertion(\Phplrt\Parser\Context $ctx, mixed $chil self::T_LOOKBEHIND => '#lookbehind', self::T_NEGATIVE_LOOKBEHIND => '#negativelookbehind', ]; - return new RegexNode($ids[$assertion->id], children: $children); + return new RegexNode($ids[$assertion->id], '', '', $children); } private static function reduceQuantification(\Phplrt\Parser\Context $ctx, mixed $children): mixed @@ -1234,9 +1234,9 @@ private static function reduceQuantification(\Phplrt\Parser\Context $ctx, mixed if (\count($children) === 1) { return $children[0]; } - return new RegexNode('#quantification', children: [ + return new RegexNode('#quantification', '', '', [ $children[0], - new RegexNode('token', \strtolower(\substr($children[1]->name, 2)), $children[1]->value), + new RegexNode('token', \strtolower(\substr($children[1]->name, 2)), $children[1]->value, []), ]); } @@ -1250,7 +1250,7 @@ private static function reduceCharacterClass(\Phplrt\Parser\Context $ctx, mixed $nodes = []; if ($children->id === self::T_NEGATIVE_CLASS_FC || $children->id === self::T_CLASS_FC) { - $nodes[] = new RegexNode('token', '_class', ']'); + $nodes[] = new RegexNode('token', '_class', ']', []); } $literalNames = [ @@ -1264,37 +1264,37 @@ private static function reduceCharacterClass(\Phplrt\Parser\Context $ctx, mixed $i = 0; // ? ( | | range() ? | literal() )* ? if ($i < $count && $tokens[$i]->name === 'T_RANGE') { - $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value); + $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value, []); $i++; } while ($i < $count) { $token = $tokens[$i]; if ($token->name === 'T_POSIX_CLASS') { - $nodes[] = new RegexNode('token', 'posix_class', $token->value); + $nodes[] = new RegexNode('token', 'posix_class', $token->value, []); $i++; continue; } if ($token->name === 'T_CLASS_NESTED') { - $nodes[] = new RegexNode('token', 'class_', $token->value); + $nodes[] = new RegexNode('token', 'class_', $token->value, []); $i++; continue; } if (!isset($literalNames[$token->name])) { break; } - $literal = new RegexNode('token', $literalNames[$token->name], $token->value); + $literal = new RegexNode('token', $literalNames[$token->name], $token->value, []); if ( $i + 2 < $count && $tokens[$i + 1]->name === 'T_RANGE' && isset($literalNames[$tokens[$i + 2]->name]) ) { - $nodes[] = new RegexNode('#range', children: [ + $nodes[] = new RegexNode('#range', '', '', [ $literal, - new RegexNode('token', $literalNames[$tokens[$i + 2]->name], $tokens[$i + 2]->value), + new RegexNode('token', $literalNames[$tokens[$i + 2]->name], $tokens[$i + 2]->value, []), ]); $i += 3; if ($i < $count && $tokens[$i]->name === 'T_RANGE') { - $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value); + $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value, []); $i++; } continue; @@ -1303,7 +1303,7 @@ private static function reduceCharacterClass(\Phplrt\Parser\Context $ctx, mixed $i++; } if ($i < $count && $tokens[$i]->name === 'T_RANGE') { - $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value); + $nodes[] = new RegexNode('token', 'range', $tokens[$i]->value, []); $i++; } if ($i !== $count) { @@ -1311,7 +1311,7 @@ private static function reduceCharacterClass(\Phplrt\Parser\Context $ctx, mixed } $negative = $children->id === self::T_NEGATIVE_CLASS_FC || $children->id === self::T_NEGATIVE_CLASS; - return new RegexNode($negative ? '#negativeclass' : '#class', children: $nodes); + return new RegexNode($negative ? '#negativeclass' : '#class', '', '', $nodes); } private static function reduceCapturing(\Phplrt\Parser\Context $ctx, mixed $children): mixed @@ -1322,27 +1322,27 @@ private static function reduceCapturing(\Phplrt\Parser\Context $ctx, mixed $chil $opening = \array_shift($children); switch ($opening->id) { case self::T_MARKER: - return new RegexNode('#mark', children: [ - new RegexNode('token', 'name', $opening->captures[0]), + return new RegexNode('#mark', '', '', [ + new RegexNode('token', 'name', $opening->captures[0], []), ]); case self::T_COMMENT: - return new RegexNode('#comment', children: $opening->captures[0] === '' ? [] : [ - new RegexNode('token', 'comment', $opening->captures[0]), + return new RegexNode('#comment', '', '', $opening->captures[0] === '' ? [] : [ + new RegexNode('token', 'comment', $opening->captures[0], []), ]); case self::T_NAMED_CAPTURING: - \array_unshift($children, new RegexNode('token', 'capturing_name', $opening->captures[0])); - return new RegexNode('#namedcapturing', children: $children); + \array_unshift($children, new RegexNode('token', 'capturing_name', $opening->captures[0], [])); + return new RegexNode('#namedcapturing', '', '', $children); case self::T_NON_CAPTURING: - return new RegexNode('#noncapturing', children: $children); + return new RegexNode('#noncapturing', '', '', $children); case self::T_NON_CAPTURING_INTERNAL_OPTION: - \array_unshift($children, new RegexNode('token', 'non_capturing_internal_option', $opening->value)); - return new RegexNode('#noncapturing', children: $children); + \array_unshift($children, new RegexNode('token', 'non_capturing_internal_option', $opening->value, [])); + return new RegexNode('#noncapturing', '', '', $children); case self::T_NON_CAPTURING_RESET: - return new RegexNode('#noncapturingreset', children: $children); + return new RegexNode('#noncapturingreset', '', '', $children); case self::T_ATOMIC_GROUP: - return new RegexNode('#atomicgroup', children: $children); + return new RegexNode('#atomicgroup', '', '', $children); default: - return new RegexNode('#capturing', children: $children); + return new RegexNode('#capturing', '', '', $children); } } @@ -1353,7 +1353,7 @@ private static function reduceLiteral(\Phplrt\Parser\Context $ctx, mixed $childr self::T_SUBROUTINE_G => 'subroutine', ]; - return new RegexNode('token', $names[$children->id] ?? \strtolower(\substr($children->name, 2)), $children->value); + return new RegexNode('token', $names[$children->id] ?? \strtolower(\substr($children->name, 2)), $children->value, []); } private static function reduceCondition(\Phplrt\Parser\Context $ctx, mixed $children): mixed @@ -1361,16 +1361,16 @@ private static function reduceCondition(\Phplrt\Parser\Context $ctx, mixed $chil $reference = \array_shift($children); switch ($reference->id) { case self::T_NAMED_REFERENCE: - \array_unshift($children, new RegexNode('token', 'capturing_name', $reference->captures[0])); - return new RegexNode('#namedcondition', children: $children); + \array_unshift($children, new RegexNode('token', 'capturing_name', $reference->captures[0], [])); + return new RegexNode('#namedcondition', '', '', $children); case self::T_ABSOLUTE_REFERENCE: - \array_unshift($children, new RegexNode('token', 'index', $reference->captures[0])); - return new RegexNode('#absolutecondition', children: $children); + \array_unshift($children, new RegexNode('token', 'index', $reference->captures[0], [])); + return new RegexNode('#absolutecondition', '', '', $children); case self::T_RELATIVE_REFERENCE: - \array_unshift($children, new RegexNode('token', 'index', $reference->captures[0])); - return new RegexNode('#relativecondition', children: $children); + \array_unshift($children, new RegexNode('token', 'index', $reference->captures[0], [])); + return new RegexNode('#relativecondition', '', '', $children); default: - return new RegexNode('#assertioncondition', children: $children); + return new RegexNode('#assertioncondition', '', '', $children); } } } diff --git a/src/Type/Regex/RegexGroupParser.php b/src/Type/Regex/RegexGroupParser.php index 0aea8561d35..e63966760e9 100644 --- a/src/Type/Regex/RegexGroupParser.php +++ b/src/Type/Regex/RegexGroupParser.php @@ -160,7 +160,7 @@ public function parseGroups(string $regex): ?RegexAstWalkResult private function createEmptyTokenRegexNode(): RegexNode { - return new RegexNode('token', 'literal', ''); + return new RegexNode('token', 'literal', '', []); } private function containsSubroutineCall(RegexNode $ast): bool @@ -213,7 +213,7 @@ private function updateCapturingAstAddEmptyToken(RegexNode $ast): void return; } - $ast->setChildren([new RegexNode('#alternation', children: [$this->createEmptyTokenRegexNode()])]); + $ast->setChildren([new RegexNode('#alternation', children: [$this->createEmptyTokenRegexNode()], valueToken: '', valueValue: '')]); } private function containsEscapeK(RegexNode $ast): bool diff --git a/src/Type/UsefulTypeAliasResolver.php b/src/Type/UsefulTypeAliasResolver.php index d35864b3a1a..7406935461f 100644 --- a/src/Type/UsefulTypeAliasResolver.php +++ b/src/Type/UsefulTypeAliasResolver.php @@ -42,7 +42,7 @@ public function __construct( int $resolvedLocalTypeAliasesCountMax, ) { - $this->resolvedLocalTypeAliases = new LruCache($resolvedLocalTypeAliasesCountMax); + $this->resolvedLocalTypeAliases = new LruCache($resolvedLocalTypeAliasesCountMax, 0, 0); } public function hasTypeAlias(string $aliasName, ?string $classNameScope): bool diff --git a/tests/PHPStan/Analyser/AnalyserIntegrationTest.php b/tests/PHPStan/Analyser/AnalyserIntegrationTest.php index 0daf5224b3d..5b4f43c8181 100644 --- a/tests/PHPStan/Analyser/AnalyserIntegrationTest.php +++ b/tests/PHPStan/Analyser/AnalyserIntegrationTest.php @@ -1848,6 +1848,9 @@ private function runAnalyse(string $file, ?array $allAnalysedFiles = null): arra $analyser->analyse([$file], null, null, true, $allAnalysedFiles), false, true, + null, + null, + [], )->getErrors(); foreach ($errors as $error) { $this->assertSame($file, $error->getFilePath()); diff --git a/tests/PHPStan/Analyser/AnalyserResultFinalizerTest.php b/tests/PHPStan/Analyser/AnalyserResultFinalizerTest.php index b2a53bb6258..fbeb9d97c42 100644 --- a/tests/PHPStan/Analyser/AnalyserResultFinalizerTest.php +++ b/tests/PHPStan/Analyser/AnalyserResultFinalizerTest.php @@ -32,6 +32,7 @@ static function (string $ruleClass) use (&$events): void { static function () use (&$events): void { $events[] = 'post'; }, + [], )->getAnalyserResult(); $this->assertSame([ @@ -62,6 +63,7 @@ static function (string $ruleClass) use (&$events): void { static function () use (&$events): void { $events[] = 'post'; }, + [], ); $this->fail('The exception should have been rethrown in debug mode.'); } catch (RuntimeException $e) { @@ -113,6 +115,7 @@ private function createAnalyserResult(): AnalyserResult reachedInternalErrorsCountLimit: false, peakMemoryUsageBytes: 0, processedFiles: [], + workerCount: 0, ); } diff --git a/tests/PHPStan/Analyser/AnalyserTest.php b/tests/PHPStan/Analyser/AnalyserTest.php index 8c68cedc877..476d2cddd5a 100644 --- a/tests/PHPStan/Analyser/AnalyserTest.php +++ b/tests/PHPStan/Analyser/AnalyserTest.php @@ -815,7 +815,7 @@ private function runAnalyser( self::getContainer()->getByType(ValueDependencyCollector::class), false, ); - $analyserResult = $finalizer->finalize($analyserResult, $onlyFiles, false)->getAnalyserResult(); + $analyserResult = $finalizer->finalize($analyserResult, $onlyFiles, false, null, null, [])->getAnalyserResult(); $ignoredErrorHelperProcessedResult = $ignoredErrorHelperResult->process($analyserResult->getErrors(), $onlyFiles, $normalizedFilePaths, $analyserResult->hasReachedInternalErrorsCountLimit()); $errors = $ignoredErrorHelperProcessedResult->getNotIgnoredErrors(); diff --git a/tests/PHPStan/Analyser/AnalyserWithCheckDynamicPropertiesTest.php b/tests/PHPStan/Analyser/AnalyserWithCheckDynamicPropertiesTest.php index 5538225e419..057caa38c11 100644 --- a/tests/PHPStan/Analyser/AnalyserWithCheckDynamicPropertiesTest.php +++ b/tests/PHPStan/Analyser/AnalyserWithCheckDynamicPropertiesTest.php @@ -28,6 +28,9 @@ private function runAnalyse(string $file): array $analyser->analyse([$file], null, null, true), false, true, + null, + null, + [], )->getErrors(); foreach ($errors as $error) { $this->assertSame($file, $error->getFilePath()); diff --git a/tests/PHPStan/Analyser/Bug8526IntegrationTest.php b/tests/PHPStan/Analyser/Bug8526IntegrationTest.php index 2600ccd28af..2136e9a534b 100644 --- a/tests/PHPStan/Analyser/Bug8526IntegrationTest.php +++ b/tests/PHPStan/Analyser/Bug8526IntegrationTest.php @@ -30,6 +30,9 @@ private function runAnalyse(string $file): array $analyser->analyse([$file], null, null, true), false, true, + null, + null, + [], )->getErrors(); foreach ($errors as $error) { $this->assertSame($file, $error->getFilePath()); diff --git a/tests/PHPStan/Analyser/CollectedDataRuleReuseTest.php b/tests/PHPStan/Analyser/CollectedDataRuleReuseTest.php index 1aab55f6e6c..ef1f7b81138 100644 --- a/tests/PHPStan/Analyser/CollectedDataRuleReuseTest.php +++ b/tests/PHPStan/Analyser/CollectedDataRuleReuseTest.php @@ -44,14 +44,14 @@ public function testRuleRunsAgainOnlyWhenWhatItAskedForChanged(): void // FirstCollector collected nothing, so the rule returns before it asks for SecondCollector $result = $this->finalize([$rule], [ self::B => [SecondCollector::class => ['b1']], - ], false, []); + ], false, [], true, null); $this->assertSame(1, $rule->runs); $this->assertSame([], $this->getMessages($result)); // SecondCollector changed, but the rule did not ask for it $result = $this->finalize([$rule], [ self::B => [SecondCollector::class => ['b2']], - ], false, $result->getCollectedDataRuleResults()); + ], false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(1, $rule->runs); $this->assertSame(1, $result->getReusedRulesCount()); @@ -59,7 +59,7 @@ public function testRuleRunsAgainOnlyWhenWhatItAskedForChanged(): void $result = $this->finalize([$rule], [ self::A => [FirstCollector::class => ['a1']], self::B => [SecondCollector::class => ['b2']], - ], false, $result->getCollectedDataRuleResults()); + ], false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(2, $rule->runs); $this->assertSame(['Second collected b2.'], $this->getMessages($result)); @@ -67,7 +67,7 @@ public function testRuleRunsAgainOnlyWhenWhatItAskedForChanged(): void $result = $this->finalize([$rule], [ self::A => [FirstCollector::class => ['a1']], self::B => [SecondCollector::class => ['b3']], - ], false, $result->getCollectedDataRuleResults()); + ], false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(3, $rule->runs); $this->assertSame(['Second collected b3.'], $this->getMessages($result)); @@ -75,7 +75,7 @@ public function testRuleRunsAgainOnlyWhenWhatItAskedForChanged(): void $result = $this->finalize([$rule], [ self::A => [FirstCollector::class => ['a1']], self::B => [SecondCollector::class => ['b3']], - ], false, $result->getCollectedDataRuleResults()); + ], false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(3, $rule->runs); $this->assertSame(1, $result->getReusedRulesCount()); $this->assertSame(['Second collected b3.'], $this->getMessages($result)); @@ -88,14 +88,14 @@ public function testOrderOfFilesDoesNotMatter(): void self::A => [FirstCollector::class => ['a1']], self::B => [SecondCollector::class => ['b1']], self::C => [SecondCollector::class => ['c1']], - ], false, []); + ], false, [], true, null); // a merged result cache lists the files in another order than a full analysis does $result = $this->finalize([$rule], [ self::C => [SecondCollector::class => ['c1']], self::A => [FirstCollector::class => ['a1']], self::B => [SecondCollector::class => ['b1']], - ], false, $result->getCollectedDataRuleResults()); + ], false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(1, $rule->runs); $this->assertSame(1, $result->getReusedRulesCount()); } @@ -108,11 +108,11 @@ public function testOnlyFilesAnalysis(): void self::A => [FirstCollector::class => ['a1']], ]; - $result = $this->finalize([$onlyFilesRule, $earlyReturnRule], $collectedData, false, []); + $result = $this->finalize([$onlyFilesRule, $earlyReturnRule], $collectedData, false, [], true, null); $this->assertSame(['Full analysis.'], $this->getMessages($result)); // only the rule that asked for isOnlyFilesAnalysis() runs again - $result = $this->finalize([$onlyFilesRule, $earlyReturnRule], $collectedData, true, $result->getCollectedDataRuleResults()); + $result = $this->finalize([$onlyFilesRule, $earlyReturnRule], $collectedData, true, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(2, $onlyFilesRule->runs); $this->assertSame(1, $earlyReturnRule->runs); $this->assertSame([], $this->getMessages($result)); @@ -125,10 +125,10 @@ public function testRuleThatThrowsIsNotReused(): void self::A => [FirstCollector::class => ['a1']], ]; - $result = $this->finalize([$rule], $collectedData, false, []); + $result = $this->finalize([$rule], $collectedData, false, [], true, null); $this->assertSame([], $result->getCollectedDataRuleResults()); - $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults()); + $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(2, $rule->runs); $this->assertSame(['Function notThere not found while trying to analyse it - discovering symbols is probably not configured properly.'], $this->getMessages($result)); } @@ -143,10 +143,10 @@ public function testTwoRulesOfTheSameClassKeepTheirOwnResults(): void self::B => [SecondCollector::class => ['b1']], ]; - $result = $this->finalize([$first, $second, $third], $collectedData, false, []); + $result = $this->finalize([$first, $second, $third], $collectedData, false, [], true, null); $this->assertCount(3, $result->getCollectedDataRuleResults()); - $result = $this->finalize([$first, $second, $third], $collectedData, false, $result->getCollectedDataRuleResults()); + $result = $this->finalize([$first, $second, $third], $collectedData, false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(3, $result->getReusedRulesCount()); $this->assertSame(['Full analysis.', 'Second collected b1.', 'Second collected b1.'], $this->getMessages($result)); } @@ -166,12 +166,12 @@ public function testRuleRunsAgainWhenATrackedValueChanged(): void self::A => [FirstCollector::class => ['a1']], ]; - $result = $this->finalize([$rule], $collectedData, false, []); + $result = $this->finalize([$rule], $collectedData, false, [], true, null); $this->assertSame(1, $rule->runs); $this->assertSame(['File says one, directory has 1 files, value is a.'], $this->getMessages($result)); // nothing changed - $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults()); + $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(1, $rule->runs); $this->assertSame(1, $result->getReusedRulesCount()); $this->assertSame(['File says one, directory has 1 files, value is a.'], $this->getMessages($result)); @@ -179,26 +179,26 @@ public function testRuleRunsAgainWhenATrackedValueChanged(): void // the tracked file changed - in size too, FileContentHasher memoizes by mtime and size file_put_contents($file, 'three'); clearstatcache(); - $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults()); + $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(2, $rule->runs); $this->assertSame(['File says three, directory has 1 files, value is a.'], $this->getMessages($result)); // a file appeared in the tracked directory file_put_contents($directory . '/b.txt', ''); - $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults()); + $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(3, $rule->runs); $this->assertSame(['File says three, directory has 2 files, value is a.'], $this->getMessages($result)); // a file that does not match the pattern does not count file_put_contents($directory . '/c.md', ''); - $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults()); + $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(3, $rule->runs); $this->assertSame(1, $result->getReusedRulesCount()); // the value declared through trackValueDependency() changed file_put_contents($valueFile, 'bb'); clearstatcache(); - $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults()); + $result = $this->finalize([$rule], $collectedData, false, $result->getCollectedDataRuleResults(), true, null); $this->assertSame(4, $rule->runs); $this->assertSame(['File says three, directory has 2 files, value is bb.'], $this->getMessages($result)); @@ -260,20 +260,20 @@ public function testEveryRuleRunsWithoutTheFeatureToggle(): void self::B => [SecondCollector::class => ['b1']], ]; - $result = $this->finalize([$rule], $collectedData, false, [], false); + $result = $this->finalize([$rule], $collectedData, false, [], false, null); $this->assertSame([], $result->getCollectedDataRuleResults()); - $previousResults = $this->finalize([$rule], $collectedData, false, [])->getCollectedDataRuleResults(); + $previousResults = $this->finalize([$rule], $collectedData, false, [], true, null)->getCollectedDataRuleResults(); $this->assertCount(1, $previousResults); $this->assertSame(2, $rule->runs); - $result = $this->finalize([$rule], $collectedData, false, $previousResults, false); + $result = $this->finalize([$rule], $collectedData, false, $previousResults, false, null); $this->assertSame(3, $rule->runs); $this->assertSame(0, $result->getReusedRulesCount()); $this->assertSame(['Second collected b1.'], $this->getMessages($result)); // without the toggle, the declared values are not asked for, as before - $result = $this->finalize([new UnregisteredValueRule()], $collectedData, false, [], false); + $result = $this->finalize([new UnregisteredValueRule()], $collectedData, false, [], false, null); $this->assertSame(['Unregistered value.'], $this->getMessages($result)); } @@ -282,7 +282,7 @@ public function testEveryRuleRunsWithoutTheFeatureToggle(): void * @param CollectorData $collectedData * @param array $previousResults */ - private function finalize(array $rules, array $collectedData, bool $onlyFiles, array $previousResults, bool $reuse = true, ?ValueDependencyCollector $valueDependencyCollector = null): FinalizerResult + private function finalize(array $rules, array $collectedData, bool $onlyFiles, array $previousResults, bool $reuse, ?ValueDependencyCollector $valueDependencyCollector): FinalizerResult { $finalizer = new AnalyserResultFinalizer( new DirectRegistry($rules), @@ -312,6 +312,7 @@ private function finalize(array $rules, array $collectedData, bool $onlyFiles, a reachedInternalErrorsCountLimit: false, peakMemoryUsageBytes: 0, processedFiles: [], + workerCount: 0, ), $onlyFiles, false, null, null, $previousResults); } diff --git a/tests/PHPStan/Analyser/ExpressionResultTest.php b/tests/PHPStan/Analyser/ExpressionResultTest.php index 33ec3060600..7dae8484826 100644 --- a/tests/PHPStan/Analyser/ExpressionResultTest.php +++ b/tests/PHPStan/Analyser/ExpressionResultTest.php @@ -246,7 +246,7 @@ private function processExpressionStatement(Stmt\Expression $stmt): ExpressionRe new ExpressionResultStorage(), static function (): void { }, - ExpressionContext::createTopLevel(), + ExpressionContext::createTopLevel(true), ); } @@ -265,10 +265,20 @@ public function testFinalizePreservesPreliminaryResult(): void [], static fn (): IntegerType => $type, SpecifiedTypes::emptySpecifyCallback(), + false, + null, + null, + null, + null, + null, + null, + null, + null, + null, ); $finalScope = $scope->assignVariable('value', $type, $type, TrinaryLogic::createYes()); - $throwPoints = [InternalThrowPoint::createImplicit($finalScope, $expr)]; - $flow = VariableFlow::read('value'); + $throwPoints = [InternalThrowPoint::createImplicit($finalScope, $expr, null)]; + $flow = VariableFlow::read('value', null, false, null); $final = $result->finalize($finalScope, true, true, $throwPoints, [], $flow, null); $this->assertNotSame($result, $final); @@ -308,6 +318,16 @@ public function testKeepVoidType(Type $rawType, Type $projectedType): void [], static fn (): Type => $rawType, SpecifiedTypes::emptySpecifyCallback(), + false, + null, + null, + null, + null, + null, + null, + null, + null, + null, ); $this->assertTrue($rawType->equals($result->getKeepVoidType(false))); @@ -354,6 +374,16 @@ static function () use ($calls): SpecifiedTypes { $calls->narrowing++; return new SpecifiedTypes([], []); }, + false, + null, + null, + null, + null, + null, + null, + null, + null, + null, ); if (($resolved & 1) !== 0) { $this->assertSame($type, $result->getType()); @@ -362,7 +392,7 @@ static function () use ($calls): SpecifiedTypes { $this->assertSame($nativeType, $result->getNativeType()); } $context = TypeSpecifierContext::createTruthy(); - $specifiedTypes = $result->getSpecifiedTypes($context); + $specifiedTypes = $result->getSpecifiedTypes($context, false); $newScope = $scope->assignVariable('other', $type, $type, TrinaryLogic::createYes()); switch ($method) { case 'finalize': @@ -388,7 +418,7 @@ static function () use ($calls): SpecifiedTypes { $this->assertSame($nativeType, $copy->getNativeType()); $this->assertSame($type, $copy->getKeepVoidType(false)); $this->assertSame($nativeType, $copy->getKeepVoidType(true)); - $this->assertSame($specifiedTypes, $copy->getSpecifiedTypes($context)); + $this->assertSame($specifiedTypes, $copy->getSpecifiedTypes($context, false)); $this->assertSame(2, $calls->types); $this->assertSame(1, $calls->narrowing); } diff --git a/tests/PHPStan/Analyser/Generics/TemplateArgumentResolverTest.php b/tests/PHPStan/Analyser/Generics/TemplateArgumentResolverTest.php index eb6e2d2ae33..580283b12c5 100644 --- a/tests/PHPStan/Analyser/Generics/TemplateArgumentResolverTest.php +++ b/tests/PHPStan/Analyser/Generics/TemplateArgumentResolverTest.php @@ -35,7 +35,7 @@ class TemplateArgumentResolverTest extends PHPStanTestCase { /** @param non-empty-string $name */ - private static function template(string $className, string $name, ?TemplateTypeVariance $variance = null): TemplateType + private static function template(string $className, string $name, ?TemplateTypeVariance $variance): TemplateType { return TemplateTypeFactory::create( TemplateTypeScope::createWithClass($className), @@ -47,7 +47,7 @@ private static function template(string $className, string $name, ?TemplateTypeV private static function markerOfA(Expr $site, ?Type $initialType): UnresolvedTemplateArgumentType { - return new UnresolvedTemplateArgumentType($site, self::template(A\A::class, 'T'), $initialType); + return new UnresolvedTemplateArgumentType($site, self::template(A\A::class, 'T', null), $initialType); } /** @return array{TemplateArgumentConstraints, Expr, GenericObjectType} */ @@ -72,7 +72,7 @@ public function testInvariantSendResolvesToTheFirstAcceptingSend(): void $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new StringType()]), $ofMarker)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new IntegerType()]), $ofMarker)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [TypeCombinator::union(new IntegerType(), new StringType())]), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('int', self::describe($frame->resolve($site, 'T')), 'string does not accept 1, int is the first accepting send, int|string never widens it'); $this->assertNull($frame->resolve($site, 'U')); @@ -83,7 +83,7 @@ public function testNoAcceptingSendKeepsTheInitialType(): void { [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new StringType()]), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('1', self::describe($frame->resolve($site, 'T'))); } @@ -91,19 +91,19 @@ public function testNoAcceptingSendKeepsTheInitialType(): void public function testNothingInferredResolvesToTheBoundOrToTheSend(): void { [$constraints, $site] = self::constraintsWithA(null); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('mixed', self::describe($frame->resolve($site, 'T'))); [$constraints, $site, $ofMarker] = self::constraintsWithA(null); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new StringType()]), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('string', self::describe($frame->resolve($site, 'T')), 'nothing inferred is accepted by every send'); } public function testEmptyInputRemainsNever(): void { [$constraints, $site] = self::constraintsWithA(new NeverType()); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('*NEVER*', self::describe($frame->resolve($site, 'T'))); } @@ -111,9 +111,9 @@ public function testMixedAndTemplateTargetsAreNotSends(): void { [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new MixedType()]), $ofMarker)); - $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [self::template('Other', 'X')]), $ofMarker)); - $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(self::template('Other', 'X'), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [self::template('Other', 'X', null)]), $ofMarker)); + $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(self::template('Other', 'X', null), $ofMarker)); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('1', self::describe($frame->resolve($site, 'T'))); } @@ -122,18 +122,18 @@ public function testLowerBoundsUnionWithTheInitialUnlessASendWins(): void { [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); $marker = $ofMarker->getTypes()[0]; - $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument($marker, new ConstantIntegerType(2))); - $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument($marker, new ConstantStringType('a'))); - $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument(new ArrayType(new IntegerType(), $marker), new ArrayType(new IntegerType(), new NullType()))); - $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument(new CallableType([], $marker, false), new CallableType([], new StringType(), false))); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument($marker, new ConstantIntegerType(2), false)); + $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument($marker, new ConstantStringType('a'), false)); + $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument(new ArrayType(new IntegerType(), $marker), new ArrayType(new IntegerType(), new NullType()), false)); + $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument(new CallableType([], $marker, false), new CallableType([], new StringType(), false), false)); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame("1|2|'a'|null", self::describe($frame->resolve($site, 'T')), 'callable parameters are contravariant and contribute nothing'); [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); - $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument($ofMarker->getTypes()[0], new ConstantStringType('a'))); + $constraints = $constraints->merge((new TemplateArgumentObserver())->collectArgument($ofMarker->getTypes()[0], new ConstantStringType('a'), false)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new IntegerType()]), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('int', self::describe($frame->resolve($site, 'T')), 'the send wins; the second pass reports the incompatible lower bound at the call'); } @@ -143,25 +143,25 @@ public function testVariance(): void // call-site covariant target, known initial: not clamped [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new IntegerType()], variances: [TemplateTypeVariance::createCovariant()]), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('1', self::describe($frame->resolve($site, 'T'))); // call-site covariant target, nothing inferred: the upper bound is the best information [$constraints, $site, $ofMarker] = self::constraintsWithA(null); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new IntegerType()], variances: [TemplateTypeVariance::createCovariant()]), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('int', self::describe($frame->resolve($site, 'T'))); // call-site contravariant target: a lower bound [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new IntegerType()], variances: [TemplateTypeVariance::createContravariant()]), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('int', self::describe($frame->resolve($site, 'T'))); // bivariant target: nothing [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new IntegerType()], variances: [TemplateTypeVariance::createBivariant()]), $ofMarker)); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('1', self::describe($frame->resolve($site, 'T'))); // @template-covariant class: the declared variance is the effective one @@ -170,14 +170,14 @@ public function testVariance(): void $covariantMarker = new UnresolvedTemplateArgumentType($site, self::template(C\Covariant::class, 'T', TemplateTypeVariance::createCovariant()), new ConstantIntegerType(1)); $constraints = $constraints->withSite($covariantMarker); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(C\Covariant::class, [new IntegerType()]), new GenericObjectType(C\Covariant::class, [$covariantMarker]))); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('1', self::describe($frame->resolve($site, 'T'))); $constraints = TemplateArgumentConstraints::createEmpty(); $unresolvableCovariantMarker = new UnresolvedTemplateArgumentType($site, self::template(C\Covariant::class, 'T', TemplateTypeVariance::createCovariant()), null); $constraints = $constraints->withSite($unresolvableCovariantMarker); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(C\Covariant::class, [new IntegerType()]), new GenericObjectType(C\Covariant::class, [$unresolvableCovariantMarker]))); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('int', self::describe($frame->resolve($site, 'T'))); } @@ -186,10 +186,10 @@ public function testSendThroughAncestorAndUnionsAndNestedSites(): void // SubA extends A: the send to A reaches U through @extends $constraints = TemplateArgumentConstraints::createEmpty(); $site = new Variable('site'); - $marker = new UnresolvedTemplateArgumentType($site, self::template(A\SubA::class, 'U'), new ConstantIntegerType(1)); + $marker = new UnresolvedTemplateArgumentType($site, self::template(A\SubA::class, 'U', null), new ConstantIntegerType(1)); $constraints = $constraints->withSite($marker); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(TypeCombinator::union(new GenericObjectType(A\A::class, [new IntegerType()]), new NullType()), TypeCombinator::union(new GenericObjectType(A\SubA::class, [$marker]), new NullType()))); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('int', self::describe($frame->resolve($site, 'U'))); // wrap(new Foo(1)): the outer site's inferred argument carries the inner site @@ -204,14 +204,14 @@ public function testSendThroughAncestorAndUnionsAndNestedSites(): void new GenericObjectType(A\A::class, [new GenericObjectType(A\A::class, [new IntegerType()])]), new GenericObjectType(A\A::class, [$outer]), )); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('PHPStan\Type\Test\A\A', self::describe($frame->resolve($outerSite, 'T'))); $this->assertSame('int', self::describe($frame->resolve($innerSite, 'T'))); // array element sends [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); $constraints = $constraints->merge((new TemplateArgumentObserver())->collectSend(new ArrayType(new IntegerType(), new GenericObjectType(A\A::class, [new IntegerType()])), new ArrayType(new IntegerType(), $ofMarker))); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('int', self::describe($frame->resolve($site, 'T'))); } @@ -221,7 +221,7 @@ public function testInitialTypesUnionAcrossReproducedMarkers(): void $site = new Variable('site'); $constraints = $constraints->withSite(self::markerOfA($site, new ConstantIntegerType(1))); $constraints = $constraints->withSite(self::markerOfA($site, new ConstantIntegerType(2))); - $frame = (new TemplateArgumentResolver())->resolve($constraints, null, []); + $frame = (new TemplateArgumentResolver())->resolve($constraints, null, [], null, []); $this->assertSame('1|2', self::describe($frame->resolve($site, 'T'))); } @@ -229,20 +229,20 @@ public function testInitialTypesUnionAcrossReproducedMarkers(): void public function testContextsAndConstraintsRemainUnchangedByResolution(): void { [$constraints, $site, $ofMarker] = self::constraintsWithA(new ConstantIntegerType(1)); - $collecting = new TemplateArgumentFrame(null); + $collecting = new TemplateArgumentFrame(null, null, [], null, [], [], false, [], [], []); $branch = $constraints->merge((new TemplateArgumentObserver())->collectSend(new GenericObjectType(A\A::class, [new IntegerType()]), $ofMarker)); $resolver = new TemplateArgumentResolver(); - $parent = $resolver->resolve($branch, null, []); + $parent = $resolver->resolve($branch, null, [], null, []); $this->assertTrue($collecting->isObserving()); $this->assertNull($collecting->resolve($site, 'T')); $this->assertSame('', $collecting->getResolutionCacheKeySuffix()); - $this->assertSame('1', self::describe($resolver->resolve($constraints, null, [])->resolve($site, 'T'))); + $this->assertSame('1', self::describe($resolver->resolve($constraints, null, [], null, [])->resolve($site, 'T'))); $this->assertSame('int', self::describe($parent->resolve($site, 'T'))); $this->assertFalse($parent->isObserving()); $this->assertNotSame('', $parent->getResolutionCacheKeySuffix()); - $child = new TemplateArgumentFrame($parent); + $child = new TemplateArgumentFrame($parent, null, [], null, [], [], false, [], [], []); $this->assertTrue($child->isObserving()); $this->assertSame('int', self::describe($child->resolve($site, 'T'))); $this->assertSame($parent->getResolutionCacheKeySuffix(), $child->getResolutionCacheKeySuffix()); @@ -263,9 +263,9 @@ public function testReturnTypeCacheDistinguishesImmutableResolutions(): void $marker = new UnresolvedTemplateArgumentType($site, $template, new ConstantIntegerType(1)); $constraints = TemplateArgumentConstraints::createEmpty()->withSite($marker); $resolver = new TemplateArgumentResolver(); - $initial = $resolver->resolve($constraints, null, []); - $sent = $resolver->resolve($constraints->withSend($marker, new IntegerType(), TemplateTypeVariance::createInvariant()), null, []); - $collecting = new TemplateArgumentFrame(null); + $initial = $resolver->resolve($constraints, null, [], null, []); + $sent = $resolver->resolve($constraints->withSend($marker, new IntegerType(), TemplateTypeVariance::createInvariant()), null, [], null, []); + $collecting = new TemplateArgumentFrame(null, null, [], null, [], [], false, [], [], []); $unresolved = $variant->getReturnTypeWithUnresolvedTemplateArguments($site, $collecting, true); $this->assertSame('PHPStan\Type\Test\A\A<1>', self::describe($variant->getReturnTypeWithUnresolvedTemplateArguments($site, $initial, true))); @@ -294,14 +294,14 @@ public function testConcreteReturnTypeKeepsExistingMarkers(): void [], ); $observer = new TemplateArgumentObserver(); - $resolved = (new TemplateArgumentResolver())->resolve($constraints->merge($observer->collectSend(new GenericObjectType(A\A::class, [new IntegerType()]), $type)), null, []); + $resolved = (new TemplateArgumentResolver())->resolve($constraints->merge($observer->collectSend(new GenericObjectType(A\A::class, [new IntegerType()]), $type)), null, [], null, []); self::assertFalse($type->hasTemplateOrLateResolvableType()); - foreach ([new TemplateArgumentFrame(null), $resolved] as $frame) { + foreach ([new TemplateArgumentFrame(null, null, [], null, [], [], false, [], [], []), $resolved] as $frame) { foreach ([true, false] as $allowUnresolved) { $result = $variant->getReturnTypeWithUnresolvedTemplateArguments($site, $frame, $allowUnresolved); self::assertTrue($type->equals($result)); - $observed = (new TemplateArgumentResolver())->resolve($observer->collectSites($result), null, []); + $observed = (new TemplateArgumentResolver())->resolve($observer->collectSites($result), null, [], null, []); self::assertSame('1', self::describe($observed->resolve($site, 'T'))); } } @@ -314,20 +314,20 @@ public function testSiteAttributionByTokenPosition(): void $inThird = new Variable('b', ['startTokenPos' => 20]); $constraints = $constraints->withSite(self::markerOfA($inSecond, null)); $resolver = new TemplateArgumentResolver(); - $frame = $resolver->resolve($constraints, null, [0, 10, 20]); + $frame = $resolver->resolve($constraints, null, [0, 10, 20], null, []); $this->assertSame(1, $frame->firstSiteStatementIndex()); $this->assertTrue($frame->ownsSiteInStatement(1)); $this->assertFalse($frame->ownsSiteInStatement(2)); $this->assertTrue($frame->hasSiteAtOrAfter(1)); $this->assertFalse($frame->hasSiteAtOrAfter(2)); - $extended = $resolver->resolve($constraints->withSite(self::markerOfA($inThird, null)), null, [0, 10, 20]); + $extended = $resolver->resolve($constraints->withSite(self::markerOfA($inThird, null)), null, [0, 10, 20], null, []); $this->assertTrue($extended->ownsSiteInStatement(2)); $this->assertSame(1, $extended->firstSiteStatementIndex()); $this->assertFalse($frame->ownsSiteInStatement(2)); // An unpositioned site conservatively starts the re-walk at the beginning. - $extended = $resolver->resolve($constraints->withSite(self::markerOfA(new Variable('c'), null)), null, [0, 10, 20]); + $extended = $resolver->resolve($constraints->withSite(self::markerOfA(new Variable('c'), null)), null, [0, 10, 20], null, []); $this->assertSame(0, $extended->firstSiteStatementIndex()); } diff --git a/tests/PHPStan/Analyser/ResultCache/ResultCachePathTransformerTest.php b/tests/PHPStan/Analyser/ResultCache/ResultCachePathTransformerTest.php index 551bd449f08..a810a6f25fd 100644 --- a/tests/PHPStan/Analyser/ResultCache/ResultCachePathTransformerTest.php +++ b/tests/PHPStan/Analyser/ResultCache/ResultCachePathTransformerTest.php @@ -121,7 +121,7 @@ public function testCollectedDataRuleResultsTraitContextsAreRelativized(): void filePath: $traitFile, traitContexts: [$traitFile => $traitFile . ' (in context of class Foo)'], ); - $results = ['SomeRule#0' => new CollectedDataRuleResult([], null, [$error])]; + $results = ['SomeRule#0' => new CollectedDataRuleResult([], null, [$error], [])]; $relativized = $transformer->relativizeCollectedDataRuleResults($results); $this->assertSame( @@ -144,7 +144,7 @@ public function testCollectedDataRuleResultsKeepAnErrorWithoutFile(): void { $transformer = new ResultCachePathTransformer(self::raw('/opt/project/vendor/phpstan/phpstan')); $error = new Error('Message', AnalyserResultFinalizer::NO_FILE, null); - $results = ['SomeRule#0' => new CollectedDataRuleResult([], null, [$error])]; + $results = ['SomeRule#0' => new CollectedDataRuleResult([], null, [$error], [])]; $roundTrip = $transformer->absolutizeCollectedDataRuleResults($transformer->relativizeCollectedDataRuleResults($results)); $this->assertSame(AnalyserResultFinalizer::NO_FILE, $roundTrip['SomeRule#0']->getErrors()[0]->getFile()); diff --git a/tests/PHPStan/Analyser/ScopeTest.php b/tests/PHPStan/Analyser/ScopeTest.php index 1912d549581..2efe59ddfce 100644 --- a/tests/PHPStan/Analyser/ScopeTest.php +++ b/tests/PHPStan/Analyser/ScopeTest.php @@ -240,7 +240,7 @@ public function testGeneralize(Type $a, Type $b, string $expectedTypeDescription $scopeFactory = self::getContainer()->getByType(ScopeFactory::class); $scopeA = $scopeFactory->create(ScopeContext::create('file.php'))->assignVariable('a', $a, $a, TrinaryLogic::createYes()); $scopeB = $scopeFactory->create(ScopeContext::create('file.php'))->assignVariable('a', $b, $b, TrinaryLogic::createYes()); - $resultScope = $scopeA->generalizeWith($scopeB); + $resultScope = $scopeA->generalizeWith($scopeB, null); $this->assertSame($expectedTypeDescription, $resultScope->getVariableType('a')->describe(VerbosityLevel::precise())); } diff --git a/tests/PHPStan/Build/NoOptionalParameterRuleTest.php b/tests/PHPStan/Build/NoOptionalParameterRuleTest.php new file mode 100644 index 00000000000..2058151c3ca --- /dev/null +++ b/tests/PHPStan/Build/NoOptionalParameterRuleTest.php @@ -0,0 +1,69 @@ + + */ +final class NoOptionalParameterRuleTest extends RuleTestCase +{ + + protected function getRule(): Rule + { + return new NoOptionalParameterRule(); + } + + public function testRule(): void + { + $this->analyse([__DIR__ . '/data/no-optional-parameter.php'], [ + [ + 'Parameter $optional of function NoOptionalParameter\\internalFunction() must not be optional. Optional parameters are allowed only in @api code.', + 5, + ], + [ + 'Parameter $optional of method NoOptionalParameter\\InternalClass::__construct() must not be optional. Optional parameters are allowed only in @api code.', + 17, + ], + [ + 'Parameter $optional of method NoOptionalParameter\\InternalClass::method() must not be optional. Optional parameters are allowed only in @api code.', + 21, + ], + [ + 'Parameter $optional of method NoOptionalParameter\\ApiClass::__construct() must not be optional. Optional parameters are allowed only in @api code.', + 39, + ], + [ + 'Parameter $optional of method NoOptionalParameter\\ApiClass::privateMethod() must not be optional. Optional parameters are allowed only in @api code.', + 51, + ], + [ + 'Parameter $optional of method NoOptionalParameter\\FinalApiClass::protectedMethod() must not be optional. Optional parameters are allowed only in @api code.', + 66, + ], + [ + 'Parameter $optional of method NoOptionalParameter\\DoNotImplementOnlyClass::method() must not be optional. Optional parameters are allowed only in @api code.', + 76, + ], + [ + 'Parameter $b of method NoOptionalParameter\\InternalInterface::method() must not be optional. Optional parameters are allowed only in @api code.', + 85, + ], + [ + 'Parameter $c of method NoOptionalParameter\\Implementation::method() must not be optional. Optional parameters are allowed only in @api code.', + 92, + ], + [ + 'Parameter $another of method NoOptionalParameter\\ChildOfInternalClass::method() must not be optional. Optional parameters are allowed only in @api code.', + 101, + ], + [ + 'Parameter $c of method NoOptionalParameter\\TraitImplementingInterface::method() must not be optional. Optional parameters are allowed only in @api code.', + 120, + ], + ]); + } + +} diff --git a/tests/PHPStan/Build/data/no-optional-parameter.php b/tests/PHPStan/Build/data/no-optional-parameter.php new file mode 100644 index 00000000000..17711fb4b0a --- /dev/null +++ b/tests/PHPStan/Build/data/no-optional-parameter.php @@ -0,0 +1,131 @@ + $optional; + } + + /** @api */ + public function apiMethod(int $optional = 1): void + { + } + +} + +/** @api */ +class ApiClass +{ + + public function __construct(int $optional = 1) + { + } + + public function publicMethod(int $optional = 1): void + { + } + + protected function protectedMethod(int $optional = 1): void + { + } + + private function privateMethod(int $optional = 1): void + { + } + +} + +/** @api */ +final class FinalApiClass +{ + + /** @api */ + public function __construct(int $optional = 1) + { + } + + protected function protectedMethod(int $optional = 1): void + { + } + +} + +/** @api-do-not-implement */ +class DoNotImplementOnlyClass +{ + + public function method(int $optional = 1): void + { + } + +} + +interface InternalInterface +{ + + public function method(int $a, int $b = 1): void; + +} + +class Implementation implements InternalInterface +{ + + public function method(int $a, int $b = 1, int $c = 2): void + { + } + +} + +class ChildOfInternalClass extends InternalClass +{ + + public function method(int $required, ?int $optional = null, int $another = 1): void + { + } + +} + +class ThirdPartyChild extends \Exception +{ + + public function __construct(string $message = '', int $code = 0) + { + parent::__construct($message, $code); + } + +} + +trait TraitImplementingInterface +{ + + public function method(int $a, int $b = 1, int $c = 2): void + { + } + +} + +class UsesTraitImplementingInterface implements InternalInterface +{ + + use TraitImplementingInterface; + +} diff --git a/tests/PHPStan/Command/CommandHelperTest.php b/tests/PHPStan/Command/CommandHelperTest.php index c2795c5b4da..786e57e9953 100644 --- a/tests/PHPStan/Command/CommandHelperTest.php +++ b/tests/PHPStan/Command/CommandHelperTest.php @@ -130,6 +130,7 @@ public function testBegin( null, null, false, + false, ); if ($expectException) { $this->fail(); @@ -354,6 +355,7 @@ public function testResolveParameters( null, null, false, + false, ); $parameters = $result->getContainer()->getParameters(); foreach ($expectedParameters as $name => $expectedValue) { @@ -386,6 +388,7 @@ public function testAutoloadFileAndConfigurationAreNormalized(): void null, null, false, + false, ); $parameters = $result->getContainer()->getParameters(); $relativePaths = __DIR__ . DIRECTORY_SEPARATOR . 'relative-paths' . DIRECTORY_SEPARATOR; diff --git a/tests/PHPStan/File/DirectoryWalkerTest.php b/tests/PHPStan/File/DirectoryWalkerTest.php index a3f459eaf7a..8a1de000b0d 100644 --- a/tests/PHPStan/File/DirectoryWalkerTest.php +++ b/tests/PHPStan/File/DirectoryWalkerTest.php @@ -36,7 +36,7 @@ protected function setUp(): void public function testWalkAlwaysSeesTheCurrentState(): void { - $walker = new DirectoryWalker(new FileStatSignatures()); + $walker = new DirectoryWalker(new FileStatSignatures(), ''); $beforeAdding = $walker->walk($this->directory, ['php']); file_put_contents($this->directory . '/second.php', 'walkCached($this->directory, ['php']); file_put_contents($this->directory . '/second.php', 'directory . '/notes.txt', 'x'); $phpFiles = $walker->walkCached($this->directory, ['php']); diff --git a/tests/PHPStan/Internal/LruCacheTest.php b/tests/PHPStan/Internal/LruCacheTest.php index 5f56b631479..63e7317c818 100644 --- a/tests/PHPStan/Internal/LruCacheTest.php +++ b/tests/PHPStan/Internal/LruCacheTest.php @@ -14,7 +14,7 @@ public function testMissingEntry(): void // nothing ever put in: without a declared value type the cache is // LruCache and get() is statically null /** @var LruCache $cache */ - $cache = new LruCache(); + $cache = new LruCache(0, 0, 0); $this->assertNull($cache->get('a')); $this->assertSame(0, $cache->count()); @@ -22,7 +22,7 @@ public function testMissingEntry(): void public function testGetTouchesTheEntry(): void { - $cache = new LruCache(); + $cache = new LruCache(0, 0, 0); $cache->set('a', 'A', 1); $cache->set('b', 'B', 1); @@ -34,7 +34,7 @@ public function testGetTouchesTheEntry(): void public function testCountEvictionDropsTheLeastRecentlyUsed(): void { - $cache = new LruCache(maxCount: 2); + $cache = new LruCache(maxCount: 2, maxWeight: 0, weightEvictionFloorCount: 0); $this->assertSame([], $cache->set('a', 'A', 1)); $this->assertSame([], $cache->set('b', 'B', 1)); @@ -47,7 +47,7 @@ public function testCountEvictionDropsTheLeastRecentlyUsed(): void public function testWeightEvictionMakesRoomForTheIncomingEntry(): void { - $cache = new LruCache(maxWeight: 10); + $cache = new LruCache(maxWeight: 10, maxCount: 0, weightEvictionFloorCount: 0); $cache->set('a', 'A', 6); $this->assertSame([], $cache->set('b', 'B', 4)); @@ -57,7 +57,7 @@ public function testWeightEvictionMakesRoomForTheIncomingEntry(): void public function testWeightEvictionStopsAtTheFloor(): void { - $cache = new LruCache(maxWeight: 10, weightEvictionFloorCount: 2); + $cache = new LruCache(maxWeight: 10, weightEvictionFloorCount: 2, maxCount: 0); $cache->set('a', 'A', 5); $cache->set('b', 'B', 5); @@ -68,7 +68,7 @@ public function testWeightEvictionStopsAtTheFloor(): void public function testSetReplacesAnEntryAndAccountsForItsNewWeight(): void { - $cache = new LruCache(maxWeight: 10); + $cache = new LruCache(maxWeight: 10, maxCount: 0, weightEvictionFloorCount: 0); $cache->set('a', 'A', 9); $cache->set('a', 'AA', 2); @@ -79,7 +79,7 @@ public function testSetReplacesAnEntryAndAccountsForItsNewWeight(): void public function testReplaceKeepsTheWeightAndEvictsNothing(): void { - $cache = new LruCache(maxCount: 2, maxWeight: 10); + $cache = new LruCache(maxCount: 2, maxWeight: 10, weightEvictionFloorCount: 0); $cache->set('a', 'A', 5); $cache->set('b', 'B', 5); @@ -91,7 +91,7 @@ public function testReplaceKeepsTheWeightAndEvictsNothing(): void public function testReplacingAMissingEntryIsABug(): void { - $cache = new LruCache(); + $cache = new LruCache(0, 0, 0); $this->expectException(ShouldNotHappenException::class); $cache->replace('a', 'A'); @@ -99,7 +99,7 @@ public function testReplacingAMissingEntryIsABug(): void public function testNoLimitsMeansNoEviction(): void { - $cache = new LruCache(); + $cache = new LruCache(0, 0, 0); for ($i = 0; $i < 100; $i++) { $this->assertSame([], $cache->set('k' . $i, $i, 1_000_000)); } diff --git a/tests/PHPStan/Process/Restart/ExtensionRegistryTest.php b/tests/PHPStan/Process/Restart/ExtensionRegistryTest.php index 635e672d12f..5962fd69216 100644 --- a/tests/PHPStan/Process/Restart/ExtensionRegistryTest.php +++ b/tests/PHPStan/Process/Restart/ExtensionRegistryTest.php @@ -179,7 +179,7 @@ public function testCollectReasonsFor( array $expectedExtensions, ): void { - $reasons = RestartExtensionRegistry::collectReasonsFor($loadedExtensions, $iniSettings, $turboExtensionPath, $allowXdebug); + $reasons = RestartExtensionRegistry::collectReasonsFor($loadedExtensions, $iniSettings, $turboExtensionPath, $allowXdebug, [], []); $this->assertSame( $expectedExtensions, @@ -191,7 +191,7 @@ public function testXdebugIsFlaggedRatherThanStripped(): void { // stripping would take xdebug_*() out of reflection and so change what // PHPStan knows about code calling them; the flag measures the same - $reasons = RestartExtensionRegistry::collectReasonsFor(['xdebug'], ['xdebug.mode' => 'debug'], null, false); + $reasons = RestartExtensionRegistry::collectReasonsFor(['xdebug'], ['xdebug.mode' => 'debug'], null, false, [], []); $this->assertCount(1, $reasons); $this->assertSame([], $reasons[0]->getStrippedExtensions()); @@ -203,7 +203,7 @@ public function testXdebugIsFlaggedRatherThanStripped(): void public function testPcovIsFlaggedRatherThanStripped(): void { - $reasons = RestartExtensionRegistry::collectReasonsFor(['pcov'], ['pcov.enabled' => '1'], null, false); + $reasons = RestartExtensionRegistry::collectReasonsFor(['pcov'], ['pcov.enabled' => '1'], null, false, [], []); $this->assertCount(1, $reasons); $this->assertSame([], $reasons[0]->getStrippedExtensions()); @@ -214,7 +214,7 @@ public function testPcovIsFlaggedRatherThanStripped(): void public function testTidewaysIsStrippedRatherThanFlagged(): void { - $reasons = RestartExtensionRegistry::collectReasonsFor(['tideways', 'phpstan_turbo'], [], null, false); + $reasons = RestartExtensionRegistry::collectReasonsFor(['tideways', 'phpstan_turbo'], [], null, false, [], []); $this->assertCount(1, $reasons); $this->assertSame(['tideways'], $reasons[0]->getStrippedExtensions()); @@ -225,7 +225,7 @@ public function testTidewaysIsStrippedRatherThanFlagged(): void public function testTurboIsAppendedToTheCommandLineTogetherWithItsMarker(): void { - $reasons = RestartExtensionRegistry::collectReasonsFor([], [], self::TURBO_BINARY, false); + $reasons = RestartExtensionRegistry::collectReasonsFor([], [], self::TURBO_BINARY, false, [], []); $this->assertCount(1, $reasons); $this->assertSame([], $reasons[0]->getStrippedExtensions()); @@ -273,11 +273,11 @@ public function testCollectReasonsDescribesTheCurrentProcess(): void // the test suite runs with coverage off and without the turbo binary of // a phar installation, so this only asserts that the real-process entry // point agrees with what the process actually has loaded - foreach (RestartExtensionRegistry::collectReasons(false) as $reason) { + foreach (RestartExtensionRegistry::collectReasons(false, null) as $reason) { $this->assertContains($reason->getExtension(), ['xdebug', 'pcov', 'uopz', 'phpstan_turbo', 'tideways', 'opcache']); } - $this->assertSame([], RestartExtensionRegistry::collectReasonsFor([], [], null, false)); + $this->assertSame([], RestartExtensionRegistry::collectReasonsFor([], [], null, false, [], [])); } public function testIsXdebugActiveRequiresTheExtension(): void diff --git a/tests/PHPStan/Process/Restart/RestartManagerTest.php b/tests/PHPStan/Process/Restart/RestartManagerTest.php index 4513e0096ae..4835706fe6a 100644 --- a/tests/PHPStan/Process/Restart/RestartManagerTest.php +++ b/tests/PHPStan/Process/Restart/RestartManagerTest.php @@ -98,7 +98,7 @@ public function testTheMarkerStopsASecondRestart(): void putenv(sprintf('%s=xdebug,pcov', RestartManager::REASONS_ENV_VARIABLE)); $this->assertFalse(RestartManager::isEligible($argv)); - $this->assertSame([], RestartManager::collectReasons($argv)); + $this->assertSame([], RestartManager::collectReasons($argv, null, 'phpstan')); } public function testABlackfireProfiledProcessIsNotRestarted(): void @@ -133,17 +133,17 @@ public function testTheDeprecatedAllowXdebugEnvVariableIsHonored(): void { $argv = ['bin/phpstan', 'analyse', 'src']; - $this->assertFalse(RestartManager::isXdebugAllowed($argv)); - $this->assertTrue(RestartManager::isXdebugAllowed(['bin/phpstan', 'analyse', '--xdebug', 'src'])); + $this->assertFalse(RestartManager::isXdebugAllowed($argv, 'phpstan')); + $this->assertTrue(RestartManager::isXdebugAllowed(['bin/phpstan', 'analyse', '--xdebug', 'src'], 'phpstan')); putenv('PHPSTAN_ALLOW_XDEBUG=1'); - $this->assertTrue(RestartManager::isXdebugAllowed($argv)); + $this->assertTrue(RestartManager::isXdebugAllowed($argv, 'phpstan')); putenv('PHPSTAN_ALLOW_XDEBUG=0'); - $this->assertFalse(RestartManager::isXdebugAllowed($argv)); + $this->assertFalse(RestartManager::isXdebugAllowed($argv, 'phpstan')); putenv('PHPSTAN_ALLOW_XDEBUG='); - $this->assertFalse(RestartManager::isXdebugAllowed($argv)); + $this->assertFalse(RestartManager::isXdebugAllowed($argv, 'phpstan')); } public function testAnotherApplicationHasItsOwnAllowXdebugEnvVariable(): void @@ -159,8 +159,8 @@ public function testAnotherApplicationHasItsOwnAllowXdebugEnvVariable(): void public function testNonRestartingCommandsCollectNoReasons(): void { - $this->assertSame([], RestartManager::collectReasons(['bin/phpstan', 'worker'])); - $this->assertSame([], RestartManager::collectReasons(['bin/phpstan', 'diagnose'])); + $this->assertSame([], RestartManager::collectReasons(['bin/phpstan', 'worker'], null, 'phpstan')); + $this->assertSame([], RestartManager::collectReasons(['bin/phpstan', 'diagnose'], null, 'phpstan')); } public function testAForkedWorkerDoesNotDeleteTheComposedIni(): void diff --git a/tests/PHPStan/Process/Restart/data/forked-child-ends.php b/tests/PHPStan/Process/Restart/data/forked-child-ends.php index a97a29b6648..acf6772c208 100644 --- a/tests/PHPStan/Process/Restart/data/forked-child-ends.php +++ b/tests/PHPStan/Process/Restart/data/forked-child-ends.php @@ -11,7 +11,7 @@ $temporaryIni = (string) getenv('PHPSTAN_RESTART_INI'); // diagnose never restarts, so this only takes ownership of the ini -RestartManager::run(['bin/phpstan', 'diagnose']); +RestartManager::run(['bin/phpstan', 'diagnose'], null, null, 'phpstan'); $pid = pcntl_fork(); if ($pid === 0) { diff --git a/tests/PHPStan/Reflection/BetterReflection/SourceLocator/AutoloadFunctionsSourceLocatorTest.php b/tests/PHPStan/Reflection/BetterReflection/SourceLocator/AutoloadFunctionsSourceLocatorTest.php index 14e2751690e..47ee819f288 100644 --- a/tests/PHPStan/Reflection/BetterReflection/SourceLocator/AutoloadFunctionsSourceLocatorTest.php +++ b/tests/PHPStan/Reflection/BetterReflection/SourceLocator/AutoloadFunctionsSourceLocatorTest.php @@ -50,7 +50,7 @@ class_alias(AFoo::class, 'ThrowingAutoloaderAlias'); ]; try { - $locator = $this->createLocator(); + $locator = $this->createLocator(null); $reflection = $locator->locateIdentifier( new DefaultReflector($locator), new Identifier('ThrowingAutoloaderAlias', new IdentifierType(IdentifierType::IDENTIFIER_CLASS)), @@ -76,7 +76,7 @@ static function (string $class): void { ]; try { - $locator = $this->createLocator(); + $locator = $this->createLocator(null); $reflection = $locator->locateIdentifier( new DefaultReflector($locator), new Identifier('NeverDefinedByAnyAutoloader', new IdentifierType(IdentifierType::IDENTIFIER_CLASS)), @@ -125,7 +125,7 @@ static function (string $class): void { $this->assertStringContainsString('by a bootstrap autoloader for class NeverDefinedByAnyAutoloader: Cannot read the class map.', $printed); } - private function createLocator(?BootstrapAutoloaderExceptionReporter $reporter = null): AutoloadFunctionsSourceLocator + private function createLocator(?BootstrapAutoloaderExceptionReporter $reporter): AutoloadFunctionsSourceLocator { $container = self::getContainer(); diff --git a/tests/PHPStan/Type/Generic/UnresolvedTemplateArgumentTypeTest.php b/tests/PHPStan/Type/Generic/UnresolvedTemplateArgumentTypeTest.php index 7b7691b5bb2..1aab146f6b9 100644 --- a/tests/PHPStan/Type/Generic/UnresolvedTemplateArgumentTypeTest.php +++ b/tests/PHPStan/Type/Generic/UnresolvedTemplateArgumentTypeTest.php @@ -26,7 +26,7 @@ class UnresolvedTemplateArgumentTypeTest extends PHPStanTestCase { /** @param non-empty-string $name */ - private static function template(string $name, ?TemplateTypeVariance $variance = null): TemplateType + private static function template(string $name, ?TemplateTypeVariance $variance): TemplateType { return TemplateTypeFactory::create( TemplateTypeScope::createWithClass(A\A::class), @@ -37,20 +37,20 @@ private static function template(string $name, ?TemplateTypeVariance $variance = } /** @param non-empty-string $name */ - private static function marker(Expr $site, ?Type $initialType, string $name = 'T'): UnresolvedTemplateArgumentType + private static function marker(Expr $site, ?Type $initialType, string $name): UnresolvedTemplateArgumentType { - return new UnresolvedTemplateArgumentType($site, self::template($name), $initialType); + return new UnresolvedTemplateArgumentType($site, self::template($name, null), $initialType); } public function testEqualsIsOpaqueAndKeyedBySiteAndName(): void { $site = new Variable('a'); $otherSite = new Variable('b'); - $marker = self::marker($site, new ConstantIntegerType(1)); + $marker = self::marker($site, new ConstantIntegerType(1), 'T'); - $this->assertTrue($marker->equals(self::marker($site, new ConstantIntegerType(2))), 'initial type is ignored'); - $this->assertTrue($marker->equals(self::marker($site, null))); - $this->assertFalse($marker->equals(self::marker($otherSite, new ConstantIntegerType(1)))); + $this->assertTrue($marker->equals(self::marker($site, new ConstantIntegerType(2), 'T')), 'initial type is ignored'); + $this->assertTrue($marker->equals(self::marker($site, null, 'T'))); + $this->assertFalse($marker->equals(self::marker($otherSite, new ConstantIntegerType(1), 'T'))); $this->assertFalse($marker->equals(self::marker($site, new ConstantIntegerType(1), 'U'))); $this->assertFalse($marker->equals(new ConstantIntegerType(1))); $this->assertFalse((new ConstantIntegerType(1))->equals($marker)); @@ -59,7 +59,7 @@ public function testEqualsIsOpaqueAndKeyedBySiteAndName(): void public function testFiniteValueIdentityDoesNotEraseMarkers(): void { foreach ([new ConstantIntegerType(123), new ConstantStringType('foo'), new ConstantBooleanType(true), new NullType(), new EnumCaseObjectType('PHPStan\Fixture\ManyCasesTestEnum', 'A')] as $initialType) { - $marker = self::marker(new Variable('a'), $initialType); + $marker = self::marker(new Variable('a'), $initialType, 'T'); $union = new UnionType([$marker, new ConstantIntegerType(321)]); $resolvedUnion = new UnionType([$initialType, new ConstantIntegerType(321)]); @@ -71,7 +71,7 @@ public function testFiniteValueIdentityDoesNotEraseMarkers(): void public function testBehavesAsItsDelegate(): void { - $marker = self::marker(new Variable('a'), new ConstantIntegerType(1)); + $marker = self::marker(new Variable('a'), new ConstantIntegerType(1), 'T'); $this->assertTrue((new IntegerType())->isSuperTypeOf($marker)->yes()); $this->assertTrue((new IntegerType())->accepts($marker, true)->yes()); @@ -80,14 +80,14 @@ public function testBehavesAsItsDelegate(): void $this->assertTrue($marker->isInteger()->yes()); $this->assertSame([1], $marker->getConstantScalarValues()); - $unresolvable = self::marker(new Variable('a'), null); + $unresolvable = self::marker(new Variable('a'), null, 'T'); $this->assertInstanceOf(MixedType::class, $unresolvable->getDelegate()); $this->assertTrue($unresolvable->isObject()->maybe()); } public function testInvariantPositionIsOpaqueCovariantIsTransparent(): void { - $marker = self::marker(new Variable('a'), new IntegerType()); + $marker = self::marker(new Variable('a'), new IntegerType(), 'T'); $ofInt = new GenericObjectType(A\A::class, [new IntegerType()]); $ofMarker = new GenericObjectType(A\A::class, [$marker]); @@ -102,20 +102,20 @@ public function testInvariantPositionIsOpaqueCovariantIsTransparent(): void public function testUnionKeepsMarkersOfDifferentSites(): void { $site = new Variable('a'); - $ofMarker = new GenericObjectType(A\A::class, [self::marker($site, new ConstantIntegerType(1))]); + $ofMarker = new GenericObjectType(A\A::class, [self::marker($site, new ConstantIntegerType(1), 'T')]); $ofInt = new GenericObjectType(A\A::class, [new IntegerType()]); $union = TypeCombinator::union($ofMarker, $ofInt); $this->assertInstanceOf(UnionType::class, $union); $this->assertCount(2, $union->getTypes()); - $sameSite = TypeCombinator::union($ofMarker, new GenericObjectType(A\A::class, [self::marker($site, new ConstantIntegerType(2))])); + $sameSite = TypeCombinator::union($ofMarker, new GenericObjectType(A\A::class, [self::marker($site, new ConstantIntegerType(2), 'T')])); $this->assertInstanceOf(GenericObjectType::class, $sameSite); $nullable = TypeCombinator::union($ofMarker, new NullType()); $this->assertSame('PHPStan\Type\Test\A\A|null', $nullable->describe(VerbosityLevel::precise())); - $otherSite = new GenericObjectType(A\A::class, [self::marker(new Variable('b'), new ConstantIntegerType(1))]); + $otherSite = new GenericObjectType(A\A::class, [self::marker(new Variable('b'), new ConstantIntegerType(1), 'T')]); $twoSites = TypeCombinator::union($ofMarker, $otherSite); $this->assertInstanceOf(UnionType::class, $twoSites); $this->assertCount(2, $twoSites->getTypes()); @@ -123,21 +123,21 @@ public function testUnionKeepsMarkersOfDifferentSites(): void public function testDescribe(): void { - $a = self::marker(new Variable('a'), new ConstantIntegerType(1)); - $b = self::marker(new Variable('b'), new ConstantIntegerType(1)); + $a = self::marker(new Variable('a'), new ConstantIntegerType(1), 'T'); + $b = self::marker(new Variable('b'), new ConstantIntegerType(1), 'T'); $this->assertSame('unresolved(1)', $a->describe(VerbosityLevel::value())); $this->assertSame('unresolved(int)', $a->describe(VerbosityLevel::typeOnly())); $this->assertStringStartsWith('unresolved#', $a->describe(VerbosityLevel::cache())); $this->assertNotSame($a->describe(VerbosityLevel::cache()), $b->describe(VerbosityLevel::cache()), 'cache descriptions are unique per site'); - $this->assertSame('unresolved(mixed)', self::marker(new Variable('a'), null)->describe(VerbosityLevel::precise())); + $this->assertSame('unresolved(mixed)', self::marker(new Variable('a'), null, 'T')->describe(VerbosityLevel::precise())); } public function testTraverseAndGeneralizeKeepTheSite(): void { $site = new Variable('a'); $outer = TemplateTypeFactory::create(TemplateTypeScope::createWithFunction('f'), 'TOuter', new MixedType(), TemplateTypeVariance::createInvariant()); - $marker = self::marker($site, $outer); + $marker = self::marker($site, $outer, 'T'); $this->assertTrue($marker->hasTemplateOrLateResolvableType()); $resolved = TypeTraverser::map($marker, static function (Type $type, callable $traverse) use ($outer): Type { @@ -152,11 +152,11 @@ public function testTraverseAndGeneralizeKeepTheSite(): void $this->assertInstanceOf(IntegerType::class, $resolved->getInitialType()); $this->assertTrue($resolved->equals($marker)); - $generalized = self::marker($site, new ConstantIntegerType(1))->generalize(GeneralizePrecision::lessSpecific()); + $generalized = self::marker($site, new ConstantIntegerType(1), 'T')->generalize(GeneralizePrecision::lessSpecific()); $this->assertInstanceOf(UnresolvedTemplateArgumentType::class, $generalized); $this->assertSame('unresolved(int)', $generalized->describe(VerbosityLevel::precise())); - $unresolvable = self::marker($site, null); + $unresolvable = self::marker($site, null, 'T'); $this->assertSame($unresolvable, $unresolvable->generalize(GeneralizePrecision::lessSpecific())); } diff --git a/tests/PHPStan/Type/LateResolvableArrayShapeTypeTest.php b/tests/PHPStan/Type/LateResolvableArrayShapeTypeTest.php index 805155db043..22a97453c7b 100644 --- a/tests/PHPStan/Type/LateResolvableArrayShapeTypeTest.php +++ b/tests/PHPStan/Type/LateResolvableArrayShapeTypeTest.php @@ -20,13 +20,13 @@ class LateResolvableArrayShapeTypeTest extends PHPStanTestCase private static function createShape(?array $unsealed): Type { return LateResolvableArrayShapeType::create( - [[self::templateType(), new IntegerType(), false]], + [[self::templateType(null), new IntegerType(), false]], $unsealed, ArrayShapeNode::KIND_ARRAY, ); } - private static function templateType(?Type $bound = null): Type + private static function templateType(?Type $bound): Type { return TemplateTypeFactory::create( TemplateTypeScope::createWithFunction('doFoo'), @@ -41,7 +41,7 @@ private static function templateType(?Type $bound = null): Type */ public static function dataDescribe(): iterable { - $templateType = self::templateType(); + $templateType = self::templateType(null); yield 'sealed' => [ LateResolvableArrayShapeType::create( @@ -145,7 +145,7 @@ public function testDescribe(Type $type, string $expectedDescription): void */ public static function dataResolve(): iterable { - $templateType = self::templateType(); + $templateType = self::templateType(null); yield 'constant key' => [ LateResolvableArrayShapeType::create( @@ -236,8 +236,8 @@ public function testResolve(Type $type, Type $resolvedTemplateType, string $expe public function testResolvesToTemplateTypeBoundsWhenTheTemplateTypeStays(): void { $type = LateResolvableArrayShapeType::create( - [[self::templateType(), new IntegerType(), false]], - [self::templateType(), new BooleanType()], + [[self::templateType(null), new IntegerType(), false]], + [self::templateType(null), new BooleanType()], ArrayShapeNode::KIND_ARRAY, ); $this->assertInstanceOf(LateResolvableArrayShapeType::class, $type); @@ -252,8 +252,8 @@ public function testResolvesToTemplateTypeBoundsWhenTheTemplateTypeStays(): void public function testTraverseSimultaneouslyVisitsKeysAndValues(): void { $left = LateResolvableArrayShapeType::create( - [[self::templateType(), new IntegerType(), false]], - [self::templateType(), new BooleanType()], + [[self::templateType(null), new IntegerType(), false]], + [self::templateType(null), new BooleanType()], ArrayShapeNode::KIND_ARRAY, ); $right = LateResolvableArrayShapeType::create( diff --git a/tests/bench/BenchCase.php b/tests/bench/BenchCase.php index 779718d72a8..a67daa1818e 100644 --- a/tests/bench/BenchCase.php +++ b/tests/bench/BenchCase.php @@ -33,6 +33,9 @@ protected function runAnalyse(string $file, ?array $allAnalysedFiles = null): ar $analyser->analyse([$file], null, null, true, $allAnalysedFiles), false, true, + null, + null, + [], )->getErrors(); } diff --git a/turbo-ext/src/ArgsResult.cpp b/turbo-ext/src/ArgsResult.cpp index aa17d7b35f4..ad7d625ed1c 100644 --- a/turbo-ext/src/ArgsResult.cpp +++ b/turbo-ext/src/ArgsResult.cpp @@ -228,7 +228,7 @@ PT_MINIT_REGISTRATION(pt_register_args_result) cls.method(sigs::__construct, [](INTERNAL_FUNCTION_PARAMETERS) { zval *expressionResult, *resolvedParametersAcceptor, *argResults, *byRefArguments = NULL; - if (!zp::parse>(execute_data, expressionResult, resolvedParametersAcceptor, argResults, byRefArguments)) RETURN_THROWS(); + if (!zp::parse(execute_data, expressionResult, resolvedParametersAcceptor, argResults, byRefArguments)) RETURN_THROWS(); ArgsResult(Z_OBJ_P(ZEND_THIS)).construct(expressionResult, resolvedParametersAcceptor, argResults, byRefArguments); }); diff --git a/turbo-ext/src/ArgumentsHandler.cpp b/turbo-ext/src/ArgumentsHandler.cpp index 8551f011a8b..f0d4f33c9e2 100644 --- a/turbo-ext/src/ArgumentsHandler.cpp +++ b/turbo-ext/src/ArgumentsHandler.cpp @@ -3129,7 +3129,7 @@ PT_MINIT_REGISTRATION(pt_register_arguments_handler) cls.method(sigs::processArgs, [](INTERNAL_FUNCTION_PARAMETERS) { zval *nodeScopeResolver, *stmt, *calleeReflection, *nakedMethodReflection, *parametersAcceptors, *namedArgumentsVariants, *callLike, *scope, *storage, *nodeCallback, *context, *closureBindScopeFactory = NULL; - ZEND_PARSE_PARAMETERS_START(11, 12) + ZEND_PARSE_PARAMETERS_START(12, 12) Z_PARAM_OBJECT(nodeScopeResolver) Z_PARAM_OBJECT(stmt) Z_PARAM_ZVAL(calleeReflection) @@ -3141,7 +3141,6 @@ PT_MINIT_REGISTRATION(pt_register_arguments_handler) Z_PARAM_OBJECT(storage) Z_PARAM_ZVAL(nodeCallback) Z_PARAM_OBJECT(context) - Z_PARAM_OPTIONAL Z_PARAM_ZVAL(closureBindScopeFactory) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(ArgumentsHandler(Z_OBJ_P(ZEND_THIS)).processArgs(nodeScopeResolver, stmt, calleeReflection, nakedMethodReflection, parametersAcceptors, namedArgumentsVariants, callLike, scope, storage, nodeCallback, context, closureBindScopeFactory)); diff --git a/turbo-ext/src/ArrayHandler.cpp b/turbo-ext/src/ArrayHandler.cpp index 6174f999bda..200dec47254 100644 --- a/turbo-ext/src/ArrayHandler.cpp +++ b/turbo-ext/src/ArrayHandler.cpp @@ -374,8 +374,8 @@ class ArrayHandler if (UNEXPECTED(variableName.isUndef())) return false; zv::Val parentId = variableWriteGetter(walk.literalWrite.raw(), &pt_variable_write_slots::id, PT_LC("getid")); if (UNEXPECTED(parentId.isUndef())) return false; - zv::Args writeArgv{variableName.raw(), arrayItem, (zend_long) Z_OBJ_HANDLE_P(arrayItem), PT_ARH_KIND_ARRAY_LITERAL_ITEM, true, &offset, parentId.raw()}; - item.itemWrite = pt_type_new(PT_CLASS_VARIABLE_WRITE, 7, writeArgv); + zv::Args writeArgv{variableName.raw(), arrayItem, (zend_long) Z_OBJ_HANDLE_P(arrayItem), PT_ARH_KIND_ARRAY_LITERAL_ITEM, true, &offset, parentId.raw(), true}; + item.itemWrite = pt_type_new(PT_CLASS_VARIABLE_WRITE, 8, writeArgv); if (UNEXPECTED(item.itemWrite.isUndef())) return false; } } diff --git a/turbo-ext/src/AssignHandler.cpp b/turbo-ext/src/AssignHandler.cpp index e249818c5d4..4d6c13c42b0 100644 --- a/turbo-ext/src/AssignHandler.cpp +++ b/turbo-ext/src/AssignHandler.cpp @@ -4903,7 +4903,7 @@ PT_MINIT_REGISTRATION(pt_register_assign_handler) cls.method(sigs::processVirtualAssign, [](INTERNAL_FUNCTION_PARAMETERS) { zval *nodeScopeResolver, *scope, *storage, *stmt, *var, *assignedExpr, *nodeCallback, *assignedExprResult = NULL; - ZEND_PARSE_PARAMETERS_START(7, 8) + ZEND_PARSE_PARAMETERS_START(8, 8) Z_PARAM_OBJECT(nodeScopeResolver) Z_PARAM_OBJECT(scope) Z_PARAM_OBJECT(storage) @@ -4911,7 +4911,6 @@ PT_MINIT_REGISTRATION(pt_register_assign_handler) Z_PARAM_OBJECT(var) Z_PARAM_OBJECT(assignedExpr) Z_PARAM_ZVAL(nodeCallback) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OR_NULL(assignedExprResult) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(AssignHandler(Z_OBJ_P(ZEND_THIS)).processVirtualAssign(nodeScopeResolver, scope, storage, stmt, var, assignedExpr, nodeCallback, assignedExprResult)); diff --git a/turbo-ext/src/ClassConstantAccessType.cpp b/turbo-ext/src/ClassConstantAccessType.cpp index 7a8a50245a3..1fd80b06109 100644 --- a/turbo-ext/src/ClassConstantAccessType.cpp +++ b/turbo-ext/src/ClassConstantAccessType.cpp @@ -256,7 +256,7 @@ PT_MINIT_REGISTRATION(pt_register_class_constant_access_type) cls.method(sigs::__construct, [](INTERNAL_FUNCTION_PARAMETERS) { zval *type, *nativeType = NULL; zend_string *constantName; - if (!zp::parse>(execute_data, type, constantName, nativeType)) RETURN_THROWS(); + if (!zp::parse(execute_data, type, constantName, nativeType)) RETURN_THROWS(); PT_THIS.construct(type, constantName, nativeType); }); diff --git a/turbo-ext/src/ClassStatementsGatherer.cpp b/turbo-ext/src/ClassStatementsGatherer.cpp index 2754ebdc2ef..77c7678e920 100644 --- a/turbo-ext/src/ClassStatementsGatherer.cpp +++ b/turbo-ext/src/ClassStatementsGatherer.cpp @@ -138,8 +138,8 @@ class ClassStatementsGatherer return pushNew(slotIndex, classIdx, 2, args); } - /* new PropertyWrite($fetch, $scope, $promoted[, $originalNode]) appended - * to $propertyUsages */ + /* new PropertyWrite($fetch, $scope, $promoted, $originalNode) appended + * to $propertyUsages; NULL originalNode = null */ bool pushPropertyWrite(zval *fetch, zval *scope, bool promoted, zval *originalNode) { zval args[4]; @@ -148,8 +148,10 @@ class ClassStatementsGatherer ZVAL_BOOL(&args[2], promoted); if (originalNode != NULL) { ZVAL_COPY_VALUE(&args[3], originalNode); + } else { + ZVAL_NULL(&args[3]); } - return pushNew(slots::propertyUsages, PT_CLASS_PROPERTY_WRITE, originalNode != NULL ? 4 : 3, args); + return pushNew(slots::propertyUsages, PT_CLASS_PROPERTY_WRITE, 4, args); } static bool throwShouldNotHappen() diff --git a/turbo-ext/src/ClosureProcessor.cpp b/turbo-ext/src/ClosureProcessor.cpp index 7bc4b1f2065..fc78e8ef6b6 100644 --- a/turbo-ext/src/ClosureProcessor.cpp +++ b/turbo-ext/src/ClosureProcessor.cpp @@ -1557,7 +1557,7 @@ PT_MINIT_REGISTRATION(pt_register_closure_processor) cls.method(sigs::processClosureNode, [](INTERNAL_FUNCTION_PARAMETERS) { zval *nodeScopeResolver, *stmt, *expr, *scope, *storage, *nodeCallback, *context, *passedToType, *nativePassedToType = NULL; - ZEND_PARSE_PARAMETERS_START(8, 9) + ZEND_PARSE_PARAMETERS_START(9, 9) Z_PARAM_OBJECT(nodeScopeResolver) Z_PARAM_OBJECT(stmt) Z_PARAM_OBJECT(expr) @@ -1566,7 +1566,6 @@ PT_MINIT_REGISTRATION(pt_register_closure_processor) Z_PARAM_ZVAL(nodeCallback) Z_PARAM_OBJECT(context) Z_PARAM_OBJECT_OR_NULL(passedToType) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OR_NULL(nativePassedToType) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(ClosureProcessor(Z_OBJ_P(ZEND_THIS)).processClosureNode(nodeScopeResolver, stmt, expr, scope, storage, nodeCallback, context, passedToType, nativePassedToType)); @@ -1584,7 +1583,7 @@ PT_MINIT_REGISTRATION(pt_register_closure_processor) cls.method(sigs::processArrowFunctionNode, [](INTERNAL_FUNCTION_PARAMETERS) { zval *nodeScopeResolver, *stmt, *expr, *scope, *storage, *nodeCallback, *passedToType, *nativePassedToType = NULL, *context = NULL; - ZEND_PARSE_PARAMETERS_START(7, 9) + ZEND_PARSE_PARAMETERS_START(9, 9) Z_PARAM_OBJECT(nodeScopeResolver) Z_PARAM_OBJECT(stmt) Z_PARAM_OBJECT(expr) @@ -1592,7 +1591,6 @@ PT_MINIT_REGISTRATION(pt_register_closure_processor) Z_PARAM_OBJECT(storage) Z_PARAM_ZVAL(nodeCallback) Z_PARAM_OBJECT_OR_NULL(passedToType) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OR_NULL(nativePassedToType) Z_PARAM_OBJECT_OR_NULL(context) ZEND_PARSE_PARAMETERS_END(); diff --git a/turbo-ext/src/ClosureTypeResolver.cpp b/turbo-ext/src/ClosureTypeResolver.cpp index b1127d440d1..afa900e4485 100644 --- a/turbo-ext/src/ClosureTypeResolver.cpp +++ b/turbo-ext/src/ClosureTypeResolver.cpp @@ -85,7 +85,7 @@ zv::Val simpleThrowPointImplicit() return pt_call_static_cached(pt_ctr_simple_throw_point_implicit_site, PT_CLASS_SIMPLE_THROW_POINT, PT_LC("createimplicit"), 0, NULL); } -/* TemplateArgumentStats::$enabled && TemplateArgumentStats::increment('closureTypeBodyWalks'); false = pending exception */ +/* TemplateArgumentStats::$enabled && TemplateArgumentStats::increment('closureTypeBodyWalks', 1); false = pending exception */ [[nodiscard]] bool countClosureTypeBodyWalk() { zend_class_entry *ce = pt_class(PT_CLASS_TEMPLATE_ARGUMENT_STATS); @@ -94,10 +94,11 @@ zv::Val simpleThrowPointImplicit() if (UNEXPECTED(enabled == NULL)) return false; ZVAL_DEREF(enabled); if (EXPECTED(Z_TYPE_P(enabled) != IS_TRUE)) return true; - zval counter; - ZVAL_STRINGL(&counter, "closureTypeBodyWalks", sizeof("closureTypeBodyWalks") - 1); - zv::Val result = pt_call_static_cached(pt_ctr_stats_increment_site, PT_CLASS_TEMPLATE_ARGUMENT_STATS, PT_LC("increment"), 1, &counter); - zval_ptr_dtor(&counter); + zval argv[2]; + ZVAL_STRINGL(&argv[0], "closureTypeBodyWalks", sizeof("closureTypeBodyWalks") - 1); + ZVAL_LONG(&argv[1], 1); + zv::Val result = pt_call_static_cached(pt_ctr_stats_increment_site, PT_CLASS_TEMPLATE_ARGUMENT_STATS, PT_LC("increment"), 2, argv); + zval_ptr_dtor(&argv[0]); return !result.isUndef(); } @@ -1582,10 +1583,9 @@ PT_MINIT_REGISTRATION(pt_register_closure_type_resolver) cls.method(sigs::getClosureType, [](INTERNAL_FUNCTION_PARAMETERS) { zval *scope, *expr, *storage = NULL, *passedToType = NULL; bool shallow = false; - ZEND_PARSE_PARAMETERS_START(2, 5) + ZEND_PARSE_PARAMETERS_START(5, 5) Z_PARAM_OBJECT_OF_CLASS(scope, pt_ce_mutating_scope) Z_PARAM_OBJECT(expr) - Z_PARAM_OPTIONAL Z_PARAM_BOOL(shallow) Z_PARAM_OBJECT_OR_NULL(storage) Z_PARAM_OBJECT_OR_NULL(passedToType) @@ -1597,7 +1597,7 @@ PT_MINIT_REGISTRATION(pt_register_closure_type_resolver) cls.method(sigs::buildClosureTypeForClosure, [](INTERNAL_FUNCTION_PARAMETERS) { zval *scope, *expr, *returnStatements, *yieldStatements, *executionEnds, *throwPoints, *impurePoints, *invalidateExpressions, *storage = NULL, *passedToType = NULL, *nativePassedToType = NULL; bool native = false; - ZEND_PARSE_PARAMETERS_START(8, 12) + ZEND_PARSE_PARAMETERS_START(12, 12) Z_PARAM_OBJECT_OF_CLASS(scope, pt_ce_mutating_scope) Z_PARAM_OBJECT(expr) Z_PARAM_ARRAY(returnStatements) @@ -1606,7 +1606,6 @@ PT_MINIT_REGISTRATION(pt_register_closure_type_resolver) Z_PARAM_ARRAY(throwPoints) Z_PARAM_ARRAY(impurePoints) Z_PARAM_ARRAY(invalidateExpressions) - Z_PARAM_OPTIONAL Z_PARAM_BOOL(native) Z_PARAM_OBJECT_OR_NULL(storage) Z_PARAM_OBJECT_OR_NULL(passedToType) @@ -1619,14 +1618,13 @@ PT_MINIT_REGISTRATION(pt_register_closure_type_resolver) cls.method(sigs::buildClosureTypeForArrowFunction, [](INTERNAL_FUNCTION_PARAMETERS) { zval *scope, *expr, *arrowScope, *throwPoints, *impurePoints, *invalidateExpressions, *storage = NULL, *passedToType = NULL, *nativePassedToType = NULL; bool native = false; - ZEND_PARSE_PARAMETERS_START(6, 10) + ZEND_PARSE_PARAMETERS_START(10, 10) Z_PARAM_OBJECT_OF_CLASS(scope, pt_ce_mutating_scope) Z_PARAM_OBJECT(expr) Z_PARAM_OBJECT_OF_CLASS(arrowScope, pt_ce_mutating_scope) Z_PARAM_ARRAY(throwPoints) Z_PARAM_ARRAY(impurePoints) Z_PARAM_ARRAY(invalidateExpressions) - Z_PARAM_OPTIONAL Z_PARAM_BOOL(native) Z_PARAM_OBJECT_OR_NULL(storage) Z_PARAM_OBJECT_OR_NULL(passedToType) diff --git a/turbo-ext/src/ConditionalExpressionHolderHelper.cpp b/turbo-ext/src/ConditionalExpressionHolderHelper.cpp index 46008d71f0e..5bc3163bca2 100644 --- a/turbo-ext/src/ConditionalExpressionHolderHelper.cpp +++ b/turbo-ext/src/ConditionalExpressionHolderHelper.cpp @@ -422,14 +422,13 @@ PT_MINIT_REGISTRATION(pt_register_conditional_expression_holder_helper) cls.method(sigs::buildConditionalHolderRecipe, [](INTERNAL_FUNCTION_PARAMETERS) { zval *composeScope, *conditionSpecifiedTypes, *holderSpecifiedTypes, *nonVariableTargetScope, *holderSideExpr = NULL; bool holdersFromSureTypes, holderSideIsNegated; - ZEND_PARSE_PARAMETERS_START(6, 7) + ZEND_PARSE_PARAMETERS_START(7, 7) Z_PARAM_OBJECT(composeScope) Z_PARAM_OBJECT(conditionSpecifiedTypes) Z_PARAM_OBJECT(holderSpecifiedTypes) Z_PARAM_BOOL(holdersFromSureTypes) Z_PARAM_BOOL(holderSideIsNegated) Z_PARAM_OBJECT_OR_NULL(nonVariableTargetScope) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OR_NULL(holderSideExpr) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(ConditionalExpressionHolderHelper(Z_OBJ_P(ZEND_THIS)).buildConditionalHolderRecipe(composeScope, conditionSpecifiedTypes, holderSpecifiedTypes, holdersFromSureTypes, holderSideIsNegated, nonVariableTargetScope, holderSideExpr)); diff --git a/turbo-ext/src/DefaultNarrowingHelper.cpp b/turbo-ext/src/DefaultNarrowingHelper.cpp index 85bdbb3038e..259b6ae43e2 100644 --- a/turbo-ext/src/DefaultNarrowingHelper.cpp +++ b/turbo-ext/src/DefaultNarrowingHelper.cpp @@ -2294,12 +2294,11 @@ PT_MINIT_REGISTRATION(pt_register_default_narrowing_helper) cls.method(sigs::createForSubject, [](INTERNAL_FUNCTION_PARAMETERS) { zval *subject, *type, *context, *scope, *resultFor = NULL; - ZEND_PARSE_PARAMETERS_START(4, 5) + ZEND_PARSE_PARAMETERS_START(5, 5) Z_PARAM_OBJECT(subject) Z_PARAM_OBJECT(type) Z_PARAM_OBJECT(context) Z_PARAM_OBJECT(scope) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OF_CLASS_OR_NULL(resultFor, zend_ce_closure) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(PT_DNH_THIS.createForSubject(subject, type, context, scope, resultFor)); diff --git a/turbo-ext/src/Dependencies.cpp b/turbo-ext/src/Dependencies.cpp index cfabaa15d03..0f0d4f2ab70 100644 --- a/turbo-ext/src/Dependencies.cpp +++ b/turbo-ext/src/Dependencies.cpp @@ -260,9 +260,8 @@ PT_MINIT_REGISTRATION(pt_register_dependencies) cls.method(sigs::create, [](INTERNAL_FUNCTION_PARAMETERS) { zend_string *file; zval *types = NULL, *classNames = NULL, *reflections = NULL, *filePaths = NULL, *usedTraits = NULL; - ZEND_PARSE_PARAMETERS_START(1, 6) + ZEND_PARSE_PARAMETERS_START(6, 6) Z_PARAM_STR(file) - Z_PARAM_OPTIONAL Z_PARAM_ARRAY(types) Z_PARAM_ARRAY(classNames) Z_PARAM_ARRAY(reflections) diff --git a/turbo-ext/src/Engine.h b/turbo-ext/src/Engine.h index 3a6289abf2c..40eb89d8d74 100644 --- a/turbo-ext/src/Engine.h +++ b/turbo-ext/src/Engine.h @@ -112,30 +112,14 @@ zv::Val pt_native_closure_to_closure(zval *closure); * implementation (#[GenerateFactory] — every PHPStan container), the native * ExpressionResult is constructed directly, with the extensions collection * that factory passes and the constructor's own invariants and callable - * checks; any other factory gets create() through the engine with the - * optional parameters the call names (`named`) as named arguments. The + * checks; any other factory gets create() through the engine. The * collection is learned from the factory's first result and cached per * factory object (the cache holds the factory, so a new container's factory * can never alias a dead one). */ -enum : uint32_t -{ - PT_ER_NAMED_CONTAINS_NULLSAFE = 1u << 0, - PT_ER_NAMED_ISSETABILITY_DESCRIPTOR = 1u << 1, - PT_ER_NAMED_TRUTHY_SCOPE_OVERRIDE_RESULT = 1u << 2, - PT_ER_NAMED_FALSEY_SCOPE_OVERRIDE_RESULT = 1u << 3, - PT_ER_NAMED_CREATE_TYPES_CALLBACK = 1u << 4, - PT_ER_NAMED_TYPE = 1u << 5, - PT_ER_NAMED_NATIVE_TYPE = 1u << 6, - PT_ER_NAMED_ARGS_RESULT = 1u << 7, - PT_ER_NAMED_VARIABLE_FLOW = 1u << 8, - PT_ER_NAMED_DEPENDENCIES = 1u << 9, -}; - /* create()'s parameters, borrowed: NULL (or an IS_NULL zval) is null, NULL - * throwPoints / impurePoints are []. The required ones go through the - * constructor; set an optional one with its with*() setter, which also - * records that the twin's call passes it. */ + * throwPoints / impurePoints are []. The first nine go through the + * constructor, the others through their with*() setters. */ struct pt_expression_result_args { zval *scope; @@ -157,23 +141,22 @@ struct pt_expression_result_args zval *argsResult = NULL; zval *variableFlow = NULL; zval *dependencies = NULL; - uint32_t named = 0; pt_expression_result_args(zval *scope, zval *beforeScope, zval *expr, bool hasYield, bool isAlwaysTerminating, zval *throwPoints, zval *impurePoints, zval *typeCallback, zval *specifyTypesCallback) : scope(scope), beforeScope(beforeScope), expr(expr), hasYield(hasYield), isAlwaysTerminating(isAlwaysTerminating), throwPoints(throwPoints), impurePoints(impurePoints), typeCallback(typeCallback), specifyTypesCallback(specifyTypesCallback) { } - pt_expression_result_args &withContainsNullsafe(bool value) { containsNullsafe = value; named |= PT_ER_NAMED_CONTAINS_NULLSAFE; return *this; } - pt_expression_result_args &withIssetabilityDescriptor(zval *value) { issetabilityDescriptor = value; named |= PT_ER_NAMED_ISSETABILITY_DESCRIPTOR; return *this; } - pt_expression_result_args &withTruthyScopeOverrideResult(zval *value) { truthyScopeOverrideResult = value; named |= PT_ER_NAMED_TRUTHY_SCOPE_OVERRIDE_RESULT; return *this; } - pt_expression_result_args &withFalseyScopeOverrideResult(zval *value) { falseyScopeOverrideResult = value; named |= PT_ER_NAMED_FALSEY_SCOPE_OVERRIDE_RESULT; return *this; } - pt_expression_result_args &withCreateTypesCallback(zval *value) { createTypesCallback = value; named |= PT_ER_NAMED_CREATE_TYPES_CALLBACK; return *this; } - pt_expression_result_args &withType(zval *value) { type = value; named |= PT_ER_NAMED_TYPE; return *this; } - pt_expression_result_args &withNativeType(zval *value) { nativeType = value; named |= PT_ER_NAMED_NATIVE_TYPE; return *this; } - pt_expression_result_args &withArgsResult(zval *value) { argsResult = value; named |= PT_ER_NAMED_ARGS_RESULT; return *this; } - pt_expression_result_args &withVariableFlow(zval *value) { variableFlow = value; named |= PT_ER_NAMED_VARIABLE_FLOW; return *this; } - pt_expression_result_args &withDependencies(zval *value) { dependencies = value; named |= PT_ER_NAMED_DEPENDENCIES; return *this; } + pt_expression_result_args &withContainsNullsafe(bool value) { containsNullsafe = value; return *this; } + pt_expression_result_args &withIssetabilityDescriptor(zval *value) { issetabilityDescriptor = value; return *this; } + pt_expression_result_args &withTruthyScopeOverrideResult(zval *value) { truthyScopeOverrideResult = value; return *this; } + pt_expression_result_args &withFalseyScopeOverrideResult(zval *value) { falseyScopeOverrideResult = value; return *this; } + pt_expression_result_args &withCreateTypesCallback(zval *value) { createTypesCallback = value; return *this; } + pt_expression_result_args &withType(zval *value) { type = value; return *this; } + pt_expression_result_args &withNativeType(zval *value) { nativeType = value; return *this; } + pt_expression_result_args &withArgsResult(zval *value) { argsResult = value; return *this; } + pt_expression_result_args &withVariableFlow(zval *value) { variableFlow = value; return *this; } + pt_expression_result_args &withDependencies(zval *value) { dependencies = value; return *this; } }; /* $factory->create(...$args); UNDEF = pending exception */ diff --git a/turbo-ext/src/ExpressionContext.cpp b/turbo-ext/src/ExpressionContext.cpp index 59f6656279f..57047ba736b 100644 --- a/turbo-ext/src/ExpressionContext.cpp +++ b/turbo-ext/src/ExpressionContext.cpp @@ -663,13 +663,13 @@ PT_MINIT_REGISTRATION(pt_register_expression_context) cls.method(sigs::createTopLevel, [](INTERNAL_FUNCTION_PARAMETERS) { bool resolveTemplateArguments = true; - if (!zp::parse>(execute_data, resolveTemplateArguments)) RETURN_THROWS(); + if (!zp::parse(execute_data, resolveTemplateArguments)) RETURN_THROWS(); PT_RETURN_VAL(ExpressionContext::createTopLevel(resolveTemplateArguments)); }); cls.method(sigs::createDeep, [](INTERNAL_FUNCTION_PARAMETERS) { bool resolveTemplateArguments = true; - if (!zp::parse>(execute_data, resolveTemplateArguments)) RETURN_THROWS(); + if (!zp::parse(execute_data, resolveTemplateArguments)) RETURN_THROWS(); PT_RETURN_VAL(ExpressionContext::createDeep(resolveTemplateArguments)); }); diff --git a/turbo-ext/src/ExpressionResult.cpp b/turbo-ext/src/ExpressionResult.cpp index c72c7984242..bee5a7ca4cd 100644 --- a/turbo-ext/src/ExpressionResult.cpp +++ b/turbo-ext/src/ExpressionResult.cpp @@ -1300,9 +1300,8 @@ bool pt_expression_result_ask_scope_variable_state_matches(zval *result, zval *s out = matches == 1; return true; } - /* the twin's call passes the third argument only when it is true */ zv::Args argv{scope, useNativeTypes, ruleFacingAsk}; - zv::Val value = pt_type_call(Z_OBJ_P(result), PT_LC("askscopevariablestatematches"), ruleFacingAsk ? 3 : 2, argv); + zv::Val value = pt_type_call(Z_OBJ_P(result), PT_LC("askscopevariablestatematches"), 3, argv); if (UNEXPECTED(value.isUndef())) return false; out = Z_TYPE_P(value.raw()) == IS_TRUE; return true; @@ -1450,8 +1449,7 @@ zv::Val constructDirect(zval *collection, zval *defaultNarrowingHelper, const pt return zv::Val::adopt(object); } -/* $factory->create(...) through the engine: the required parameters - * positionally, the optional ones the call names as named arguments */ +/* $factory->create(...) through the engine */ zv::Val createThroughFactory(zend_object *factory, const pt_expression_result_args &args) { zend_function *create = pt_find_method(factory->ce, PT_LC("create")); @@ -1471,39 +1469,20 @@ zv::Val createThroughFactory(zend_object *factory, const pt_expression_result_ar args.impurePoints != NULL ? args.impurePoints : &emptyArray, orNull(args.typeCallback), orNull(args.specifyTypesCallback), + args.containsNullsafe, + orNull(args.issetabilityDescriptor), + orNull(args.truthyScopeOverrideResult), + orNull(args.falseyScopeOverrideResult), + orNull(args.createTypesCallback), + orNull(args.type), + orNull(args.nativeType), + orNull(args.argsResult), + orNull(args.variableFlow), + orNull(args.dependencies), }; - HashTable named; - zend_hash_init(&named, 8, NULL, NULL, 0); - zval containsNullsafe; - ZVAL_BOOL(&containsNullsafe, args.containsNullsafe); - const struct - { - uint32_t bit; - const char *name; - size_t len; - zval *value; - } optionals[] = { - { PT_ER_NAMED_CONTAINS_NULLSAFE, PT_LC("containsNullsafe"), &containsNullsafe }, - { PT_ER_NAMED_ISSETABILITY_DESCRIPTOR, PT_LC("issetabilityDescriptor"), orNull(args.issetabilityDescriptor) }, - { PT_ER_NAMED_TRUTHY_SCOPE_OVERRIDE_RESULT, PT_LC("truthyScopeOverrideResult"), orNull(args.truthyScopeOverrideResult) }, - { PT_ER_NAMED_FALSEY_SCOPE_OVERRIDE_RESULT, PT_LC("falseyScopeOverrideResult"), orNull(args.falseyScopeOverrideResult) }, - { PT_ER_NAMED_CREATE_TYPES_CALLBACK, PT_LC("createTypesCallback"), orNull(args.createTypesCallback) }, - { PT_ER_NAMED_TYPE, PT_LC("type"), orNull(args.type) }, - { PT_ER_NAMED_NATIVE_TYPE, PT_LC("nativeType"), orNull(args.nativeType) }, - { PT_ER_NAMED_ARGS_RESULT, PT_LC("argsResult"), orNull(args.argsResult) }, - { PT_ER_NAMED_VARIABLE_FLOW, PT_LC("variableFlow"), orNull(args.variableFlow) }, - { PT_ER_NAMED_DEPENDENCIES, PT_LC("dependencies"), orNull(args.dependencies) }, - }; - for (const auto &optional : optionals) { - if ((args.named & optional.bit) != 0) { - zend_hash_str_add(&named, optional.name, optional.len, optional.value); - } - } - zval ret; - zend_call_known_function(create, factory, factory->ce, &ret, 9, argv, zend_hash_num_elements(&named) > 0 ? &named : NULL); - zend_hash_destroy(&named); + zend_call_known_function(create, factory, factory->ce, &ret, 19, argv, NULL); if (UNEXPECTED(EG(exception))) { zval_ptr_dtor(&ret); return zv::Val(); @@ -1599,7 +1578,7 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) * slot */ ptdecl::ExpressionResult::declareProperties(cls); - cls.method("__construct", reg::Public, 11, { + cls.method("__construct", reg::Public, 20, { reg::obj("expressionTypeResolverExtensions", "PHPStan\\DependencyInjection\\ExtensionsCollection"), reg::obj("defaultNarrowingHelper", "PHPStan\\Analyser\\ExprHandler\\Helper\\DefaultNarrowingHelper"), reg::obj("scope", pt_er_scope), @@ -1611,15 +1590,15 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) reg::arrayArg("impurePoints"), reg::callableArg("typeCallback", true), reg::callableArg("specifyTypesCallback"), - reg::withDefault(reg::boolArg("containsNullsafe"), "false"), - reg::withDefault(reg::obj("issetabilityDescriptor", "PHPStan\\Analyser\\IssetabilityDescriptor", true), "null"), - reg::withDefault(reg::obj("truthyScopeOverrideResult", pt_er_self, true), "null"), - reg::withDefault(reg::obj("falseyScopeOverrideResult", pt_er_self, true), "null"), - reg::withDefault(reg::callableArg("createTypesCallback", true), "null"), - reg::withDefault(reg::obj("type", pt_er_type, true), "null"), - reg::withDefault(reg::obj("nativeType", pt_er_type, true), "null"), - reg::withDefault(reg::obj("argsResult", "PHPStan\\Analyser\\ArgsResult", true), "null"), - reg::withDefault(reg::obj("variableFlow", "PHPStan\\Analyser\\VariableFlow", true), "null"), + reg::boolArg("containsNullsafe"), + reg::obj("issetabilityDescriptor", "PHPStan\\Analyser\\IssetabilityDescriptor", true), + reg::obj("truthyScopeOverrideResult", pt_er_self, true), + reg::obj("falseyScopeOverrideResult", pt_er_self, true), + reg::callableArg("createTypesCallback", true), + reg::obj("type", pt_er_type, true), + reg::obj("nativeType", pt_er_type, true), + reg::obj("argsResult", "PHPStan\\Analyser\\ArgsResult", true), + reg::obj("variableFlow", "PHPStan\\Analyser\\VariableFlow", true), reg::withDefault(reg::arrayArg("specifiedTypes"), "[]"), reg::withDefault(reg::obj("cachedType", pt_er_type, true), "null"), reg::withDefault(reg::boolArg("extensionsDeclined"), "false"), @@ -1639,7 +1618,7 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) zval *issetabilityDescriptor = NULL, *truthyScopeOverrideResult = NULL, *falseyScopeOverrideResult = NULL; zval *type = NULL, *nativeType = NULL, *argsResult = NULL, *variableFlow = NULL; zval *specifiedTypes = NULL, *cachedType = NULL, *cachedNativeType = NULL, *resolvedType = NULL, *resolvedNativeType = NULL, *projectedType = NULL, *projectedNativeType = NULL, *readVariableNames = NULL, *dependencies = NULL; - ZEND_PARSE_PARAMETERS_START(11, 30) + ZEND_PARSE_PARAMETERS_START(20, 30) Z_PARAM_OBJECT(a.expressionTypeResolverExtensions) Z_PARAM_OBJECT(a.defaultNarrowingHelper) Z_PARAM_OBJECT(a.scope) @@ -1651,7 +1630,6 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) Z_PARAM_ARRAY(a.impurePoints) Z_PARAM_ZVAL(typeCallback) Z_PARAM_ZVAL(specifyTypesCallback) - Z_PARAM_OPTIONAL Z_PARAM_BOOL(containsNullsafe) Z_PARAM_OBJECT_OR_NULL(issetabilityDescriptor) Z_PARAM_OBJECT_OR_NULL(truthyScopeOverrideResult) @@ -1661,6 +1639,7 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) Z_PARAM_OBJECT_OR_NULL(nativeType) Z_PARAM_OBJECT_OR_NULL(argsResult) Z_PARAM_OBJECT_OR_NULL(variableFlow) + Z_PARAM_OPTIONAL Z_PARAM_ARRAY(specifiedTypes) Z_PARAM_OBJECT_OR_NULL(cachedType) Z_PARAM_BOOL(extensionsDeclined) @@ -1772,7 +1751,7 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) cls.method(sigs::getIssetabilityResolution, [](INTERNAL_FUNCTION_PARAMETERS) { zval *scope; bool useNativeTypes, reprocessUntrackedLinks = false; - if (!zp::parse>(execute_data, scope, useNativeTypes, reprocessUntrackedLinks)) RETURN_THROWS(); + if (!zp::parse(execute_data, scope, useNativeTypes, reprocessUntrackedLinks)) RETURN_THROWS(); PT_ER_RETURN(ExpressionResult(Z_OBJ_P(ZEND_THIS)).getIssetabilityResolution(scope, useNativeTypes, reprocessUntrackedLinks)); }); @@ -1831,7 +1810,7 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) cls.method(sigs::getSpecifiedTypes, [](INTERNAL_FUNCTION_PARAMETERS) { zval *context; bool nativeTypesPromoted = false; - if (!zp::parse>(execute_data, context, nativeTypesPromoted)) RETURN_THROWS(); + if (!zp::parse(execute_data, context, nativeTypesPromoted)) RETURN_THROWS(); PT_ER_RETURN(ExpressionResult(Z_OBJ_P(ZEND_THIS)).getSpecifiedTypes(context, nativeTypesPromoted)); }); @@ -1844,7 +1823,7 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) cls.method(sigs::getCreatedTypes, [](INTERNAL_FUNCTION_PARAMETERS) { zval *type, *context; bool nativeTypesPromoted = false; - if (!zp::parse>(execute_data, type, context, nativeTypesPromoted)) RETURN_THROWS(); + if (!zp::parse(execute_data, type, context, nativeTypesPromoted)) RETURN_THROWS(); PT_ER_RETURN(ExpressionResult(Z_OBJ_P(ZEND_THIS)).getCreatedTypes(type, context, nativeTypesPromoted)); }); @@ -1865,7 +1844,7 @@ PT_MINIT_REGISTRATION(pt_register_expression_result) cls.method(sigs::askScopeVariableStateMatches, [](INTERNAL_FUNCTION_PARAMETERS) { zval *scope; bool useNativeTypes, ruleFacingAsk = false; - if (!zp::parse>(execute_data, scope, useNativeTypes, ruleFacingAsk)) RETURN_THROWS(); + if (!zp::parse(execute_data, scope, useNativeTypes, ruleFacingAsk)) RETURN_THROWS(); PT_ER_RETURN_TRINARY_BOOL(ExpressionResult(Z_OBJ_P(ZEND_THIS)).askScopeVariableStateMatches(scope, useNativeTypes, ruleFacingAsk)); }); diff --git a/turbo-ext/src/InitializerExprTypeResolver.cpp b/turbo-ext/src/InitializerExprTypeResolver.cpp index a8dccb753ac..9a76c4b4a7c 100644 --- a/turbo-ext/src/InitializerExprTypeResolver.cpp +++ b/turbo-ext/src/InitializerExprTypeResolver.cpp @@ -5982,7 +5982,7 @@ PT_MINIT_REGISTRATION(pt_register_initializer_expr_type_resolver) zval *class_, *classReflection, *callable; zend_string *constantName; bool nativeTypesPromoted = false; - if (!zp::parse>(execute_data, class_, constantName, classReflection, callable, nativeTypesPromoted)) RETURN_THROWS(); + if (!zp::parse(execute_data, class_, constantName, classReflection, callable, nativeTypesPromoted)) RETURN_THROWS(); if (UNEXPECTED(!ietrArgCallable(callable, 4))) RETURN_THROWS(); zval nullReflection; if (classReflection == NULL) { diff --git a/turbo-ext/src/InternalThrowPoint.cpp b/turbo-ext/src/InternalThrowPoint.cpp index d96e8c789ee..5af6975a203 100644 --- a/turbo-ext/src/InternalThrowPoint.cpp +++ b/turbo-ext/src/InternalThrowPoint.cpp @@ -219,7 +219,7 @@ PT_MINIT_REGISTRATION(pt_register_internal_throw_point) cls.method(sigs::createImplicit, [](INTERNAL_FUNCTION_PARAMETERS) { zval *scope, *node, *type = NULL; - if (!zp::parse>(execute_data, scope, node, type)) RETURN_THROWS(); + if (!zp::parse(execute_data, scope, node, type)) RETURN_THROWS(); PT_RETURN_VAL(InternalThrowPoint::createImplicit(scope, node, type)); }); diff --git a/turbo-ext/src/IssetabilityDescriptor.cpp b/turbo-ext/src/IssetabilityDescriptor.cpp index ac0026a0fe1..e2a8f79f5c7 100644 --- a/turbo-ext/src/IssetabilityDescriptor.cpp +++ b/turbo-ext/src/IssetabilityDescriptor.cpp @@ -466,7 +466,7 @@ PT_MINIT_REGISTRATION(pt_register_issetability_descriptor) cls.method(sigs::resolve, [](INTERNAL_FUNCTION_PARAMETERS) { zval *scope, *expr; bool useNativeTypes, reprocessUntrackedLinks = false; - if (!zp::parse>(execute_data, scope, useNativeTypes, expr, reprocessUntrackedLinks)) RETURN_THROWS(); + if (!zp::parse(execute_data, scope, useNativeTypes, expr, reprocessUntrackedLinks)) RETURN_THROWS(); PT_RETURN_VAL(IssetabilityDescriptor(Z_OBJ_P(ZEND_THIS)).resolve(scope, useNativeTypes, expr, reprocessUntrackedLinks)); }); diff --git a/turbo-ext/src/IssetabilityResolution.cpp b/turbo-ext/src/IssetabilityResolution.cpp index 3f84abcd9fa..080da383164 100644 --- a/turbo-ext/src/IssetabilityResolution.cpp +++ b/turbo-ext/src/IssetabilityResolution.cpp @@ -438,9 +438,8 @@ PT_MINIT_REGISTRATION(pt_register_issetability_resolution) cls.method(sigs::isSet, [](INTERNAL_FUNCTION_PARAMETERS) { zval *typeCallback; zval *result = NULL; - ZEND_PARSE_PARAMETERS_START(1, 2) + ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_ZVAL(typeCallback) - Z_PARAM_OPTIONAL Z_PARAM_ZVAL(result) ZEND_PARSE_PARAMETERS_END(); if (UNEXPECTED(!zend_is_callable(typeCallback, 0, NULL))) { diff --git a/turbo-ext/src/LruCache.cpp b/turbo-ext/src/LruCache.cpp index fdb8834b3f9..87fa0569930 100644 --- a/turbo-ext/src/LruCache.cpp +++ b/turbo-ext/src/LruCache.cpp @@ -329,7 +329,7 @@ PT_MINIT_REGISTRATION(pt_register_lru_cache) cls.method(sigs::__construct, [](INTERNAL_FUNCTION_PARAMETERS) { zend_long maxCount = 0, maxWeight = 0, weightEvictionFloorCount = 0; - if (!zp::parse, zp::Opt, zp::Opt>(execute_data, maxCount, maxWeight, weightEvictionFloorCount)) RETURN_THROWS(); + if (!zp::parse(execute_data, maxCount, maxWeight, weightEvictionFloorCount)) RETURN_THROWS(); LruCache(Z_OBJ_P(ZEND_THIS)).construct(maxCount, maxWeight, weightEvictionFloorCount); }); diff --git a/turbo-ext/src/MethodCallReturnTypeHelper.cpp b/turbo-ext/src/MethodCallReturnTypeHelper.cpp index 1520bcda0fa..cec2b9f9283 100644 --- a/turbo-ext/src/MethodCallReturnTypeHelper.cpp +++ b/turbo-ext/src/MethodCallReturnTypeHelper.cpp @@ -286,7 +286,7 @@ PT_MINIT_REGISTRATION(pt_register_method_call_return_type_helper) zval *scope, *typeWithMethod, *methodCall; zend_string *methodName; zval *preResolvedAcceptor = NULL, *argsResult = NULL; - if (!zp::parse, zp::Opt>(execute_data, scope, typeWithMethod, methodName, methodCall, preResolvedAcceptor, argsResult)) RETURN_THROWS(); + if (!zp::parse(execute_data, scope, typeWithMethod, methodName, methodCall, preResolvedAcceptor, argsResult)) RETURN_THROWS(); PT_RETURN_VAL(MethodCallReturnTypeHelper(Z_OBJ_P(ZEND_THIS)).methodCallReturnType(scope, typeWithMethod, methodName, methodCall, preResolvedAcceptor, argsResult)); }); diff --git a/turbo-ext/src/MutatingScope.cpp b/turbo-ext/src/MutatingScope.cpp index 1138b46ed9a..e9dc453032e 100644 --- a/turbo-ext/src/MutatingScope.cpp +++ b/turbo-ext/src/MutatingScope.cpp @@ -12489,7 +12489,7 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) cls.method(sigs::getClosureScopeCacheKey, [](INTERNAL_FUNCTION_PARAMETERS) { zval *relevantRoots = NULL; - if (!zp::parse>(execute_data, relevantRoots)) RETURN_THROWS(); + if (!zp::parse(execute_data, relevantRoots)) RETURN_THROWS(); PT_RETURN_VAL(PT_THIS.getClosureScopeCacheKey(relevantRoots)); }); @@ -12973,9 +12973,8 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) bool isPlainWrite = true; zend_class_entry *exprCe = pt_class(PT_CLASS_EXPR); if (UNEXPECTED(exprCe == NULL)) RETURN_THROWS(); - ZEND_PARSE_PARAMETERS_START(1, 2) + ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_OBJECT_OF_CLASS(expr, exprCe) - Z_PARAM_OPTIONAL Z_PARAM_BOOL(isPlainWrite) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(PT_THIS.enterExpressionAssign(Z_OBJ_P(expr), isPlainWrite)); @@ -13132,9 +13131,8 @@ PT_MINIT_REGISTRATION(pt_register_mutating_scope) cls.method(sigs::generalizeWith, [](INTERNAL_FUNCTION_PARAMETERS) { zval *otherScope; HashTable *writableVariableNames = NULL; - ZEND_PARSE_PARAMETERS_START(1, 2) + ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_OBJECT_OF_CLASS(otherScope, pt_ce_mutating_scope) - Z_PARAM_OPTIONAL Z_PARAM_ARRAY_HT_OR_NULL(writableVariableNames) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(PT_THIS.generalizeWith(Z_OBJ_P(otherScope), writableVariableNames)); diff --git a/turbo-ext/src/PreparedAssignTarget.cpp b/turbo-ext/src/PreparedAssignTarget.cpp index da7bd36296a..e61aabd3775 100644 --- a/turbo-ext/src/PreparedAssignTarget.cpp +++ b/turbo-ext/src/PreparedAssignTarget.cpp @@ -21,9 +21,8 @@ namespace sigs = ptdecl::PreparedAssignTarget::sig; zend_class_entry *pt_ce_prepared_assign_target = nullptr; -/* the constructor's positional parameter count and the required ones */ +/* the constructor's positional parameter count, all of them required */ #define PT_PAT_ARG_COUNT 27 -#define PT_PAT_REQUIRED_ARG_COUNT 11 namespace phpstanturbo { @@ -158,7 +157,7 @@ PT_MINIT_REGISTRATION(pt_register_prepared_assign_target) zval *objects[PT_PAT_ARG_COUNT] = {}; zend_string *kindStr = NULL, *propertyNameStr = NULL; bool enterExpressionAssignBool, isAssignOpBool, hasYieldBool, isAlwaysTerminatingBool; - ZEND_PARSE_PARAMETERS_START(PT_PAT_REQUIRED_ARG_COUNT, PT_PAT_ARG_COUNT) + ZEND_PARSE_PARAMETERS_START(PT_PAT_ARG_COUNT, PT_PAT_ARG_COUNT) Z_PARAM_STR(kindStr) Z_PARAM_OBJECT(objects[1]) Z_PARAM_OBJECT(objects[2]) @@ -170,7 +169,6 @@ PT_MINIT_REGISTRATION(pt_register_prepared_assign_target) Z_PARAM_ARRAY(objects[8]) Z_PARAM_ARRAY(objects[9]) Z_PARAM_BOOL(isAlwaysTerminatingBool) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OR_NULL(objects[11]) Z_PARAM_OBJECT_OR_NULL(objects[12]) Z_PARAM_ARRAY_OR_NULL(objects[13]) diff --git a/turbo-ext/src/RicherScopeGetTypeHelper.cpp b/turbo-ext/src/RicherScopeGetTypeHelper.cpp index 32ba7a33c77..f053899e97b 100644 --- a/turbo-ext/src/RicherScopeGetTypeHelper.cpp +++ b/turbo-ext/src/RicherScopeGetTypeHelper.cpp @@ -351,10 +351,9 @@ namespace { rightType = NULL; zend_class_entry *typeCe = pt_class(PT_CLASS_TYPE); if (UNEXPECTED(typeCe == NULL)) return false; - ZEND_PARSE_PARAMETERS_START(2, 5) + ZEND_PARSE_PARAMETERS_START(5, 5) Z_PARAM_OBJECT_OF_CLASS(scope, pt_class(PT_CLASS_SCOPE)) Z_PARAM_OBJECT_OF_CLASS(expr, pt_class(exprClassIdx)) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OF_CLASS_OR_NULL(nodeScopeResolver, pt_ce_node_scope_resolver) Z_PARAM_OBJECT_OF_CLASS_OR_NULL(leftType, typeCe) Z_PARAM_OBJECT_OF_CLASS_OR_NULL(rightType, typeCe) diff --git a/turbo-ext/src/ScopeOps.cpp b/turbo-ext/src/ScopeOps.cpp index 42c3a956baf..0ee49e810ea 100644 --- a/turbo-ext/src/ScopeOps.cpp +++ b/turbo-ext/src/ScopeOps.cpp @@ -1883,7 +1883,7 @@ PT_MINIT_REGISTRATION(pt_register_scope_ops) cls.method(sigs::mergeVariableHolders, [](INTERNAL_FUNCTION_PARAMETERS) { HashTable *ours, *theirs; zval *differing_zv = NULL; - if (!zp::parse>(execute_data, ours, theirs, differing_zv)) RETURN_THROWS(); + if (!zp::parse(execute_data, ours, theirs, differing_zv)) RETURN_THROWS(); HashTable *differing = NULL; if (differing_zv != NULL && Z_ISREF_P(differing_zv)) { /* the twin declares `array &$differingKeys = []`; vivify like PHP @@ -1920,7 +1920,7 @@ PT_MINIT_REGISTRATION(pt_register_scope_ops) bool require_more_characters; bool keep_property_fetches = false; HashTable *expression_types, *native_expression_types, *conditional_expressions; - ZEND_PARSE_PARAMETERS_START(9, 10) + ZEND_PARSE_PARAMETERS_START(10, 10) Z_PARAM_OBJECT(scope) Z_PARAM_OBJECT(expr_printer) Z_PARAM_STR(invalidate_str) @@ -1930,7 +1930,6 @@ PT_MINIT_REGISTRATION(pt_register_scope_ops) Z_PARAM_ARRAY_HT(expression_types) Z_PARAM_ARRAY_HT(native_expression_types) Z_PARAM_ARRAY_HT(conditional_expressions) - Z_PARAM_OPTIONAL Z_PARAM_BOOL(keep_property_fetches) ZEND_PARSE_PARAMETERS_END(); pt_init_strs(); @@ -1944,14 +1943,13 @@ PT_MINIT_REGISTRATION(pt_register_scope_ops) zend_string *invalidate_str, *expr_string; bool require_more_characters = false; bool keep_property_fetches = false; - ZEND_PARSE_PARAMETERS_START(6, 9) + ZEND_PARSE_PARAMETERS_START(9, 9) Z_PARAM_OBJECT(scope) Z_PARAM_OBJECT(expr_printer) Z_PARAM_STR(invalidate_str) Z_PARAM_OBJECT(expr_to_invalidate) Z_PARAM_OBJECT(expr) Z_PARAM_STR(expr_string) - Z_PARAM_OPTIONAL Z_PARAM_BOOL(require_more_characters) Z_PARAM_OBJECT_OR_NULL(invalidating_class) Z_PARAM_BOOL(keep_property_fetches) diff --git a/turbo-ext/src/StatementsHandler.cpp b/turbo-ext/src/StatementsHandler.cpp index 656fbaefae6..6888308c3ce 100644 --- a/turbo-ext/src/StatementsHandler.cpp +++ b/turbo-ext/src/StatementsHandler.cpp @@ -647,8 +647,8 @@ class StatementsHandler } zv::Val publicResult = isrToPublic(statementResult.raw()); if (UNEXPECTED(publicResult.isUndef())) return zv::Val(); - zv::Args argv{endParent.raw(), publicResult.raw(), !returnTypeNode.isNull()}; - zv::Val endNode = pt_type_new(PT_CLASS_EXECUTION_END_NODE, 3, argv); + zv::Args argv{endParent.raw(), publicResult.raw(), !returnTypeNode.isNull(), zv::null}; + zv::Val endNode = pt_type_new(PT_CLASS_EXECUTION_END_NODE, 4, argv); if (UNEXPECTED(endNode.isUndef())) return zv::Val(); if (UNEXPECTED(!pt_node_scope_resolver_call_node_callback(nodeScopeResolver, nodeCallback, endNode.raw(), scope, storage))) return zv::Val(); } diff --git a/turbo-ext/src/TemplateArgumentFrame.cpp b/turbo-ext/src/TemplateArgumentFrame.cpp index 001fd35d37d..a83acf4bdf1 100644 --- a/turbo-ext/src/TemplateArgumentFrame.cpp +++ b/turbo-ext/src/TemplateArgumentFrame.cpp @@ -737,11 +737,10 @@ PT_MINIT_REGISTRATION(pt_register_template_argument_frame) cls.method(sigs::returnTypeOfCall, [](INTERNAL_FUNCTION_PARAMETERS) { zval *acceptor, *scope, *site; bool allowUnresolved = false, allowUnresolvedIsNull = true; - ZEND_PARSE_PARAMETERS_START(3, 4) + ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_OBJECT(acceptor) Z_PARAM_OBJECT(scope) Z_PARAM_OBJECT(site) - Z_PARAM_OPTIONAL Z_PARAM_BOOL_OR_NULL(allowUnresolved, allowUnresolvedIsNull) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(TemplateArgumentFrame::returnTypeOfCall(acceptor, scope, site, allowUnresolvedIsNull ? -1 : (allowUnresolved ? 1 : 0))); @@ -750,9 +749,8 @@ PT_MINIT_REGISTRATION(pt_register_template_argument_frame) cls.method(sigs::__construct, [](INTERNAL_FUNCTION_PARAMETERS) { zval *parent, *resolutions = NULL, *siteStatementIndexes = NULL, *closureSignatureBody = NULL, *closureSignatureStmts = NULL, *settledClosureSites = NULL, *byRefSites = NULL, *staticVariableTypes = NULL, *staticVariableConditionalExpressions = NULL; bool observingClosures = false; - ZEND_PARSE_PARAMETERS_START(1, 10) + ZEND_PARSE_PARAMETERS_START(10, 10) Z_PARAM_OBJECT_OR_NULL(parent) - Z_PARAM_OPTIONAL Z_PARAM_ARRAY_OR_NULL(resolutions) Z_PARAM_ARRAY(siteStatementIndexes) Z_PARAM_OBJECT_OR_NULL(closureSignatureBody) @@ -768,11 +766,10 @@ PT_MINIT_REGISTRATION(pt_register_template_argument_frame) cls.method(sigs::withObservedClosures, [](INTERNAL_FUNCTION_PARAMETERS) { zval *closureResolutions, *closureSiteStatementIndexes, *settledClosureSites, *byRefSites = NULL; - ZEND_PARSE_PARAMETERS_START(3, 4) + ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_ARRAY(closureResolutions) Z_PARAM_ARRAY(closureSiteStatementIndexes) Z_PARAM_ARRAY(settledClosureSites) - Z_PARAM_OPTIONAL Z_PARAM_ARRAY(byRefSites) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(TemplateArgumentFrame(Z_OBJ_P(ZEND_THIS)).withObservedClosures(closureResolutions, closureSiteStatementIndexes, settledClosureSites, byRefSites)); @@ -788,10 +785,9 @@ PT_MINIT_REGISTRATION(pt_register_template_argument_frame) cls.method(sigs::withStaticVariableTypes, [](INTERNAL_FUNCTION_PARAMETERS) { zval *staticVariableTypes, *statementIndexes, *conditionalExpressions = NULL; - ZEND_PARSE_PARAMETERS_START(2, 3) + ZEND_PARSE_PARAMETERS_START(3, 3) Z_PARAM_ARRAY(staticVariableTypes) Z_PARAM_ARRAY(statementIndexes) - Z_PARAM_OPTIONAL Z_PARAM_ARRAY(conditionalExpressions) ZEND_PARSE_PARAMETERS_END(); zval empty; diff --git a/turbo-ext/src/TemplateArgumentObserver.cpp b/turbo-ext/src/TemplateArgumentObserver.cpp index 265a244c6f9..d8ed9cd3fb4 100644 --- a/turbo-ext/src/TemplateArgumentObserver.cpp +++ b/turbo-ext/src/TemplateArgumentObserver.cpp @@ -1514,10 +1514,9 @@ PT_MINIT_REGISTRATION(pt_register_template_argument_observer) cls.method(sigs::collectArgument, [](INTERNAL_FUNCTION_PARAMETERS) { zval *parameterType, *argumentType; bool isPure = false; - ZEND_PARSE_PARAMETERS_START(2, 3) + ZEND_PARSE_PARAMETERS_START(3, 3) Z_PARAM_OBJECT_OF_CLASS(parameterType, pt_class(PT_CLASS_TYPE)) Z_PARAM_OBJECT_OF_CLASS(argumentType, pt_class(PT_CLASS_TYPE)) - Z_PARAM_OPTIONAL Z_PARAM_BOOL(isPure) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(TemplateArgumentObserver::collectArgument(parameterType, argumentType, isPure)); @@ -1525,11 +1524,10 @@ PT_MINIT_REGISTRATION(pt_register_template_argument_observer) cls.method(sigs::collectCall, [](INTERNAL_FUNCTION_PARAMETERS) { zval *site, *acceptor, *argumentTypes, *classTemplates = NULL; - ZEND_PARSE_PARAMETERS_START(3, 4) + ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_OBJECT_OF_CLASS(site, pt_class(PT_CLASS_EXPR)) Z_PARAM_OBJECT_OF_CLASS(acceptor, pt_class(PT_CLASS_PARAMETERS_ACCEPTOR)) Z_PARAM_ARRAY(argumentTypes) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OF_CLASS_OR_NULL(classTemplates, pt_ce_template_type_map) ZEND_PARSE_PARAMETERS_END(); zval null; diff --git a/turbo-ext/src/TemplateArgumentResolver.cpp b/turbo-ext/src/TemplateArgumentResolver.cpp index 2f35a62c449..63515c80b48 100644 --- a/turbo-ext/src/TemplateArgumentResolver.cpp +++ b/turbo-ext/src/TemplateArgumentResolver.cpp @@ -64,19 +64,14 @@ zend_string *pt_tar_unconstraining_send = nullptr; return !result.isUndef(); } -/* TemplateArgumentStats::increment('sitesCreated' / 'closureSitesCreated'); +/* TemplateArgumentStats::increment('sitesCreated' / 'closureSitesCreated', 1); * false = pending exception */ [[nodiscard]] bool statsIncrementSitesCreated(bool closureSite) { - zval counter; if (closureSite) { - ZVAL_STRINGL(&counter, "closureSitesCreated", sizeof("closureSitesCreated") - 1); - } else { - ZVAL_STRINGL(&counter, "sitesCreated", sizeof("sitesCreated") - 1); + return statsIncrement(PT_LC("closureSitesCreated"), 1); } - zv::Val result = pt_call_static_cached(pt_tar_stats_increment_site, PT_CLASS_TEMPLATE_ARGUMENT_STATS, PT_LC("increment"), 1, &counter); - zval_ptr_dtor(&counter); - return !result.isUndef(); + return statsIncrement(PT_LC("sitesCreated"), 1); } /* $marker->getSite() / ->getInitialType(): the slots of the native class, @@ -642,11 +637,10 @@ PT_MINIT_REGISTRATION(pt_register_template_argument_resolver) cls.method(sigs::resolve, [](INTERNAL_FUNCTION_PARAMETERS) { zval *constraints, *parent, *statementStartTokenPositions, *closureSignatureBody = NULL, *closureSignatureStmts = NULL; - ZEND_PARSE_PARAMETERS_START(3, 5) + ZEND_PARSE_PARAMETERS_START(5, 5) Z_PARAM_OBJECT_OF_CLASS(constraints, pt_ce_template_argument_constraints) Z_PARAM_OBJECT_OF_CLASS_OR_NULL(parent, pt_ce_template_argument_frame) Z_PARAM_ARRAY(statementStartTokenPositions) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OR_NULL(closureSignatureBody) Z_PARAM_ARRAY(closureSignatureStmts) ZEND_PARSE_PARAMETERS_END(); diff --git a/turbo-ext/src/VarAnnotationProcessor.cpp b/turbo-ext/src/VarAnnotationProcessor.cpp index 6ff7594b11c..780416370c2 100644 --- a/turbo-ext/src/VarAnnotationProcessor.cpp +++ b/turbo-ext/src/VarAnnotationProcessor.cpp @@ -315,11 +315,10 @@ PT_MINIT_REGISTRATION(pt_register_var_annotation_processor) cls.method(sigs::processVarAnnotation, [](INTERNAL_FUNCTION_PARAMETERS) { zval *scope, *node, *changed = NULL; HashTable *variableNames; - ZEND_PARSE_PARAMETERS_START(3, 4) + ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_OBJECT(scope) Z_PARAM_ARRAY_HT(variableNames) Z_PARAM_OBJECT(node) - Z_PARAM_OPTIONAL Z_PARAM_ZVAL(changed) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(VarAnnotationProcessor(Z_OBJ_P(ZEND_THIS)).processVarAnnotation(scope, variableNames, node, changed != NULL && Z_ISREF_P(changed) ? changed : NULL, NULL)); diff --git a/turbo-ext/src/VariableAccessFlow.cpp b/turbo-ext/src/VariableAccessFlow.cpp index 2c013d9f6aa..96b78cdd102 100644 --- a/turbo-ext/src/VariableAccessFlow.cpp +++ b/turbo-ext/src/VariableAccessFlow.cpp @@ -108,10 +108,9 @@ PT_MINIT_REGISTRATION(pt_register_variable_access_flow) zend_long targetId = 0; bool targetIdIsNull = true; bool container = false; - ZEND_PARSE_PARAMETERS_START(2, 7) + ZEND_PARSE_PARAMETERS_START(7, 7) Z_PARAM_STR(kind) Z_PARAM_STR(name) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OR_NULL(write) Z_PARAM_OBJECT_OR_NULL(type) Z_PARAM_LONG_OR_NULL(targetId, targetIdIsNull) diff --git a/turbo-ext/src/VariableControlFlow.cpp b/turbo-ext/src/VariableControlFlow.cpp index dad4b665b1b..a0ab2ec4d42 100644 --- a/turbo-ext/src/VariableControlFlow.cpp +++ b/turbo-ext/src/VariableControlFlow.cpp @@ -149,9 +149,8 @@ PT_MINIT_REGISTRATION(pt_register_variable_control_flow) cls.method(sigs::__construct, [](INTERNAL_FUNCTION_PARAMETERS) { zend_string *kind; pt_variable_control_flow_args a; - ZEND_PARSE_PARAMETERS_START(1, 15) + ZEND_PARSE_PARAMETERS_START(15, 15) Z_PARAM_STR(kind) - Z_PARAM_OPTIONAL Z_PARAM_ARRAY(a.children) Z_PARAM_STR_OR_NULL(a.name) Z_PARAM_OBJECT_OR_NULL(a.type) diff --git a/turbo-ext/src/VariableFlow.cpp b/turbo-ext/src/VariableFlow.cpp index 30ed11f930f..b38460a8919 100644 --- a/turbo-ext/src/VariableFlow.cpp +++ b/turbo-ext/src/VariableFlow.cpp @@ -602,9 +602,8 @@ PT_MINIT_REGISTRATION(pt_register_variable_flow) zend_long targetId = 0; bool targetIdIsNull = true; bool container = false; - ZEND_PARSE_PARAMETERS_START(1, 4) + ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_STR(name) - Z_PARAM_OPTIONAL Z_PARAM_LONG_OR_NULL(targetId, targetIdIsNull) Z_PARAM_BOOL(container) Z_PARAM_ZVAL(offset) @@ -630,7 +629,7 @@ PT_MINIT_REGISTRATION(pt_register_variable_flow) cls.method(sigs::write, [](INTERNAL_FUNCTION_PARAMETERS) { zval *write, *redundantType = NULL; - if (!zp::parse>(execute_data, write, redundantType)) RETURN_THROWS(); + if (!zp::parse(execute_data, write, redundantType)) RETURN_THROWS(); PT_VF_RETURN(VariableFlow::write(write, redundantType)); }); @@ -677,21 +676,21 @@ PT_MINIT_REGISTRATION(pt_register_variable_flow) cls.method(sigs::exit, [](INTERNAL_FUNCTION_PARAMETERS) { zend_string *kind, *name = NULL; zend_long level = 1; - if (!zp::parse, zp::Opt>(execute_data, kind, level, name)) RETURN_THROWS(); + if (!zp::parse(execute_data, kind, level, name)) RETURN_THROWS(); PT_VF_RETURN(VariableFlow::exit_(kind, level, name)); }); cls.method(sigs::throwing, [](INTERNAL_FUNCTION_PARAMETERS) { zval *type; bool canContinue, canContainAnyThrowable = false; - if (!zp::parse>(execute_data, type, canContinue, canContainAnyThrowable)) RETURN_THROWS(); + if (!zp::parse(execute_data, type, canContinue, canContainAnyThrowable)) RETURN_THROWS(); PT_VF_RETURN(VariableFlow::throwing(type, canContinue, canContainAnyThrowable)); }); cls.method(sigs::loop, [](INTERNAL_FUNCTION_PARAMETERS) { zval *condition, *body, *update; bool atLeastOnce, canExit, canRepeat = true; - if (!zp::parse>(execute_data, condition, body, update, atLeastOnce, canExit, canRepeat)) RETURN_THROWS(); + if (!zp::parse(execute_data, condition, body, update, atLeastOnce, canExit, canRepeat)) RETURN_THROWS(); PT_VF_RETURN(VariableFlow::loop(condition, body, update, atLeastOnce, canExit, canRepeat)); }); diff --git a/turbo-ext/src/VariableFlowBuilder.cpp b/turbo-ext/src/VariableFlowBuilder.cpp index cbee929e037..a6b640be9a8 100644 --- a/turbo-ext/src/VariableFlowBuilder.cpp +++ b/turbo-ext/src/VariableFlowBuilder.cpp @@ -666,11 +666,10 @@ PT_MINIT_REGISTRATION(pt_register_variable_flow_builder) bool read; zend_long targetId = 0; bool targetIdIsNull = true; - ZEND_PARSE_PARAMETERS_START(3, 4) + ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_OBJECT(target) Z_PARAM_OBJECT(storage) Z_PARAM_BOOL(read) - Z_PARAM_OPTIONAL Z_PARAM_LONG_OR_NULL(targetId, targetIdIsNull) ZEND_PARSE_PARAMETERS_END(); zval targetIdValue; @@ -687,7 +686,7 @@ PT_MINIT_REGISTRATION(pt_register_variable_flow_builder) cls.method(sigs::targetWrite, [](INTERNAL_FUNCTION_PARAMETERS) { zval *target, *scope, *storage, *redundant = NULL; zend_long kind; - if (!zp::parse>(execute_data, target, kind, scope, storage, redundant)) RETURN_THROWS(); + if (!zp::parse(execute_data, target, kind, scope, storage, redundant)) RETURN_THROWS(); PT_VFB_RETURN(VariableFlowBuilder::targetWrite(target, kind, scope, storage, redundant)); }); diff --git a/turbo-ext/src/VariableHandler.cpp b/turbo-ext/src/VariableHandler.cpp index 6f8445bb058..52f2c52b027 100644 --- a/turbo-ext/src/VariableHandler.cpp +++ b/turbo-ext/src/VariableHandler.cpp @@ -565,13 +565,12 @@ PT_MINIT_REGISTRATION(pt_register_variable_handler) cls.method(sigs::composeResult, [](INTERNAL_FUNCTION_PARAMETERS) { zval *nodeScopeResolver, *expr, *nameResult, *storage, *beforeScope, *context = NULL; - ZEND_PARSE_PARAMETERS_START(5, 6) + ZEND_PARSE_PARAMETERS_START(6, 6) Z_PARAM_OBJECT(nodeScopeResolver) Z_PARAM_OBJECT(expr) Z_PARAM_OBJECT_OR_NULL(nameResult) Z_PARAM_OBJECT(storage) Z_PARAM_OBJECT(beforeScope) - Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OR_NULL(context) ZEND_PARSE_PARAMETERS_END(); PT_RETURN_VAL(VariableHandler(Z_OBJ_P(ZEND_THIS)).composeResult(nodeScopeResolver, expr, nameResult, storage, beforeScope, context)); diff --git a/turbo-ext/src/VariableLivenessResolver.cpp b/turbo-ext/src/VariableLivenessResolver.cpp index 87a648f9a8b..ba4bfdcf588 100644 --- a/turbo-ext/src/VariableLivenessResolver.cpp +++ b/turbo-ext/src/VariableLivenessResolver.cpp @@ -570,11 +570,11 @@ class VariableLivenessResolver return name.isString() ? name.asString() : NULL; } - /* $imports[] = VariableFlow::write(new VariableWrite($name, $var, spl_object_id($var), $kind)) */ + /* $imports[] = VariableFlow::write(new VariableWrite($name, $var, spl_object_id($var), $kind, false, null, null, true)) */ bool import(zv::Arr &imports, zend_string *name, zval *var, zend_long kind) { - zv::Args argv{name, var, zend_long((zend_long) Z_OBJ_HANDLE_P(var)), zend_long(kind)}; - zv::Val write = pt_type_new(PT_CLASS_VARIABLE_WRITE, 4, argv); + zv::Args argv{name, var, zend_long((zend_long) Z_OBJ_HANDLE_P(var)), zend_long(kind), false, zv::null, zv::null, true}; + zv::Val write = pt_type_new(PT_CLASS_VARIABLE_WRITE, 8, argv); if (UNEXPECTED(write.isUndef())) return false; zv::Val flow = pt_variable_flow_write(write.raw(), NULL); if (UNEXPECTED(flow.isUndef())) return false; diff --git a/turbo-ext/src/VolatileExpressionHelper.cpp b/turbo-ext/src/VolatileExpressionHelper.cpp index ebeb2809b1d..a3fe6457e9e 100644 --- a/turbo-ext/src/VolatileExpressionHelper.cpp +++ b/turbo-ext/src/VolatileExpressionHelper.cpp @@ -29,7 +29,7 @@ const pt_superglobal_name pt_veh_volatile_function_names[] = { { PT_LC("openssl_error_string") }, }; -/* the twin's private EXISTENCE_CHECK_FUNCTION_NAMES */ +/* the twin's EXISTENCE_CHECK_FUNCTION_NAMES */ const pt_superglobal_name pt_veh_existence_check_function_names[] = { { PT_LC("class_exists") }, { PT_LC("interface_exists") }, @@ -184,7 +184,7 @@ class VolatileExpressionHelper /* * Mirrors invalidateNegativeExistenceChecks(). $functionNames NULL stands - * for the twin's EXISTENCE_CHECK_FUNCTION_NAMES default, $declaredSymbolName + * for EXISTENCE_CHECK_FUNCTION_NAMES, $declaredSymbolName * NULL for null; UNDEF = pending exception. */ static zv::Val invalidateNegativeExistenceChecks(zval *scope, zval *expressionTypes, zval *nativeExpressionTypes, HashTable *functionNames, zend_string *declaredSymbolName) @@ -348,7 +348,7 @@ PT_MINIT_REGISTRATION(pt_register_volatile_expression_helper) ptdecl::VolatileExpressionHelper::declareClass(cls); ptdecl::VolatileExpressionHelper::declareProperties(cls); cls.privateClassConstantValue("VOLATILE_FUNCTION_NAMES", pt_veh_volatile_function_names_constant); - cls.privateClassConstantValue("EXISTENCE_CHECK_FUNCTION_NAMES", pt_veh_existence_check_function_names_constant); + cls.classConstantValue("EXISTENCE_CHECK_FUNCTION_NAMES", pt_veh_existence_check_function_names_constant); cls.method(sigs::invalidateVolatileFunctionCalls, [](INTERNAL_FUNCTION_PARAMETERS) { zval *expressionTypes, *nativeExpressionTypes; @@ -374,7 +374,7 @@ PT_MINIT_REGISTRATION(pt_register_volatile_expression_helper) zval *scope, *expressionTypes, *nativeExpressionTypes; HashTable *functionNames = NULL; zend_string *declaredSymbolName = NULL; - if (!zp::parse, zp::Opt>(execute_data, scope, expressionTypes, nativeExpressionTypes, functionNames, declaredSymbolName)) RETURN_THROWS(); + if (!zp::parse(execute_data, scope, expressionTypes, nativeExpressionTypes, functionNames, declaredSymbolName)) RETURN_THROWS(); expressionTypes = pt_veh_array_ref(expressionTypes, 2); if (UNEXPECTED(expressionTypes == NULL)) RETURN_THROWS(); nativeExpressionTypes = pt_veh_array_ref(nativeExpressionTypes, 3); diff --git a/turbo-ext/src/generated/ArgsResult.h b/turbo-ext/src/generated/ArgsResult.h index 8a032e9722e..00e38a5e85b 100644 --- a/turbo-ext/src/generated/ArgsResult.h +++ b/turbo-ext/src/generated/ArgsResult.h @@ -39,67 +39,66 @@ inline constexpr char strings[] = "PHPStan\\Reflection\\ParametersAcceptor\0" /* 78 */ "argResults\0" /* 116 */ "byRefArguments\0" /* 127 */ - "[]\0" /* 142 */ - "__construct\0" /* 145 */ - "argValue\0" /* 157 */ - "PhpParser\\Node\\Expr\0" /* 166 */ - "\0" /* 186 */ - "findArgResult\0" /* 187 */ - "getArgResults\0" /* 201 */ - "requireArgResult\0" /* 215 */ - "arg\0" /* 232 */ - "isPassedByReference\0" /* 236 */ - "PHPStan\\Analyser\\MutatingScope\0" /* 256 */ - "getScope\0" /* 287 */ - "PHPStan\\Dependency\\Dependencies\0" /* 296 */ - "getDependencies\0" /* 328 */ - "hasYield\0" /* 344 */ - "isAlwaysTerminating\0" /* 353 */ - "getThrowPoints\0" /* 373 */ - "getImpurePoints\0" /* 388 */ - "PHPStan\\Analyser\\ArgsResult\0" /* 404 */ - "withResolvedParametersAcceptor\0" /* 432 */ - "getResolvedParametersAcceptor"; /* 463 */ + "__construct\0" /* 142 */ + "argValue\0" /* 154 */ + "PhpParser\\Node\\Expr\0" /* 163 */ + "\0" /* 183 */ + "findArgResult\0" /* 184 */ + "getArgResults\0" /* 198 */ + "requireArgResult\0" /* 212 */ + "arg\0" /* 229 */ + "isPassedByReference\0" /* 233 */ + "PHPStan\\Analyser\\MutatingScope\0" /* 253 */ + "getScope\0" /* 284 */ + "PHPStan\\Dependency\\Dependencies\0" /* 293 */ + "getDependencies\0" /* 325 */ + "hasYield\0" /* 341 */ + "isAlwaysTerminating\0" /* 350 */ + "getThrowPoints\0" /* 370 */ + "getImpurePoints\0" /* 385 */ + "PHPStan\\Analyser\\ArgsResult\0" /* 401 */ + "withResolvedParametersAcceptor\0" /* 429 */ + "getResolvedParametersAcceptor"; /* 460 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 17), /* __construct $expressionResult */ reg::packed(51, MAY_BE_NULL, 78), /* __construct $resolvedParametersAcceptor */ reg::packed(116, MAY_BE_ARRAY), /* __construct $argResults */ - reg::packed(127, MAY_BE_ARRAY, reg::NoString, false, false, 142), /* __construct $byRefArguments */ - reg::packed(157, 0, 166), /* findArgResult $argValue */ - reg::packed(186, MAY_BE_NULL, 17), /* findArgResult return */ - reg::packed(186, MAY_BE_ARRAY), /* getArgResults return */ - reg::packed(157, 0, 166), /* requireArgResult $argValue */ - reg::packed(186, 0, 17), /* requireArgResult return */ - reg::packed(232, 0, 166), /* isPassedByReference $arg */ - reg::packed(186, MAY_BE_BOOL), /* isPassedByReference return */ - reg::packed(186, 0, 256), /* getScope return */ - reg::packed(186, MAY_BE_NULL, 296), /* getDependencies return */ - reg::packed(186, MAY_BE_BOOL), /* hasYield return */ - reg::packed(186, MAY_BE_BOOL), /* isAlwaysTerminating return */ - reg::packed(186, MAY_BE_ARRAY), /* getThrowPoints return */ - reg::packed(186, MAY_BE_ARRAY), /* getImpurePoints return */ + reg::packed(127, MAY_BE_ARRAY), /* __construct $byRefArguments */ + reg::packed(154, 0, 163), /* findArgResult $argValue */ + reg::packed(183, MAY_BE_NULL, 17), /* findArgResult return */ + reg::packed(183, MAY_BE_ARRAY), /* getArgResults return */ + reg::packed(154, 0, 163), /* requireArgResult $argValue */ + reg::packed(183, 0, 17), /* requireArgResult return */ + reg::packed(229, 0, 163), /* isPassedByReference $arg */ + reg::packed(183, MAY_BE_BOOL), /* isPassedByReference return */ + reg::packed(183, 0, 253), /* getScope return */ + reg::packed(183, MAY_BE_NULL, 293), /* getDependencies return */ + reg::packed(183, MAY_BE_BOOL), /* hasYield return */ + reg::packed(183, MAY_BE_BOOL), /* isAlwaysTerminating return */ + reg::packed(183, MAY_BE_ARRAY), /* getThrowPoints return */ + reg::packed(183, MAY_BE_ARRAY), /* getImpurePoints return */ reg::packed(51, MAY_BE_NULL, 78), /* withResolvedParametersAcceptor $resolvedParametersAcceptor */ - reg::packed(186, 0, 404), /* withResolvedParametersAcceptor return */ - reg::packed(186, MAY_BE_NULL, 78), /* getResolvedParametersAcceptor return */ + reg::packed(183, 0, 401), /* withResolvedParametersAcceptor return */ + reg::packed(183, MAY_BE_NULL, 78), /* getResolvedParametersAcceptor 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 = { { 145 /* __construct */, 3, 0, 4, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig findArgResult = { { 187 /* findArgResult */, 1, 4, 1, 5, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getArgResults = { { 201 /* getArgResults */, 0, 6, 0, 6, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig requireArgResult = { { 215 /* requireArgResult */, 1, 7, 1, 8, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isPassedByReference = { { 236 /* isPassedByReference */, 1, 9, 1, 10, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getScope = { { 287 /* getScope */, 0, 11, 0, 11, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getDependencies = { { 328 /* getDependencies */, 0, 12, 0, 12, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasYield = { { 344 /* hasYield */, 0, 13, 0, 13, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isAlwaysTerminating = { { 353 /* isAlwaysTerminating */, 0, 14, 0, 14, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getThrowPoints = { { 373 /* getThrowPoints */, 0, 15, 0, 15, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getImpurePoints = { { 388 /* getImpurePoints */, 0, 16, 0, 16, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withResolvedParametersAcceptor = { { 432 /* withResolvedParametersAcceptor */, 1, 17, 1, 18, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getResolvedParametersAcceptor = { { 463 /* getResolvedParametersAcceptor */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 142 /* __construct */, 4, 0, 4, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig findArgResult = { { 184 /* findArgResult */, 1, 4, 1, 5, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getArgResults = { { 198 /* getArgResults */, 0, 6, 0, 6, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig requireArgResult = { { 212 /* requireArgResult */, 1, 7, 1, 8, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isPassedByReference = { { 233 /* isPassedByReference */, 1, 9, 1, 10, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getScope = { { 284 /* getScope */, 0, 11, 0, 11, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getDependencies = { { 325 /* getDependencies */, 0, 12, 0, 12, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasYield = { { 341 /* hasYield */, 0, 13, 0, 13, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isAlwaysTerminating = { { 350 /* isAlwaysTerminating */, 0, 14, 0, 14, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getThrowPoints = { { 370 /* getThrowPoints */, 0, 15, 0, 15, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getImpurePoints = { { 385 /* getImpurePoints */, 0, 16, 0, 16, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withResolvedParametersAcceptor = { { 429 /* withResolvedParametersAcceptor */, 1, 17, 1, 18, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getResolvedParametersAcceptor = { { 460 /* getResolvedParametersAcceptor */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ArgsResult diff --git a/turbo-ext/src/generated/ArgumentsHandler.h b/turbo-ext/src/generated/ArgumentsHandler.h index d8e3af1f82b..a7c2e21ce75 100644 --- a/turbo-ext/src/generated/ArgumentsHandler.h +++ b/turbo-ext/src/generated/ArgumentsHandler.h @@ -100,57 +100,56 @@ inline constexpr char strings[] = "context\0" /* 1173 */ "PHPStan\\Analyser\\ExpressionContext\0" /* 1181 */ "closureBindScopeFactory\0" /* 1216 */ - "null\0" /* 1240 */ - "\0" /* 1245 */ - "PHPStan\\Analyser\\ArgsResult\0" /* 1246 */ - "processArgs\0" /* 1274 */ - "types\0" /* 1286 */ - "unpack\0" /* 1292 */ - "hasName\0" /* 1299 */ - "originalArg\0" /* 1307 */ - "PhpParser\\Node\\Arg\0" /* 1319 */ - "i\0" /* 1338 */ - "type\0" /* 1340 */ - "PHPStan\\Type\\Type\0" /* 1345 */ - "addGatheredArgType\0" /* 1363 */ - "value\0" /* 1382 */ - "PhpParser\\Node\\Expr\0" /* 1388 */ - "argConsumesResolvedParameterType\0" /* 1408 */ - "closureExpr\0" /* 1441 */ - "gatherClosureArgType\0" /* 1453 */ - "args\0" /* 1474 */ - "PHPStan\\Reflection\\ParametersAcceptor\0" /* 1479 */ - "selectCountStableMetadataAcceptor\0" /* 1517 */ - "acceptor\0" /* 1551 */ - "arg\0" /* 1560 */ - "PHPStan\\Reflection\\ParameterReflection\0" /* 1564 */ - "matchArgParameter\0" /* 1603 */ - "selectArgsAcceptor\0" /* 1621 */ - "gatheredTypes\0" /* 1640 */ - "selectArgsMetadataAcceptor\0" /* 1654 */ - "originalCall\0" /* 1681 */ - "normalizedCall\0" /* 1694 */ - "processDroppedArgs\0" /* 1709 */ - "parameter\0" /* 1728 */ - "parameterType\0" /* 1738 */ - "callCallbackImmediately\0" /* 1752 */ - "shouldInvalidateCallbackExpressions\0" /* 1776 */ - "getParameterTypeFromParameterClosureTypeExtension\0" /* 1812 */ - "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 */ + "\0" /* 1240 */ + "PHPStan\\Analyser\\ArgsResult\0" /* 1241 */ + "processArgs\0" /* 1269 */ + "types\0" /* 1281 */ + "unpack\0" /* 1287 */ + "hasName\0" /* 1294 */ + "originalArg\0" /* 1302 */ + "PhpParser\\Node\\Arg\0" /* 1314 */ + "i\0" /* 1333 */ + "type\0" /* 1335 */ + "PHPStan\\Type\\Type\0" /* 1340 */ + "addGatheredArgType\0" /* 1358 */ + "value\0" /* 1377 */ + "PhpParser\\Node\\Expr\0" /* 1383 */ + "argConsumesResolvedParameterType\0" /* 1403 */ + "closureExpr\0" /* 1436 */ + "gatherClosureArgType\0" /* 1448 */ + "args\0" /* 1469 */ + "PHPStan\\Reflection\\ParametersAcceptor\0" /* 1474 */ + "selectCountStableMetadataAcceptor\0" /* 1512 */ + "acceptor\0" /* 1546 */ + "arg\0" /* 1555 */ + "PHPStan\\Reflection\\ParameterReflection\0" /* 1559 */ + "matchArgParameter\0" /* 1598 */ + "selectArgsAcceptor\0" /* 1616 */ + "gatheredTypes\0" /* 1635 */ + "selectArgsMetadataAcceptor\0" /* 1649 */ + "originalCall\0" /* 1676 */ + "normalizedCall\0" /* 1689 */ + "processDroppedArgs\0" /* 1704 */ + "parameter\0" /* 1723 */ + "parameterType\0" /* 1733 */ + "callCallbackImmediately\0" /* 1747 */ + "shouldInvalidateCallbackExpressions\0" /* 1771 */ + "getParameterTypeFromParameterClosureTypeExtension\0" /* 1807 */ + "currentParameter\0" /* 1857 */ + "getParameterOutExtensionsType\0" /* 1874 */ + "call\0" /* 1904 */ + "resolveClosureThisType\0" /* 1909 */ + "position\0" /* 1932 */ + "unpackedType\0" /* 1941 */ + "isPure\0" /* 1954 */ + "observeUnpackedArgument\0" /* 1961 */ + "valueType\0" /* 1985 */ + "observeArgumentValue\0" /* 1995 */ + "findOriginalParameterType\0" /* 2016 */ + "argResults\0" /* 2042 */ + "argValue\0" /* 2053 */ + "PHPStan\\Analyser\\ExpressionResult\0" /* 2062 */ + "readArgResult"; /* 2096 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 25), /* __construct $templateArgumentObserver */ reg::packed(76, 0, 100), /* __construct $expressionResultFactory */ @@ -179,94 +178,94 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1111, 0, 1119), /* processArgs $storage */ reg::packed(1160, MAY_BE_CALLABLE), /* processArgs $nodeCallback */ reg::packed(1173, 0, 1181), /* processArgs $context */ - reg::packed(1216, MAY_BE_NULL | MAY_BE_CALLABLE, reg::NoString, false, false, 1240), /* processArgs $closureBindScopeFactory */ - reg::packed(1245, 0, 1246), /* processArgs return */ - reg::packed(1286, MAY_BE_ARRAY, reg::NoString, true, false), /* addGatheredArgType $types */ - reg::packed(1292, MAY_BE_BOOL, reg::NoString, true, false), /* addGatheredArgType $unpack */ - reg::packed(1299, MAY_BE_BOOL, reg::NoString, true, false), /* addGatheredArgType $hasName */ - reg::packed(1307, 0, 1319), /* addGatheredArgType $originalArg */ - reg::packed(1338, MAY_BE_LONG), /* addGatheredArgType $i */ - reg::packed(1340, 0, 1345), /* addGatheredArgType $type */ - reg::packed(1245, MAY_BE_VOID), /* addGatheredArgType return */ - reg::packed(1382, 0, 1388), /* argConsumesResolvedParameterType $value */ - reg::packed(1245, MAY_BE_BOOL), /* argConsumesResolvedParameterType return */ + reg::packed(1216, MAY_BE_NULL | MAY_BE_CALLABLE), /* processArgs $closureBindScopeFactory */ + reg::packed(1240, 0, 1241), /* processArgs return */ + reg::packed(1281, MAY_BE_ARRAY, reg::NoString, true, false), /* addGatheredArgType $types */ + reg::packed(1287, MAY_BE_BOOL, reg::NoString, true, false), /* addGatheredArgType $unpack */ + reg::packed(1294, MAY_BE_BOOL, reg::NoString, true, false), /* addGatheredArgType $hasName */ + reg::packed(1302, 0, 1314), /* addGatheredArgType $originalArg */ + reg::packed(1333, MAY_BE_LONG), /* addGatheredArgType $i */ + reg::packed(1335, 0, 1340), /* addGatheredArgType $type */ + reg::packed(1240, MAY_BE_VOID), /* addGatheredArgType return */ + reg::packed(1377, 0, 1383), /* argConsumesResolvedParameterType $value */ + reg::packed(1240, MAY_BE_BOOL), /* argConsumesResolvedParameterType return */ reg::packed(993, MAY_BE_ARRAY), /* gatherClosureArgType $parametersAcceptors */ - reg::packed(1338, MAY_BE_LONG), /* gatherClosureArgType $i */ - reg::packed(1441, 0, 1388), /* gatherClosureArgType $closureExpr */ + reg::packed(1333, MAY_BE_LONG), /* gatherClosureArgType $i */ + reg::packed(1436, 0, 1383), /* gatherClosureArgType $closureExpr */ reg::packed(1074, 0, 1080), /* gatherClosureArgType $scope */ - reg::packed(1245, 0, 1345), /* gatherClosureArgType return */ + reg::packed(1240, 0, 1340), /* gatherClosureArgType return */ reg::packed(832, 0, 850), /* selectCountStableMetadataAcceptor $nodeScopeResolver */ - reg::packed(1474, MAY_BE_ARRAY), /* selectCountStableMetadataAcceptor $args */ + reg::packed(1469, MAY_BE_ARRAY), /* selectCountStableMetadataAcceptor $args */ reg::packed(993, MAY_BE_ARRAY), /* selectCountStableMetadataAcceptor $parametersAcceptors */ reg::packed(1013, MAY_BE_NULL | MAY_BE_ARRAY), /* selectCountStableMetadataAcceptor $namedArgumentsVariants */ reg::packed(1074, 0, 1080), /* selectCountStableMetadataAcceptor $scope */ - reg::packed(1245, 0, 1479), /* selectCountStableMetadataAcceptor return */ - reg::packed(1551, 0, 1479), /* matchArgParameter $acceptor */ - reg::packed(1560, 0, 1319), /* matchArgParameter $arg */ - reg::packed(1338, MAY_BE_LONG), /* matchArgParameter $i */ - reg::packed(1245, MAY_BE_NULL, 1564), /* matchArgParameter return */ - reg::packed(1286, MAY_BE_ARRAY), /* selectArgsAcceptor $types */ + reg::packed(1240, 0, 1474), /* selectCountStableMetadataAcceptor return */ + reg::packed(1546, 0, 1474), /* matchArgParameter $acceptor */ + reg::packed(1555, 0, 1314), /* matchArgParameter $arg */ + reg::packed(1333, MAY_BE_LONG), /* matchArgParameter $i */ + reg::packed(1240, MAY_BE_NULL, 1559), /* matchArgParameter return */ + reg::packed(1281, MAY_BE_ARRAY), /* selectArgsAcceptor $types */ reg::packed(993, MAY_BE_ARRAY), /* selectArgsAcceptor $parametersAcceptors */ reg::packed(1013, MAY_BE_NULL | MAY_BE_ARRAY), /* selectArgsAcceptor $namedArgumentsVariants */ - reg::packed(1299, MAY_BE_BOOL), /* selectArgsAcceptor $hasName */ - reg::packed(1292, MAY_BE_BOOL), /* selectArgsAcceptor $unpack */ - reg::packed(1245, 0, 1479), /* selectArgsAcceptor return */ + reg::packed(1294, MAY_BE_BOOL), /* selectArgsAcceptor $hasName */ + reg::packed(1287, MAY_BE_BOOL), /* selectArgsAcceptor $unpack */ + reg::packed(1240, 0, 1474), /* selectArgsAcceptor return */ reg::packed(832, 0, 850), /* selectArgsMetadataAcceptor $nodeScopeResolver */ - reg::packed(1474, MAY_BE_ARRAY), /* selectArgsMetadataAcceptor $args */ - reg::packed(1640, MAY_BE_ARRAY), /* selectArgsMetadataAcceptor $gatheredTypes */ + reg::packed(1469, MAY_BE_ARRAY), /* selectArgsMetadataAcceptor $args */ + reg::packed(1635, MAY_BE_ARRAY), /* selectArgsMetadataAcceptor $gatheredTypes */ reg::packed(993, MAY_BE_ARRAY), /* selectArgsMetadataAcceptor $parametersAcceptors */ reg::packed(1013, MAY_BE_NULL | MAY_BE_ARRAY), /* selectArgsMetadataAcceptor $namedArgumentsVariants */ - reg::packed(1299, MAY_BE_BOOL), /* selectArgsMetadataAcceptor $hasName */ - reg::packed(1292, MAY_BE_BOOL), /* selectArgsMetadataAcceptor $unpack */ + reg::packed(1294, MAY_BE_BOOL), /* selectArgsMetadataAcceptor $hasName */ + reg::packed(1287, MAY_BE_BOOL), /* selectArgsMetadataAcceptor $unpack */ reg::packed(1074, 0, 1080), /* selectArgsMetadataAcceptor $scope */ - reg::packed(1245, 0, 1479), /* selectArgsMetadataAcceptor return */ + reg::packed(1240, 0, 1474), /* selectArgsMetadataAcceptor return */ reg::packed(832, 0, 850), /* processDroppedArgs $nodeScopeResolver */ reg::packed(885, 0, 890), /* processDroppedArgs $stmt */ - reg::packed(1681, 0, 1045), /* processDroppedArgs $originalCall */ - reg::packed(1694, 0, 1045), /* processDroppedArgs $normalizedCall */ + reg::packed(1676, 0, 1045), /* processDroppedArgs $originalCall */ + reg::packed(1689, 0, 1045), /* processDroppedArgs $normalizedCall */ reg::packed(1074, 0, 1080), /* processDroppedArgs $scope */ reg::packed(1111, 0, 1119), /* processDroppedArgs $storage */ reg::packed(1173, 0, 1181), /* processDroppedArgs $context */ - reg::packed(1245, MAY_BE_VOID), /* processDroppedArgs return */ - reg::packed(1728, MAY_BE_NULL, 1564), /* callCallbackImmediately $parameter */ - reg::packed(1738, MAY_BE_NULL, 1345), /* callCallbackImmediately $parameterType */ + reg::packed(1240, MAY_BE_VOID), /* processDroppedArgs return */ + reg::packed(1723, MAY_BE_NULL, 1559), /* callCallbackImmediately $parameter */ + reg::packed(1733, MAY_BE_NULL, 1340), /* callCallbackImmediately $parameterType */ reg::packed(910, 0), /* callCallbackImmediately $calleeReflection */ - reg::packed(1245, MAY_BE_BOOL), /* callCallbackImmediately return */ - reg::packed(1728, MAY_BE_NULL, 1564), /* shouldInvalidateCallbackExpressions $parameter */ - reg::packed(1245, MAY_BE_BOOL), /* shouldInvalidateCallbackExpressions return */ + reg::packed(1240, MAY_BE_BOOL), /* callCallbackImmediately return */ + reg::packed(1723, MAY_BE_NULL, 1559), /* shouldInvalidateCallbackExpressions $parameter */ + reg::packed(1240, MAY_BE_BOOL), /* shouldInvalidateCallbackExpressions return */ reg::packed(1036, 0, 1045), /* getParameterTypeFromParameterClosureTypeExtension $callLike */ reg::packed(910, 0), /* getParameterTypeFromParameterClosureTypeExtension $calleeReflection */ - reg::packed(1728, 0, 1564), /* getParameterTypeFromParameterClosureTypeExtension $parameter */ + reg::packed(1723, 0, 1559), /* getParameterTypeFromParameterClosureTypeExtension $parameter */ reg::packed(1074, 0, 1080), /* getParameterTypeFromParameterClosureTypeExtension $scope */ - reg::packed(1245, MAY_BE_NULL, 1345), /* getParameterTypeFromParameterClosureTypeExtension return */ + reg::packed(1240, MAY_BE_NULL, 1340), /* getParameterTypeFromParameterClosureTypeExtension return */ reg::packed(1036, 0, 1045), /* getParameterOutExtensionsType $callLike */ reg::packed(910, 0), /* getParameterOutExtensionsType $calleeReflection */ - reg::packed(1862, 0, 1564), /* getParameterOutExtensionsType $currentParameter */ + reg::packed(1857, 0, 1559), /* 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(1240, MAY_BE_NULL, 1340), /* getParameterOutExtensionsType return */ + reg::packed(1904, MAY_BE_NULL, 1045), /* resolveClosureThisType $call */ reg::packed(910, 0), /* resolveClosureThisType $calleeReflection */ - reg::packed(1728, 0, 1564), /* resolveClosureThisType $parameter */ + reg::packed(1723, 0, 1559), /* resolveClosureThisType $parameter */ reg::packed(1074, 0, 1080), /* resolveClosureThisType $scope */ - reg::packed(1245, MAY_BE_NULL, 1345), /* resolveClosureThisType return */ + reg::packed(1240, MAY_BE_NULL, 1340), /* resolveClosureThisType 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(1245, 0, 1080), /* observeUnpackedArgument return */ + reg::packed(1546, 0, 1474), /* observeUnpackedArgument $acceptor */ + reg::packed(1932, MAY_BE_LONG), /* observeUnpackedArgument $position */ + reg::packed(1941, 0, 1340), /* observeUnpackedArgument $unpackedType */ + reg::packed(1954, MAY_BE_BOOL), /* observeUnpackedArgument $isPure */ + reg::packed(1240, 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(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(1546, 0, 1474), /* observeArgumentValue $acceptor */ + reg::packed(1723, 0, 1559), /* observeArgumentValue $parameter */ + reg::packed(1985, 0, 1340), /* observeArgumentValue $valueType */ + reg::packed(1954, MAY_BE_BOOL), /* observeArgumentValue $isPure */ + reg::packed(1240, 0, 1080), /* observeArgumentValue return */ + reg::packed(1546, 0, 1474), /* findOriginalParameterType $acceptor */ + reg::packed(1723, 0, 1559), /* findOriginalParameterType $parameter */ + reg::packed(1240, MAY_BE_NULL, 1340), /* findOriginalParameterType return */ + reg::packed(2042, MAY_BE_ARRAY), /* readArgResult $argResults */ + reg::packed(2053, 0, 1383), /* readArgResult $argValue */ + reg::packed(1240, 0, 2062), /* readArgResult return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -274,24 +273,24 @@ using Sig = reg::Sig; /* 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 = { { 820 /* __construct */, 16, 0, 16, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig processArgs = { { 1274 /* processArgs */, 11, 16, 12, 28, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig addGatheredArgType = { { 1363 /* addGatheredArgType */, 6, 29, 6, 35, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig argConsumesResolvedParameterType = { { 1408 /* argConsumesResolvedParameterType */, 1, 36, 1, 37, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig gatherClosureArgType = { { 1453 /* gatherClosureArgType */, 4, 38, 4, 42, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig selectCountStableMetadataAcceptor = { { 1517 /* selectCountStableMetadataAcceptor */, 5, 43, 5, 48, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig matchArgParameter = { { 1603 /* matchArgParameter */, 3, 49, 3, 52, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig selectArgsAcceptor = { { 1621 /* selectArgsAcceptor */, 5, 53, 5, 58, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig selectArgsMetadataAcceptor = { { 1654 /* selectArgsMetadataAcceptor */, 8, 59, 8, 67, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processDroppedArgs = { { 1709 /* processDroppedArgs */, 7, 68, 7, 75, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig callCallbackImmediately = { { 1752 /* callCallbackImmediately */, 3, 76, 3, 79, ZEND_ACC_PRIVATE } }; -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 processArgs = { { 1269 /* processArgs */, 12, 16, 12, 28, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig addGatheredArgType = { { 1358 /* addGatheredArgType */, 6, 29, 6, 35, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig argConsumesResolvedParameterType = { { 1403 /* argConsumesResolvedParameterType */, 1, 36, 1, 37, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig gatherClosureArgType = { { 1448 /* gatherClosureArgType */, 4, 38, 4, 42, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig selectCountStableMetadataAcceptor = { { 1512 /* selectCountStableMetadataAcceptor */, 5, 43, 5, 48, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig matchArgParameter = { { 1598 /* matchArgParameter */, 3, 49, 3, 52, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig selectArgsAcceptor = { { 1616 /* selectArgsAcceptor */, 5, 53, 5, 58, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig selectArgsMetadataAcceptor = { { 1649 /* selectArgsMetadataAcceptor */, 8, 59, 8, 67, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processDroppedArgs = { { 1704 /* processDroppedArgs */, 7, 68, 7, 75, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig callCallbackImmediately = { { 1747 /* callCallbackImmediately */, 3, 76, 3, 79, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig shouldInvalidateCallbackExpressions = { { 1771 /* shouldInvalidateCallbackExpressions */, 1, 80, 1, 81, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getParameterTypeFromParameterClosureTypeExtension = { { 1807 /* getParameterTypeFromParameterClosureTypeExtension */, 4, 82, 4, 86, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getParameterOutExtensionsType = { { 1874 /* getParameterOutExtensionsType */, 4, 87, 4, 91, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveClosureThisType = { { 1909 /* resolveClosureThisType */, 4, 92, 4, 96, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeUnpackedArgument = { { 1961 /* observeUnpackedArgument */, 5, 97, 5, 102, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeArgumentValue = { { 1995 /* observeArgumentValue */, 5, 103, 5, 108, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig findOriginalParameterType = { { 2016 /* findOriginalParameterType */, 2, 109, 2, 111, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig readArgResult = { { 2096 /* readArgResult */, 2, 112, 2, 114, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::ArgumentsHandler diff --git a/turbo-ext/src/generated/AssignHandler.h b/turbo-ext/src/generated/AssignHandler.h index 5edaadc5cbe..f53ecf5456d 100644 --- a/turbo-ext/src/generated/AssignHandler.h +++ b/turbo-ext/src/generated/AssignHandler.h @@ -133,101 +133,100 @@ inline constexpr char strings[] = "createCreateTypesCallback\0" /* 1781 */ "createSpecifyTypesCallback\0" /* 1807 */ "var\0" /* 1834 */ - "null\0" /* 1838 */ - "processVirtualAssign\0" /* 1843 */ - "mode\0" /* 1864 */ - "PHPStan\\Analyser\\AssignTargetWalkMode\0" /* 1869 */ - "PHPStan\\Analyser\\PreparedAssignTarget\0" /* 1907 */ - "prepareTarget\0" /* 1945 */ - "doPrepareTarget\0" /* 1959 */ - "target\0" /* 1975 */ - "valueResult\0" /* 1982 */ - "assignedValueResult\0" /* 1994 */ - "applyWrite\0" /* 2014 */ - "receiverType\0" /* 2025 */ - "PHPStan\\Type\\Type\0" /* 2038 */ - "keyType\0" /* 2056 */ - "valueType\0" /* 2064 */ - "PHPStan\\Analyser\\Generics\\TemplateArgumentConstraints\0" /* 2074 */ - "collectOffsetSetUsage\0" /* 2128 */ - "keyVar\0" /* 2150 */ - "PhpParser\\Node\\Expr\\Variable\0" /* 2157 */ - "arrayArg\0" /* 2186 */ - "narrowedKeyType\0" /* 2195 */ - "dimFetchType\0" /* 2211 */ - "PHPStan\\Analyser\\SpecifiedTypes\0" /* 2224 */ - "createArrayDimFetchConditionalExpressionHolder\0" /* 2256 */ - "readAssignedValueType\0" /* 2303 */ - "varResult\0" /* 2325 */ - "postEvalScope\0" /* 2335 */ - "preEvalScope\0" /* 2349 */ - "resolveContainerTypesAfterAssignedExprEval\0" /* 2362 */ - "nameResult\0" /* 2405 */ - "nativeValueType\0" /* 2416 */ - "assignDynamicVariable\0" /* 2432 */ - "unwrapAssign\0" /* 2454 */ - "variableName\0" /* 2467 */ - "conditionalExpressions\0" /* 2480 */ - "specifiedTypes\0" /* 2503 */ - "variableType\0" /* 2518 */ - "rhsImpurePoints\0" /* 2531 */ - "processSureTypesForConditionalExpressionsAfterAssign\0" /* 2547 */ - "processSureNotTypesForConditionalExpressionsAfterAssign\0" /* 2600 */ - "currentTypeForConditionalHolder\0" /* 2656 */ - "armScope\0" /* 2688 */ - "armExpr\0" /* 2697 */ - "remainderType\0" /* 2705 */ - "otherArmType\0" /* 2719 */ - "processTernaryArmValueImpliedTypesAfterAssign\0" /* 2732 */ - "holderExpr\0" /* 2778 */ - "holderExprString\0" /* 2789 */ - "holderType\0" /* 2806 */ - "holderCertainty\0" /* 2817 */ - "PHPStan\\TrinaryLogic\0" /* 2833 */ - "addConditionalExpressionHolder\0" /* 2854 */ - "newConditionalExpressions\0" /* 2885 */ - "mergeConditionalExpressions\0" /* 2911 */ - "PhpParser\\Node\\Expr\\Match_\0" /* 2939 */ - "processMatchForConditionalExpressionsAfterAssign\0" /* 2966 */ - "assignedType\0" /* 3015 */ - "processDerivedConditionalExpressionsAfterAssign\0" /* 3028 */ - "PhpParser\\Node\\Expr\\FuncCall\0" /* 3076 */ - "processInArrayForConditionalExpressionsAfterAssign\0" /* 3105 */ - "isExprSafeToProjectThroughVariable\0" /* 3156 */ - "dimFetchStack\0" /* 3191 */ - "PHPStan\\Analyser\\Scope\0" /* 3205 */ - "isImplicitArrayCreation\0" /* 3228 */ - "rootVarName\0" /* 3252 */ - "arrayExpr\0" /* 3264 */ - "PhpParser\\Node\\Expr\\Array_\0" /* 3274 */ - "parentExpr\0" /* 3301 */ - "processArrayByRefItems\0" /* 3312 */ - "implicitIndex\0" /* 3335 */ - "processArrayByRefItemsWithImplicitIndex\0" /* 3349 */ - "isFlattenableUnpackedArray\0" /* 3389 */ - "index\0" /* 3416 */ - "advanceImplicitIndex\0" /* 3422 */ - "offsetTypes\0" /* 3443 */ - "offsetValueType\0" /* 3455 */ - "valueToWrite\0" /* 3471 */ - "produceArrayDimFetchAssignValueToWrite\0" /* 3484 */ - "arrayDimFetch\0" /* 3523 */ - "PhpParser\\Node\\Expr\\ArrayDimFetch\0" /* 3537 */ - "shouldKeepList\0" /* 3571 */ - "offsetType\0" /* 3586 */ - "trackedLinkImpliesOffset\0" /* 3597 */ - "a\0" /* 3622 */ - "b\0" /* 3624 */ - "isSameVariable\0" /* 3626 */ - "isSameOffset\0" /* 3641 */ - "getLiteralArrayKeyType\0" /* 3654 */ - "propertyFetch\0" /* 3677 */ - "PhpParser\\Node\\Expr\\PropertyFetch|PhpParser\\Node\\Expr\\StaticPropertyFetch\0" /* 3691 */ - "getOriginalPropertyType\0" /* 3765 */ - "array\0" /* 3789 */ - "hasArrayReference\0" /* 3795 */ - "rhs\0" /* 3813 */ - "redundant"; /* 3817 */ + "processVirtualAssign\0" /* 1838 */ + "mode\0" /* 1859 */ + "PHPStan\\Analyser\\AssignTargetWalkMode\0" /* 1864 */ + "PHPStan\\Analyser\\PreparedAssignTarget\0" /* 1902 */ + "prepareTarget\0" /* 1940 */ + "doPrepareTarget\0" /* 1954 */ + "target\0" /* 1970 */ + "valueResult\0" /* 1977 */ + "assignedValueResult\0" /* 1989 */ + "applyWrite\0" /* 2009 */ + "receiverType\0" /* 2020 */ + "PHPStan\\Type\\Type\0" /* 2033 */ + "keyType\0" /* 2051 */ + "valueType\0" /* 2059 */ + "PHPStan\\Analyser\\Generics\\TemplateArgumentConstraints\0" /* 2069 */ + "collectOffsetSetUsage\0" /* 2123 */ + "keyVar\0" /* 2145 */ + "PhpParser\\Node\\Expr\\Variable\0" /* 2152 */ + "arrayArg\0" /* 2181 */ + "narrowedKeyType\0" /* 2190 */ + "dimFetchType\0" /* 2206 */ + "PHPStan\\Analyser\\SpecifiedTypes\0" /* 2219 */ + "createArrayDimFetchConditionalExpressionHolder\0" /* 2251 */ + "readAssignedValueType\0" /* 2298 */ + "varResult\0" /* 2320 */ + "postEvalScope\0" /* 2330 */ + "preEvalScope\0" /* 2344 */ + "resolveContainerTypesAfterAssignedExprEval\0" /* 2357 */ + "nameResult\0" /* 2400 */ + "nativeValueType\0" /* 2411 */ + "assignDynamicVariable\0" /* 2427 */ + "unwrapAssign\0" /* 2449 */ + "variableName\0" /* 2462 */ + "conditionalExpressions\0" /* 2475 */ + "specifiedTypes\0" /* 2498 */ + "variableType\0" /* 2513 */ + "rhsImpurePoints\0" /* 2526 */ + "processSureTypesForConditionalExpressionsAfterAssign\0" /* 2542 */ + "processSureNotTypesForConditionalExpressionsAfterAssign\0" /* 2595 */ + "currentTypeForConditionalHolder\0" /* 2651 */ + "armScope\0" /* 2683 */ + "armExpr\0" /* 2692 */ + "remainderType\0" /* 2700 */ + "otherArmType\0" /* 2714 */ + "processTernaryArmValueImpliedTypesAfterAssign\0" /* 2727 */ + "holderExpr\0" /* 2773 */ + "holderExprString\0" /* 2784 */ + "holderType\0" /* 2801 */ + "holderCertainty\0" /* 2812 */ + "PHPStan\\TrinaryLogic\0" /* 2828 */ + "addConditionalExpressionHolder\0" /* 2849 */ + "newConditionalExpressions\0" /* 2880 */ + "mergeConditionalExpressions\0" /* 2906 */ + "PhpParser\\Node\\Expr\\Match_\0" /* 2934 */ + "processMatchForConditionalExpressionsAfterAssign\0" /* 2961 */ + "assignedType\0" /* 3010 */ + "processDerivedConditionalExpressionsAfterAssign\0" /* 3023 */ + "PhpParser\\Node\\Expr\\FuncCall\0" /* 3071 */ + "processInArrayForConditionalExpressionsAfterAssign\0" /* 3100 */ + "isExprSafeToProjectThroughVariable\0" /* 3151 */ + "dimFetchStack\0" /* 3186 */ + "PHPStan\\Analyser\\Scope\0" /* 3200 */ + "isImplicitArrayCreation\0" /* 3223 */ + "rootVarName\0" /* 3247 */ + "arrayExpr\0" /* 3259 */ + "PhpParser\\Node\\Expr\\Array_\0" /* 3269 */ + "parentExpr\0" /* 3296 */ + "processArrayByRefItems\0" /* 3307 */ + "implicitIndex\0" /* 3330 */ + "processArrayByRefItemsWithImplicitIndex\0" /* 3344 */ + "isFlattenableUnpackedArray\0" /* 3384 */ + "index\0" /* 3411 */ + "advanceImplicitIndex\0" /* 3417 */ + "offsetTypes\0" /* 3438 */ + "offsetValueType\0" /* 3450 */ + "valueToWrite\0" /* 3466 */ + "produceArrayDimFetchAssignValueToWrite\0" /* 3479 */ + "arrayDimFetch\0" /* 3518 */ + "PhpParser\\Node\\Expr\\ArrayDimFetch\0" /* 3532 */ + "shouldKeepList\0" /* 3566 */ + "offsetType\0" /* 3581 */ + "trackedLinkImpliesOffset\0" /* 3592 */ + "a\0" /* 3617 */ + "b\0" /* 3619 */ + "isSameVariable\0" /* 3621 */ + "isSameOffset\0" /* 3636 */ + "getLiteralArrayKeyType\0" /* 3649 */ + "propertyFetch\0" /* 3672 */ + "PhpParser\\Node\\Expr\\PropertyFetch|PhpParser\\Node\\Expr\\StaticPropertyFetch\0" /* 3686 */ + "getOriginalPropertyType\0" /* 3760 */ + "array\0" /* 3784 */ + "hasArrayReference\0" /* 3790 */ + "rhs\0" /* 3808 */ + "redundant"; /* 3812 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 25), /* __construct $templateArgumentObserver */ reg::packed(76, 0, 99), /* __construct $varAnnotationProcessor */ @@ -278,7 +277,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1834, 0, 1376), /* processVirtualAssign $var */ reg::packed(1672, 0, 1376), /* processVirtualAssign $assignedExpr */ reg::packed(1570, MAY_BE_CALLABLE), /* processVirtualAssign $nodeCallback */ - reg::packed(1742, MAY_BE_NULL, 1626, false, false, 1838), /* processVirtualAssign $assignedExprResult */ + reg::packed(1742, MAY_BE_NULL, 1626), /* processVirtualAssign $assignedExprResult */ reg::packed(1396, 0, 1626), /* processVirtualAssign return */ reg::packed(1406, 0, 1424), /* prepareTarget $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* prepareTarget $scope */ @@ -288,8 +287,8 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1672, 0, 1376), /* prepareTarget $assignedExpr */ reg::packed(1570, MAY_BE_CALLABLE), /* prepareTarget $nodeCallback */ reg::packed(1583, 0, 1591), /* prepareTarget $context */ - reg::packed(1864, 0, 1869), /* prepareTarget $mode */ - reg::packed(1396, 0, 1907), /* prepareTarget return */ + reg::packed(1859, 0, 1864), /* prepareTarget $mode */ + reg::packed(1396, 0, 1902), /* prepareTarget return */ reg::packed(1406, 0, 1424), /* doPrepareTarget $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* doPrepareTarget $scope */ reg::packed(1521, 0, 1529), /* doPrepareTarget $storage */ @@ -298,12 +297,12 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1672, 0, 1376), /* doPrepareTarget $assignedExpr */ reg::packed(1570, MAY_BE_CALLABLE), /* doPrepareTarget $nodeCallback */ reg::packed(1583, 0, 1591), /* doPrepareTarget $context */ - reg::packed(1864, 0, 1869), /* doPrepareTarget $mode */ - reg::packed(1396, 0, 1907), /* doPrepareTarget return */ + reg::packed(1859, 0, 1864), /* doPrepareTarget $mode */ + reg::packed(1396, 0, 1902), /* doPrepareTarget return */ reg::packed(1406, 0, 1424), /* applyWrite $nodeScopeResolver */ - reg::packed(1975, 0, 1907), /* applyWrite $target */ - reg::packed(1982, 0, 1626), /* applyWrite $valueResult */ - reg::packed(1994, MAY_BE_NULL, 1626), /* applyWrite $assignedValueResult */ + reg::packed(1970, 0, 1902), /* applyWrite $target */ + reg::packed(1977, 0, 1626), /* applyWrite $valueResult */ + reg::packed(1989, MAY_BE_NULL, 1626), /* applyWrite $assignedValueResult */ reg::packed(1459, 0, 1464), /* applyWrite $stmt */ reg::packed(1521, 0, 1529), /* applyWrite $storage */ reg::packed(1570, MAY_BE_CALLABLE), /* applyWrite $nodeCallback */ @@ -311,168 +310,168 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1396, 0, 1626), /* applyWrite return */ reg::packed(1406, 0, 1424), /* collectOffsetSetUsage $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* collectOffsetSetUsage $scope */ - reg::packed(2025, 0, 2038), /* collectOffsetSetUsage $receiverType */ - reg::packed(2056, MAY_BE_NULL, 2038), /* collectOffsetSetUsage $keyType */ - reg::packed(2064, 0, 2038), /* collectOffsetSetUsage $valueType */ - reg::packed(1396, 0, 2074), /* collectOffsetSetUsage return */ - reg::packed(2150, 0, 2157), /* createArrayDimFetchConditionalExpressionHolder $keyVar */ - reg::packed(2186, 0, 1376), /* createArrayDimFetchConditionalExpressionHolder $arrayArg */ - reg::packed(2195, 0, 2038), /* createArrayDimFetchConditionalExpressionHolder $narrowedKeyType */ - reg::packed(2211, 0, 2038), /* createArrayDimFetchConditionalExpressionHolder $dimFetchType */ - reg::packed(1396, 0, 2224), /* createArrayDimFetchConditionalExpressionHolder return */ + reg::packed(2020, 0, 2033), /* collectOffsetSetUsage $receiverType */ + reg::packed(2051, MAY_BE_NULL, 2033), /* collectOffsetSetUsage $keyType */ + reg::packed(2059, 0, 2033), /* collectOffsetSetUsage $valueType */ + reg::packed(1396, 0, 2069), /* collectOffsetSetUsage return */ + reg::packed(2145, 0, 2152), /* createArrayDimFetchConditionalExpressionHolder $keyVar */ + reg::packed(2181, 0, 1376), /* createArrayDimFetchConditionalExpressionHolder $arrayArg */ + reg::packed(2190, 0, 2033), /* createArrayDimFetchConditionalExpressionHolder $narrowedKeyType */ + reg::packed(2206, 0, 2033), /* createArrayDimFetchConditionalExpressionHolder $dimFetchType */ + reg::packed(1396, 0, 2219), /* createArrayDimFetchConditionalExpressionHolder return */ reg::packed(1406, 0, 1424), /* readAssignedValueType $nodeScopeResolver */ - reg::packed(1994, MAY_BE_NULL, 1626), /* readAssignedValueType $assignedValueResult */ + reg::packed(1989, MAY_BE_NULL, 1626), /* readAssignedValueType $assignedValueResult */ reg::packed(1672, 0, 1376), /* readAssignedValueType $assignedExpr */ reg::packed(1484, 0, 1490), /* readAssignedValueType $scope */ - reg::packed(1396, 0, 2038), /* readAssignedValueType return */ + reg::packed(1396, 0, 2033), /* readAssignedValueType return */ reg::packed(1406, 0, 1424), /* resolveContainerTypesAfterAssignedExprEval $nodeScopeResolver */ reg::packed(1834, 0, 1376), /* resolveContainerTypesAfterAssignedExprEval $var */ - reg::packed(2325, 0, 1626), /* resolveContainerTypesAfterAssignedExprEval $varResult */ - reg::packed(2335, 0, 1490), /* resolveContainerTypesAfterAssignedExprEval $postEvalScope */ - reg::packed(2349, MAY_BE_NULL, 1490), /* resolveContainerTypesAfterAssignedExprEval $preEvalScope */ + reg::packed(2320, 0, 1626), /* resolveContainerTypesAfterAssignedExprEval $varResult */ + reg::packed(2330, 0, 1490), /* resolveContainerTypesAfterAssignedExprEval $postEvalScope */ + reg::packed(2344, MAY_BE_NULL, 1490), /* resolveContainerTypesAfterAssignedExprEval $preEvalScope */ reg::packed(1521, 0, 1529), /* resolveContainerTypesAfterAssignedExprEval $storage */ reg::packed(1396, MAY_BE_ARRAY), /* resolveContainerTypesAfterAssignedExprEval return */ reg::packed(1484, 0, 1490), /* assignDynamicVariable $scope */ - reg::packed(2405, 0, 1626), /* assignDynamicVariable $nameResult */ - reg::packed(2064, 0, 2038), /* assignDynamicVariable $valueType */ - reg::packed(2416, 0, 2038), /* assignDynamicVariable $nativeValueType */ + reg::packed(2400, 0, 1626), /* assignDynamicVariable $nameResult */ + reg::packed(2059, 0, 2033), /* assignDynamicVariable $valueType */ + reg::packed(2411, 0, 2033), /* assignDynamicVariable $nativeValueType */ reg::packed(1396, 0, 1490), /* assignDynamicVariable return */ reg::packed(1371, 0, 1376), /* unwrapAssign $expr */ reg::packed(1396, 0, 1376), /* unwrapAssign return */ reg::packed(1406, 0, 1424), /* processSureTypesForConditionalExpressionsAfterAssign $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* processSureTypesForConditionalExpressionsAfterAssign $scope */ reg::packed(1521, 0, 1529), /* processSureTypesForConditionalExpressionsAfterAssign $storage */ - reg::packed(2467, MAY_BE_STRING), /* processSureTypesForConditionalExpressionsAfterAssign $variableName */ - reg::packed(2480, MAY_BE_ARRAY), /* processSureTypesForConditionalExpressionsAfterAssign $conditionalExpressions */ - reg::packed(2503, 0, 2224), /* processSureTypesForConditionalExpressionsAfterAssign $specifiedTypes */ - reg::packed(2518, 0, 2038), /* processSureTypesForConditionalExpressionsAfterAssign $variableType */ - reg::packed(2531, MAY_BE_ARRAY), /* processSureTypesForConditionalExpressionsAfterAssign $rhsImpurePoints */ + reg::packed(2462, MAY_BE_STRING), /* processSureTypesForConditionalExpressionsAfterAssign $variableName */ + reg::packed(2475, MAY_BE_ARRAY), /* processSureTypesForConditionalExpressionsAfterAssign $conditionalExpressions */ + reg::packed(2498, 0, 2219), /* processSureTypesForConditionalExpressionsAfterAssign $specifiedTypes */ + reg::packed(2513, 0, 2033), /* processSureTypesForConditionalExpressionsAfterAssign $variableType */ + reg::packed(2526, MAY_BE_ARRAY), /* processSureTypesForConditionalExpressionsAfterAssign $rhsImpurePoints */ reg::packed(1672, 0, 1376), /* processSureTypesForConditionalExpressionsAfterAssign $assignedExpr */ - reg::packed(1994, MAY_BE_NULL, 1626), /* processSureTypesForConditionalExpressionsAfterAssign $assignedValueResult */ + reg::packed(1989, MAY_BE_NULL, 1626), /* processSureTypesForConditionalExpressionsAfterAssign $assignedValueResult */ reg::packed(1396, MAY_BE_ARRAY), /* processSureTypesForConditionalExpressionsAfterAssign return */ reg::packed(1406, 0, 1424), /* processSureNotTypesForConditionalExpressionsAfterAssign $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* processSureNotTypesForConditionalExpressionsAfterAssign $scope */ reg::packed(1521, 0, 1529), /* processSureNotTypesForConditionalExpressionsAfterAssign $storage */ - reg::packed(2467, MAY_BE_STRING), /* processSureNotTypesForConditionalExpressionsAfterAssign $variableName */ - reg::packed(2480, MAY_BE_ARRAY), /* processSureNotTypesForConditionalExpressionsAfterAssign $conditionalExpressions */ - reg::packed(2503, 0, 2224), /* processSureNotTypesForConditionalExpressionsAfterAssign $specifiedTypes */ - reg::packed(2518, 0, 2038), /* processSureNotTypesForConditionalExpressionsAfterAssign $variableType */ - reg::packed(2531, MAY_BE_ARRAY), /* processSureNotTypesForConditionalExpressionsAfterAssign $rhsImpurePoints */ + reg::packed(2462, MAY_BE_STRING), /* processSureNotTypesForConditionalExpressionsAfterAssign $variableName */ + reg::packed(2475, MAY_BE_ARRAY), /* processSureNotTypesForConditionalExpressionsAfterAssign $conditionalExpressions */ + reg::packed(2498, 0, 2219), /* processSureNotTypesForConditionalExpressionsAfterAssign $specifiedTypes */ + reg::packed(2513, 0, 2033), /* processSureNotTypesForConditionalExpressionsAfterAssign $variableType */ + reg::packed(2526, MAY_BE_ARRAY), /* processSureNotTypesForConditionalExpressionsAfterAssign $rhsImpurePoints */ reg::packed(1672, 0, 1376), /* processSureNotTypesForConditionalExpressionsAfterAssign $assignedExpr */ - reg::packed(1994, MAY_BE_NULL, 1626), /* processSureNotTypesForConditionalExpressionsAfterAssign $assignedValueResult */ + reg::packed(1989, MAY_BE_NULL, 1626), /* processSureNotTypesForConditionalExpressionsAfterAssign $assignedValueResult */ reg::packed(1396, MAY_BE_ARRAY), /* processSureNotTypesForConditionalExpressionsAfterAssign return */ reg::packed(1406, 0, 1424), /* currentTypeForConditionalHolder $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* currentTypeForConditionalHolder $scope */ reg::packed(1521, 0, 1529), /* currentTypeForConditionalHolder $storage */ reg::packed(1371, 0, 1376), /* currentTypeForConditionalHolder $expr */ reg::packed(1672, 0, 1376), /* currentTypeForConditionalHolder $assignedExpr */ - reg::packed(1994, MAY_BE_NULL, 1626), /* currentTypeForConditionalHolder $assignedValueResult */ - reg::packed(1396, 0, 2038), /* currentTypeForConditionalHolder return */ + reg::packed(1989, MAY_BE_NULL, 1626), /* currentTypeForConditionalHolder $assignedValueResult */ + reg::packed(1396, 0, 2033), /* currentTypeForConditionalHolder return */ reg::packed(1406, 0, 1424), /* processTernaryArmValueImpliedTypesAfterAssign $nodeScopeResolver */ - reg::packed(2688, 0, 1490), /* processTernaryArmValueImpliedTypesAfterAssign $armScope */ + reg::packed(2683, 0, 1490), /* processTernaryArmValueImpliedTypesAfterAssign $armScope */ reg::packed(1521, 0, 1529), /* processTernaryArmValueImpliedTypesAfterAssign $storage */ - reg::packed(2467, MAY_BE_STRING), /* processTernaryArmValueImpliedTypesAfterAssign $variableName */ - reg::packed(2480, MAY_BE_ARRAY), /* processTernaryArmValueImpliedTypesAfterAssign $conditionalExpressions */ - reg::packed(2697, 0, 1376), /* processTernaryArmValueImpliedTypesAfterAssign $armExpr */ - reg::packed(2705, 0, 2038), /* processTernaryArmValueImpliedTypesAfterAssign $remainderType */ - reg::packed(2719, 0, 2038), /* processTernaryArmValueImpliedTypesAfterAssign $otherArmType */ - reg::packed(2531, MAY_BE_ARRAY), /* processTernaryArmValueImpliedTypesAfterAssign $rhsImpurePoints */ + reg::packed(2462, MAY_BE_STRING), /* processTernaryArmValueImpliedTypesAfterAssign $variableName */ + reg::packed(2475, MAY_BE_ARRAY), /* processTernaryArmValueImpliedTypesAfterAssign $conditionalExpressions */ + reg::packed(2692, 0, 1376), /* processTernaryArmValueImpliedTypesAfterAssign $armExpr */ + reg::packed(2700, 0, 2033), /* processTernaryArmValueImpliedTypesAfterAssign $remainderType */ + reg::packed(2714, 0, 2033), /* processTernaryArmValueImpliedTypesAfterAssign $otherArmType */ + reg::packed(2526, MAY_BE_ARRAY), /* processTernaryArmValueImpliedTypesAfterAssign $rhsImpurePoints */ reg::packed(1672, 0, 1376), /* processTernaryArmValueImpliedTypesAfterAssign $assignedExpr */ - reg::packed(1994, MAY_BE_NULL, 1626), /* processTernaryArmValueImpliedTypesAfterAssign $assignedValueResult */ + reg::packed(1989, MAY_BE_NULL, 1626), /* processTernaryArmValueImpliedTypesAfterAssign $assignedValueResult */ reg::packed(1396, MAY_BE_ARRAY), /* processTernaryArmValueImpliedTypesAfterAssign return */ - reg::packed(2480, MAY_BE_ARRAY), /* addConditionalExpressionHolder $conditionalExpressions */ - reg::packed(2467, MAY_BE_STRING), /* addConditionalExpressionHolder $variableName */ - reg::packed(2518, 0, 2038), /* addConditionalExpressionHolder $variableType */ - reg::packed(2778, 0, 1376), /* addConditionalExpressionHolder $holderExpr */ - reg::packed(2789, MAY_BE_STRING), /* addConditionalExpressionHolder $holderExprString */ - reg::packed(2806, 0, 2038), /* addConditionalExpressionHolder $holderType */ - reg::packed(2817, 0, 2833), /* addConditionalExpressionHolder $holderCertainty */ + reg::packed(2475, MAY_BE_ARRAY), /* addConditionalExpressionHolder $conditionalExpressions */ + reg::packed(2462, MAY_BE_STRING), /* addConditionalExpressionHolder $variableName */ + reg::packed(2513, 0, 2033), /* addConditionalExpressionHolder $variableType */ + reg::packed(2773, 0, 1376), /* addConditionalExpressionHolder $holderExpr */ + reg::packed(2784, MAY_BE_STRING), /* addConditionalExpressionHolder $holderExprString */ + reg::packed(2801, 0, 2033), /* addConditionalExpressionHolder $holderType */ + reg::packed(2812, 0, 2828), /* addConditionalExpressionHolder $holderCertainty */ reg::packed(1396, MAY_BE_ARRAY), /* addConditionalExpressionHolder return */ - reg::packed(2480, MAY_BE_ARRAY), /* mergeConditionalExpressions $conditionalExpressions */ - reg::packed(2885, MAY_BE_ARRAY), /* mergeConditionalExpressions $newConditionalExpressions */ + reg::packed(2475, MAY_BE_ARRAY), /* mergeConditionalExpressions $conditionalExpressions */ + reg::packed(2880, MAY_BE_ARRAY), /* mergeConditionalExpressions $newConditionalExpressions */ reg::packed(1396, MAY_BE_ARRAY), /* mergeConditionalExpressions return */ reg::packed(1484, 0, 1490), /* processMatchForConditionalExpressionsAfterAssign $scope */ - reg::packed(2467, MAY_BE_STRING), /* processMatchForConditionalExpressionsAfterAssign $variableName */ - reg::packed(1371, 0, 2939), /* processMatchForConditionalExpressionsAfterAssign $expr */ + reg::packed(2462, MAY_BE_STRING), /* processMatchForConditionalExpressionsAfterAssign $variableName */ + reg::packed(1371, 0, 2934), /* processMatchForConditionalExpressionsAfterAssign $expr */ reg::packed(1396, MAY_BE_ARRAY), /* processMatchForConditionalExpressionsAfterAssign return */ reg::packed(1406, 0, 1424), /* processDerivedConditionalExpressionsAfterAssign $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* processDerivedConditionalExpressionsAfterAssign $scope */ - reg::packed(2467, MAY_BE_STRING), /* processDerivedConditionalExpressionsAfterAssign $variableName */ - reg::packed(2480, MAY_BE_ARRAY), /* processDerivedConditionalExpressionsAfterAssign $conditionalExpressions */ + reg::packed(2462, MAY_BE_STRING), /* processDerivedConditionalExpressionsAfterAssign $variableName */ + reg::packed(2475, MAY_BE_ARRAY), /* processDerivedConditionalExpressionsAfterAssign $conditionalExpressions */ reg::packed(1672, 0, 1376), /* processDerivedConditionalExpressionsAfterAssign $assignedExpr */ - reg::packed(3015, 0, 2038), /* processDerivedConditionalExpressionsAfterAssign $assignedType */ - reg::packed(2531, MAY_BE_ARRAY), /* processDerivedConditionalExpressionsAfterAssign $rhsImpurePoints */ + reg::packed(3010, 0, 2033), /* processDerivedConditionalExpressionsAfterAssign $assignedType */ + reg::packed(2526, MAY_BE_ARRAY), /* processDerivedConditionalExpressionsAfterAssign $rhsImpurePoints */ reg::packed(1396, MAY_BE_ARRAY), /* processDerivedConditionalExpressionsAfterAssign return */ reg::packed(1406, 0, 1424), /* processInArrayForConditionalExpressionsAfterAssign $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* processInArrayForConditionalExpressionsAfterAssign $scope */ - reg::packed(2467, MAY_BE_STRING), /* processInArrayForConditionalExpressionsAfterAssign $variableName */ - reg::packed(2480, MAY_BE_ARRAY), /* processInArrayForConditionalExpressionsAfterAssign $conditionalExpressions */ - reg::packed(1672, 0, 3076), /* processInArrayForConditionalExpressionsAfterAssign $assignedExpr */ - reg::packed(3015, 0, 2038), /* processInArrayForConditionalExpressionsAfterAssign $assignedType */ - reg::packed(2531, MAY_BE_ARRAY), /* processInArrayForConditionalExpressionsAfterAssign $rhsImpurePoints */ + reg::packed(2462, MAY_BE_STRING), /* processInArrayForConditionalExpressionsAfterAssign $variableName */ + reg::packed(2475, MAY_BE_ARRAY), /* processInArrayForConditionalExpressionsAfterAssign $conditionalExpressions */ + reg::packed(1672, 0, 3071), /* processInArrayForConditionalExpressionsAfterAssign $assignedExpr */ + reg::packed(3010, 0, 2033), /* processInArrayForConditionalExpressionsAfterAssign $assignedType */ + reg::packed(2526, MAY_BE_ARRAY), /* processInArrayForConditionalExpressionsAfterAssign $rhsImpurePoints */ reg::packed(1396, MAY_BE_ARRAY), /* processInArrayForConditionalExpressionsAfterAssign return */ reg::packed(1371, 0, 1376), /* isExprSafeToProjectThroughVariable $expr */ - reg::packed(2467, MAY_BE_STRING), /* isExprSafeToProjectThroughVariable $variableName */ - reg::packed(2531, MAY_BE_ARRAY), /* isExprSafeToProjectThroughVariable $rhsImpurePoints */ + reg::packed(2462, MAY_BE_STRING), /* isExprSafeToProjectThroughVariable $variableName */ + reg::packed(2526, MAY_BE_ARRAY), /* isExprSafeToProjectThroughVariable $rhsImpurePoints */ reg::packed(1672, 0, 1376), /* isExprSafeToProjectThroughVariable $assignedExpr */ reg::packed(1396, MAY_BE_BOOL), /* isExprSafeToProjectThroughVariable return */ - reg::packed(3191, MAY_BE_ARRAY), /* isImplicitArrayCreation $dimFetchStack */ - reg::packed(1484, 0, 3205), /* isImplicitArrayCreation $scope */ - reg::packed(1396, 0, 2833), /* isImplicitArrayCreation return */ + reg::packed(3186, MAY_BE_ARRAY), /* isImplicitArrayCreation $dimFetchStack */ + reg::packed(1484, 0, 3200), /* isImplicitArrayCreation $scope */ + reg::packed(1396, 0, 2828), /* isImplicitArrayCreation return */ reg::packed(1406, 0, 1424), /* processArrayByRefItems $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* processArrayByRefItems $scope */ reg::packed(1521, 0, 1529), /* processArrayByRefItems $storage */ - reg::packed(3252, MAY_BE_STRING), /* processArrayByRefItems $rootVarName */ - reg::packed(3264, 0, 3274), /* processArrayByRefItems $arrayExpr */ - reg::packed(3301, 0, 1376), /* processArrayByRefItems $parentExpr */ + reg::packed(3247, MAY_BE_STRING), /* processArrayByRefItems $rootVarName */ + reg::packed(3259, 0, 3269), /* processArrayByRefItems $arrayExpr */ + reg::packed(3296, 0, 1376), /* processArrayByRefItems $parentExpr */ reg::packed(1396, 0, 1490), /* processArrayByRefItems return */ reg::packed(1406, 0, 1424), /* processArrayByRefItemsWithImplicitIndex $nodeScopeResolver */ reg::packed(1484, 0, 1490), /* processArrayByRefItemsWithImplicitIndex $scope */ reg::packed(1521, 0, 1529), /* processArrayByRefItemsWithImplicitIndex $storage */ - reg::packed(3252, MAY_BE_STRING), /* processArrayByRefItemsWithImplicitIndex $rootVarName */ - reg::packed(3264, 0, 3274), /* processArrayByRefItemsWithImplicitIndex $arrayExpr */ - reg::packed(3301, 0, 1376), /* processArrayByRefItemsWithImplicitIndex $parentExpr */ - reg::packed(3335, MAY_BE_NULL | MAY_BE_LONG), /* processArrayByRefItemsWithImplicitIndex $implicitIndex */ + reg::packed(3247, MAY_BE_STRING), /* processArrayByRefItemsWithImplicitIndex $rootVarName */ + reg::packed(3259, 0, 3269), /* processArrayByRefItemsWithImplicitIndex $arrayExpr */ + reg::packed(3296, 0, 1376), /* processArrayByRefItemsWithImplicitIndex $parentExpr */ + reg::packed(3330, MAY_BE_NULL | MAY_BE_LONG), /* processArrayByRefItemsWithImplicitIndex $implicitIndex */ reg::packed(1396, MAY_BE_ARRAY), /* processArrayByRefItemsWithImplicitIndex return */ - reg::packed(3264, 0, 3274), /* isFlattenableUnpackedArray $arrayExpr */ + reg::packed(3259, 0, 3269), /* isFlattenableUnpackedArray $arrayExpr */ reg::packed(1396, MAY_BE_BOOL), /* isFlattenableUnpackedArray return */ - reg::packed(3416, MAY_BE_LONG), /* advanceImplicitIndex $index */ + reg::packed(3411, MAY_BE_LONG), /* advanceImplicitIndex $index */ reg::packed(1396, MAY_BE_NULL | MAY_BE_LONG), /* advanceImplicitIndex return */ reg::packed(1406, 0, 1424), /* produceArrayDimFetchAssignValueToWrite $nodeScopeResolver */ - reg::packed(3191, MAY_BE_ARRAY), /* produceArrayDimFetchAssignValueToWrite $dimFetchStack */ - reg::packed(3443, MAY_BE_ARRAY), /* produceArrayDimFetchAssignValueToWrite $offsetTypes */ - reg::packed(3455, 0, 2038), /* produceArrayDimFetchAssignValueToWrite $offsetValueType */ - reg::packed(3471, 0, 2038), /* produceArrayDimFetchAssignValueToWrite $valueToWrite */ + reg::packed(3186, MAY_BE_ARRAY), /* produceArrayDimFetchAssignValueToWrite $dimFetchStack */ + reg::packed(3438, MAY_BE_ARRAY), /* produceArrayDimFetchAssignValueToWrite $offsetTypes */ + reg::packed(3450, 0, 2033), /* produceArrayDimFetchAssignValueToWrite $offsetValueType */ + reg::packed(3466, 0, 2033), /* produceArrayDimFetchAssignValueToWrite $valueToWrite */ reg::packed(1484, 0, 1490), /* produceArrayDimFetchAssignValueToWrite $scope */ reg::packed(1521, 0, 1529), /* produceArrayDimFetchAssignValueToWrite $storage */ reg::packed(1396, MAY_BE_ARRAY), /* produceArrayDimFetchAssignValueToWrite return */ reg::packed(1406, 0, 1424), /* shouldKeepList $nodeScopeResolver */ - reg::packed(3523, 0, 3537), /* shouldKeepList $arrayDimFetch */ + reg::packed(3518, 0, 3532), /* shouldKeepList $arrayDimFetch */ reg::packed(1484, 0, 1490), /* shouldKeepList $scope */ reg::packed(1521, 0, 1529), /* shouldKeepList $storage */ - reg::packed(3455, 0, 2038), /* shouldKeepList $offsetValueType */ + reg::packed(3450, 0, 2033), /* shouldKeepList $offsetValueType */ reg::packed(1396, MAY_BE_BOOL), /* shouldKeepList return */ - reg::packed(3455, 0, 2038), /* trackedLinkImpliesOffset $offsetValueType */ - reg::packed(3586, 0, 2038), /* trackedLinkImpliesOffset $offsetType */ + reg::packed(3450, 0, 2033), /* trackedLinkImpliesOffset $offsetValueType */ + reg::packed(3581, 0, 2033), /* trackedLinkImpliesOffset $offsetType */ reg::packed(1396, MAY_BE_BOOL), /* trackedLinkImpliesOffset return */ - reg::packed(3622, 0, 1376), /* isSameVariable $a */ - reg::packed(3624, 0, 1376), /* isSameVariable $b */ + reg::packed(3617, 0, 1376), /* isSameVariable $a */ + reg::packed(3619, 0, 1376), /* isSameVariable $b */ reg::packed(1396, MAY_BE_BOOL), /* isSameVariable return */ - reg::packed(3622, 0, 1376), /* isSameOffset $a */ - reg::packed(3624, 0, 1376), /* isSameOffset $b */ + reg::packed(3617, 0, 1376), /* isSameOffset $a */ + reg::packed(3619, 0, 1376), /* isSameOffset $b */ reg::packed(1396, MAY_BE_BOOL), /* isSameOffset return */ reg::packed(1371, 0, 1376), /* getLiteralArrayKeyType $expr */ - reg::packed(1396, MAY_BE_NULL, 2038), /* getLiteralArrayKeyType return */ + reg::packed(1396, MAY_BE_NULL, 2033), /* getLiteralArrayKeyType return */ reg::packed(1406, 0, 1424), /* getOriginalPropertyType $nodeScopeResolver */ - reg::packed(3677, 0, 3691), /* getOriginalPropertyType $propertyFetch */ + reg::packed(3672, 0, 3686), /* getOriginalPropertyType $propertyFetch */ reg::packed(1484, 0, 1490), /* getOriginalPropertyType $scope */ - reg::packed(1396, 0, 2038), /* getOriginalPropertyType return */ - reg::packed(3789, 0, 3274), /* hasArrayReference $array */ + reg::packed(1396, 0, 2033), /* getOriginalPropertyType return */ + reg::packed(3784, 0, 3269), /* hasArrayReference $array */ reg::packed(1396, MAY_BE_BOOL), /* hasArrayReference return */ - reg::packed(3813, 0, 1626), /* redundant $rhs */ - reg::packed(1975, 0, 1376), /* redundant $target */ + reg::packed(3808, 0, 1626), /* redundant $rhs */ + reg::packed(1970, 0, 1376), /* redundant $target */ reg::packed(1521, 0, 1529), /* redundant $storage */ - reg::packed(1396, MAY_BE_NULL, 2038), /* redundant return */ + reg::packed(1396, MAY_BE_NULL, 2033), /* redundant return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -485,40 +484,40 @@ inline constexpr sigtab::Sig processExpr = { { 1660 /* processExpr */, 7, 22, 7, inline constexpr sigtab::Sig captureAssignedCallArgResults = { { 1685 /* captureAssignedCallArgResults */, 2, 30, 2, 32, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig createCreateTypesCallback = { { 1781 /* createCreateTypesCallback */, 3, 33, 3, 36, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig createSpecifyTypesCallback = { { 1807 /* createSpecifyTypesCallback */, 4, 37, 4, 41, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processVirtualAssign = { { 1843 /* processVirtualAssign */, 7, 42, 8, 50, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig prepareTarget = { { 1945 /* prepareTarget */, 9, 51, 9, 60, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig doPrepareTarget = { { 1959 /* doPrepareTarget */, 9, 61, 9, 70, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig applyWrite = { { 2014 /* applyWrite */, 8, 71, 8, 79, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig collectOffsetSetUsage = { { 2128 /* collectOffsetSetUsage */, 5, 80, 5, 85, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig createArrayDimFetchConditionalExpressionHolder = { { 2256 /* createArrayDimFetchConditionalExpressionHolder */, 4, 86, 4, 90, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig readAssignedValueType = { { 2303 /* readAssignedValueType */, 4, 91, 4, 95, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveContainerTypesAfterAssignedExprEval = { { 2362 /* resolveContainerTypesAfterAssignedExprEval */, 6, 96, 6, 102, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig assignDynamicVariable = { { 2432 /* assignDynamicVariable */, 4, 103, 4, 107, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig unwrapAssign = { { 2454 /* unwrapAssign */, 1, 108, 1, 109, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processSureTypesForConditionalExpressionsAfterAssign = { { 2547 /* processSureTypesForConditionalExpressionsAfterAssign */, 10, 110, 10, 120, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processSureNotTypesForConditionalExpressionsAfterAssign = { { 2600 /* processSureNotTypesForConditionalExpressionsAfterAssign */, 10, 121, 10, 131, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig currentTypeForConditionalHolder = { { 2656 /* currentTypeForConditionalHolder */, 6, 132, 6, 138, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processTernaryArmValueImpliedTypesAfterAssign = { { 2732 /* processTernaryArmValueImpliedTypesAfterAssign */, 11, 139, 11, 150, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig addConditionalExpressionHolder = { { 2854 /* addConditionalExpressionHolder */, 7, 151, 7, 158, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig mergeConditionalExpressions = { { 2911 /* mergeConditionalExpressions */, 2, 159, 2, 161, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processMatchForConditionalExpressionsAfterAssign = { { 2966 /* processMatchForConditionalExpressionsAfterAssign */, 3, 162, 3, 165, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processDerivedConditionalExpressionsAfterAssign = { { 3028 /* processDerivedConditionalExpressionsAfterAssign */, 7, 166, 7, 173, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processInArrayForConditionalExpressionsAfterAssign = { { 3105 /* processInArrayForConditionalExpressionsAfterAssign */, 7, 174, 7, 181, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isExprSafeToProjectThroughVariable = { { 3156 /* isExprSafeToProjectThroughVariable */, 4, 182, 4, 186, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isImplicitArrayCreation = { { 3228 /* isImplicitArrayCreation */, 2, 187, 2, 189, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processArrayByRefItems = { { 3312 /* processArrayByRefItems */, 6, 190, 6, 196, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processArrayByRefItemsWithImplicitIndex = { { 3349 /* processArrayByRefItemsWithImplicitIndex */, 7, 197, 7, 204, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isFlattenableUnpackedArray = { { 3389 /* isFlattenableUnpackedArray */, 1, 205, 1, 206, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig advanceImplicitIndex = { { 3422 /* advanceImplicitIndex */, 1, 207, 1, 208, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig produceArrayDimFetchAssignValueToWrite = { { 3484 /* produceArrayDimFetchAssignValueToWrite */, 7, 209, 7, 216, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig shouldKeepList = { { 3571 /* shouldKeepList */, 5, 217, 5, 222, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig trackedLinkImpliesOffset = { { 3597 /* trackedLinkImpliesOffset */, 2, 223, 2, 225, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isSameVariable = { { 3626 /* isSameVariable */, 2, 226, 2, 228, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isSameOffset = { { 3641 /* isSameOffset */, 2, 229, 2, 231, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getLiteralArrayKeyType = { { 3654 /* getLiteralArrayKeyType */, 1, 232, 1, 233, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getOriginalPropertyType = { { 3765 /* getOriginalPropertyType */, 3, 234, 3, 237, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig hasArrayReference = { { 3795 /* hasArrayReference */, 1, 238, 1, 239, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig redundant = { { 3817 /* redundant */, 3, 240, 3, 243, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig processVirtualAssign = { { 1838 /* processVirtualAssign */, 8, 42, 8, 50, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig prepareTarget = { { 1940 /* prepareTarget */, 9, 51, 9, 60, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig doPrepareTarget = { { 1954 /* doPrepareTarget */, 9, 61, 9, 70, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig applyWrite = { { 2009 /* applyWrite */, 8, 71, 8, 79, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig collectOffsetSetUsage = { { 2123 /* collectOffsetSetUsage */, 5, 80, 5, 85, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig createArrayDimFetchConditionalExpressionHolder = { { 2251 /* createArrayDimFetchConditionalExpressionHolder */, 4, 86, 4, 90, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig readAssignedValueType = { { 2298 /* readAssignedValueType */, 4, 91, 4, 95, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveContainerTypesAfterAssignedExprEval = { { 2357 /* resolveContainerTypesAfterAssignedExprEval */, 6, 96, 6, 102, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig assignDynamicVariable = { { 2427 /* assignDynamicVariable */, 4, 103, 4, 107, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig unwrapAssign = { { 2449 /* unwrapAssign */, 1, 108, 1, 109, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processSureTypesForConditionalExpressionsAfterAssign = { { 2542 /* processSureTypesForConditionalExpressionsAfterAssign */, 10, 110, 10, 120, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processSureNotTypesForConditionalExpressionsAfterAssign = { { 2595 /* processSureNotTypesForConditionalExpressionsAfterAssign */, 10, 121, 10, 131, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig currentTypeForConditionalHolder = { { 2651 /* currentTypeForConditionalHolder */, 6, 132, 6, 138, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processTernaryArmValueImpliedTypesAfterAssign = { { 2727 /* processTernaryArmValueImpliedTypesAfterAssign */, 11, 139, 11, 150, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig addConditionalExpressionHolder = { { 2849 /* addConditionalExpressionHolder */, 7, 151, 7, 158, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig mergeConditionalExpressions = { { 2906 /* mergeConditionalExpressions */, 2, 159, 2, 161, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processMatchForConditionalExpressionsAfterAssign = { { 2961 /* processMatchForConditionalExpressionsAfterAssign */, 3, 162, 3, 165, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processDerivedConditionalExpressionsAfterAssign = { { 3023 /* processDerivedConditionalExpressionsAfterAssign */, 7, 166, 7, 173, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processInArrayForConditionalExpressionsAfterAssign = { { 3100 /* processInArrayForConditionalExpressionsAfterAssign */, 7, 174, 7, 181, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isExprSafeToProjectThroughVariable = { { 3151 /* isExprSafeToProjectThroughVariable */, 4, 182, 4, 186, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isImplicitArrayCreation = { { 3223 /* isImplicitArrayCreation */, 2, 187, 2, 189, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processArrayByRefItems = { { 3307 /* processArrayByRefItems */, 6, 190, 6, 196, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processArrayByRefItemsWithImplicitIndex = { { 3344 /* processArrayByRefItemsWithImplicitIndex */, 7, 197, 7, 204, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isFlattenableUnpackedArray = { { 3384 /* isFlattenableUnpackedArray */, 1, 205, 1, 206, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig advanceImplicitIndex = { { 3417 /* advanceImplicitIndex */, 1, 207, 1, 208, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig produceArrayDimFetchAssignValueToWrite = { { 3479 /* produceArrayDimFetchAssignValueToWrite */, 7, 209, 7, 216, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig shouldKeepList = { { 3566 /* shouldKeepList */, 5, 217, 5, 222, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig trackedLinkImpliesOffset = { { 3592 /* trackedLinkImpliesOffset */, 2, 223, 2, 225, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isSameVariable = { { 3621 /* isSameVariable */, 2, 226, 2, 228, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isSameOffset = { { 3636 /* isSameOffset */, 2, 229, 2, 231, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getLiteralArrayKeyType = { { 3649 /* getLiteralArrayKeyType */, 1, 232, 1, 233, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getOriginalPropertyType = { { 3760 /* getOriginalPropertyType */, 3, 234, 3, 237, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig hasArrayReference = { { 3790 /* hasArrayReference */, 1, 238, 1, 239, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig redundant = { { 3812 /* redundant */, 3, 240, 3, 243, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; } // namespace sig } // namespace ptdecl::AssignHandler diff --git a/turbo-ext/src/generated/ClassConstantAccessType.h b/turbo-ext/src/generated/ClassConstantAccessType.h index ab4465ac63c..c1bae28652d 100644 --- a/turbo-ext/src/generated/ClassConstantAccessType.h +++ b/turbo-ext/src/generated/ClassConstantAccessType.h @@ -44,65 +44,64 @@ inline constexpr char strings[] = "PHPStan\\Type\\Type\0" /* 5 */ "constantName\0" /* 23 */ "nativeType\0" /* 36 */ - "null\0" /* 47 */ - "__construct\0" /* 52 */ - "\0" /* 64 */ - "PHPStan\\Type\\ClassConstantAccessType\0" /* 65 */ - "withNativeType\0" /* 102 */ - "getReferencedClasses\0" /* 117 */ - "positionVariance\0" /* 138 */ - "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 155 */ - "getReferencedTemplateTypes\0" /* 197 */ - "equals\0" /* 224 */ - "level\0" /* 231 */ - "PHPStan\\Type\\VerbosityLevel\0" /* 237 */ - "describe\0" /* 265 */ - "isResolvable\0" /* 274 */ - "getResult\0" /* 287 */ - "cb\0" /* 297 */ - "traverse\0" /* 300 */ - "right\0" /* 309 */ - "traverseSimultaneously\0" /* 315 */ - "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 338 */ - "toPhpDocNode"; /* 377 */ + "__construct\0" /* 47 */ + "\0" /* 59 */ + "PHPStan\\Type\\ClassConstantAccessType\0" /* 60 */ + "withNativeType\0" /* 97 */ + "getReferencedClasses\0" /* 112 */ + "positionVariance\0" /* 133 */ + "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 150 */ + "getReferencedTemplateTypes\0" /* 192 */ + "equals\0" /* 219 */ + "level\0" /* 226 */ + "PHPStan\\Type\\VerbosityLevel\0" /* 232 */ + "describe\0" /* 260 */ + "isResolvable\0" /* 269 */ + "getResult\0" /* 282 */ + "cb\0" /* 292 */ + "traverse\0" /* 295 */ + "right\0" /* 304 */ + "traverseSimultaneously\0" /* 310 */ + "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 333 */ + "toPhpDocNode"; /* 372 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 5), /* __construct $type */ reg::packed(23, MAY_BE_STRING), /* __construct $constantName */ - reg::packed(36, MAY_BE_NULL, 5, false, false, 47), /* __construct $nativeType */ + reg::packed(36, MAY_BE_NULL, 5), /* __construct $nativeType */ reg::packed(36, 0, 5), /* withNativeType $nativeType */ - reg::packed(64, 0, 65), /* withNativeType return */ - reg::packed(64, MAY_BE_ARRAY), /* getReferencedClasses return */ - reg::packed(138, 0, 155), /* getReferencedTemplateTypes $positionVariance */ - reg::packed(64, MAY_BE_ARRAY), /* getReferencedTemplateTypes return */ + reg::packed(59, 0, 60), /* withNativeType return */ + reg::packed(59, MAY_BE_ARRAY), /* getReferencedClasses return */ + reg::packed(133, 0, 150), /* getReferencedTemplateTypes $positionVariance */ + reg::packed(59, MAY_BE_ARRAY), /* getReferencedTemplateTypes return */ reg::packed(0, 0, 5), /* equals $type */ - reg::packed(64, MAY_BE_BOOL), /* equals return */ - reg::packed(231, 0, 237), /* describe $level */ - reg::packed(64, MAY_BE_STRING), /* describe return */ - reg::packed(64, MAY_BE_BOOL), /* isResolvable return */ - reg::packed(64, 0, 5), /* getResult return */ - reg::packed(297, MAY_BE_CALLABLE), /* traverse $cb */ - reg::packed(64, 0, 5), /* traverse return */ - reg::packed(309, 0, 5), /* traverseSimultaneously $right */ - reg::packed(297, MAY_BE_CALLABLE), /* traverseSimultaneously $cb */ - reg::packed(64, 0, 5), /* traverseSimultaneously return */ - reg::packed(64, 0, 338), /* toPhpDocNode return */ + reg::packed(59, MAY_BE_BOOL), /* equals return */ + reg::packed(226, 0, 232), /* describe $level */ + reg::packed(59, MAY_BE_STRING), /* describe return */ + reg::packed(59, MAY_BE_BOOL), /* isResolvable return */ + reg::packed(59, 0, 5), /* getResult return */ + reg::packed(292, MAY_BE_CALLABLE), /* traverse $cb */ + reg::packed(59, 0, 5), /* traverse return */ + reg::packed(304, 0, 5), /* traverseSimultaneously $right */ + reg::packed(292, MAY_BE_CALLABLE), /* traverseSimultaneously $cb */ + reg::packed(59, 0, 5), /* traverseSimultaneously return */ + reg::packed(59, 0, 333), /* toPhpDocNode 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 = { { 52 /* __construct */, 2, 0, 3, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withNativeType = { { 102 /* withNativeType */, 1, 3, 1, 4, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getReferencedClasses = { { 117 /* getReferencedClasses */, 0, 5, 0, 5, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getReferencedTemplateTypes = { { 197 /* getReferencedTemplateTypes */, 1, 6, 1, 7, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig equals = { { 224 /* equals */, 1, 8, 1, 9, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig describe = { { 265 /* describe */, 1, 10, 1, 11, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isResolvable = { { 274 /* isResolvable */, 0, 12, 0, 12, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getResult = { { 287 /* getResult */, 0, 13, 0, 13, ZEND_ACC_PROTECTED } }; -inline constexpr sigtab::Sig traverse = { { 300 /* traverse */, 1, 14, 1, 15, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig traverseSimultaneously = { { 315 /* traverseSimultaneously */, 2, 16, 2, 18, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toPhpDocNode = { { 377 /* toPhpDocNode */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 47 /* __construct */, 3, 0, 3, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withNativeType = { { 97 /* withNativeType */, 1, 3, 1, 4, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getReferencedClasses = { { 112 /* getReferencedClasses */, 0, 5, 0, 5, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getReferencedTemplateTypes = { { 192 /* getReferencedTemplateTypes */, 1, 6, 1, 7, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig equals = { { 219 /* equals */, 1, 8, 1, 9, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig describe = { { 260 /* describe */, 1, 10, 1, 11, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isResolvable = { { 269 /* isResolvable */, 0, 12, 0, 12, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getResult = { { 282 /* getResult */, 0, 13, 0, 13, ZEND_ACC_PROTECTED } }; +inline constexpr sigtab::Sig traverse = { { 295 /* traverse */, 1, 14, 1, 15, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig traverseSimultaneously = { { 310 /* traverseSimultaneously */, 2, 16, 2, 18, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toPhpDocNode = { { 372 /* toPhpDocNode */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ClassConstantAccessType diff --git a/turbo-ext/src/generated/ClosureProcessor.h b/turbo-ext/src/generated/ClosureProcessor.h index c9b4eef96dd..0dd5926ee0b 100644 --- a/turbo-ext/src/generated/ClosureProcessor.h +++ b/turbo-ext/src/generated/ClosureProcessor.h @@ -74,40 +74,39 @@ inline constexpr char strings[] = "passedToType\0" /* 967 */ "PHPStan\\Type\\Type\0" /* 980 */ "nativePassedToType\0" /* 998 */ - "null\0" /* 1017 */ - "PHPStan\\Analyser\\ProcessClosureResult\0" /* 1022 */ - "processClosureNode\0" /* 1060 */ - "processClosureNodeInternal\0" /* 1079 */ - "call\0" /* 1106 */ - "PhpParser\\Node\\Expr\0" /* 1111 */ - "argumentTypes\0" /* 1131 */ - "creationScope\0" /* 1145 */ - "untilFixpoint\0" /* 1159 */ - "processByRefInvocation\0" /* 1173 */ - "entryScope\0" /* 1196 */ - "enter\0" /* 1207 */ - "byRefUses\0" /* 1213 */ - "walkByRefInvocation\0" /* 1223 */ - "byRefEntryTypes\0" /* 1243 */ - "processDeferredByRefClosureBody\0" /* 1259 */ - "callableParameters\0" /* 1291 */ - "enterWithCapturedUses\0" /* 1310 */ - "source\0" /* 1332 */ - "assignByRefUses\0" /* 1339 */ - "closureScope\0" /* 1355 */ - "gatheredReturnStatementsWithScope\0" /* 1368 */ - "gatheredYieldStatementsWithScope\0" /* 1402 */ - "executionEnds\0" /* 1435 */ - "throwPoints\0" /* 1449 */ - "impurePoints\0" /* 1461 */ - "invalidateExpressions\0" /* 1474 */ - "refineClosureNodeScope\0" /* 1496 */ - "invalidatedExpressions\0" /* 1519 */ - "uses\0" /* 1542 */ - "processImmediatelyCalledCallable\0" /* 1547 */ - "PhpParser\\Node\\Expr\\ArrowFunction\0" /* 1580 */ - "PHPStan\\Analyser\\ProcessArrowFunctionResult\0" /* 1614 */ - "processArrowFunctionNode"; /* 1658 */ + "PHPStan\\Analyser\\ProcessClosureResult\0" /* 1017 */ + "processClosureNode\0" /* 1055 */ + "processClosureNodeInternal\0" /* 1074 */ + "call\0" /* 1101 */ + "PhpParser\\Node\\Expr\0" /* 1106 */ + "argumentTypes\0" /* 1126 */ + "creationScope\0" /* 1140 */ + "untilFixpoint\0" /* 1154 */ + "processByRefInvocation\0" /* 1168 */ + "entryScope\0" /* 1191 */ + "enter\0" /* 1202 */ + "byRefUses\0" /* 1208 */ + "walkByRefInvocation\0" /* 1218 */ + "byRefEntryTypes\0" /* 1238 */ + "processDeferredByRefClosureBody\0" /* 1254 */ + "callableParameters\0" /* 1286 */ + "enterWithCapturedUses\0" /* 1305 */ + "source\0" /* 1327 */ + "assignByRefUses\0" /* 1334 */ + "closureScope\0" /* 1350 */ + "gatheredReturnStatementsWithScope\0" /* 1363 */ + "gatheredYieldStatementsWithScope\0" /* 1397 */ + "executionEnds\0" /* 1430 */ + "throwPoints\0" /* 1444 */ + "impurePoints\0" /* 1456 */ + "invalidateExpressions\0" /* 1469 */ + "refineClosureNodeScope\0" /* 1491 */ + "invalidatedExpressions\0" /* 1514 */ + "uses\0" /* 1537 */ + "processImmediatelyCalledCallable\0" /* 1542 */ + "PhpParser\\Node\\Expr\\ArrowFunction\0" /* 1575 */ + "PHPStan\\Analyser\\ProcessArrowFunctionResult\0" /* 1609 */ + "processArrowFunctionNode"; /* 1653 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 10), /* __construct $container */ reg::packed(48, 0, 72), /* __construct $expressionResultFactory */ @@ -132,8 +131,8 @@ inline constexpr reg::PackedArg args[] = { reg::packed(819, MAY_BE_CALLABLE), /* processClosureNode $nodeCallback */ reg::packed(924, 0, 932), /* processClosureNode $context */ reg::packed(967, MAY_BE_NULL, 980), /* processClosureNode $passedToType */ - reg::packed(998, MAY_BE_NULL, 980, false, false, 1017), /* processClosureNode $nativePassedToType */ - reg::packed(471, 0, 1022), /* processClosureNode return */ + reg::packed(998, MAY_BE_NULL, 980), /* processClosureNode $nativePassedToType */ + reg::packed(471, 0, 1017), /* processClosureNode return */ reg::packed(588, 0, 606), /* processClosureNodeInternal $nodeScopeResolver */ reg::packed(641, 0, 646), /* processClosureNodeInternal $stmt */ reg::packed(666, 0, 896), /* processClosureNodeInternal $expr */ @@ -142,67 +141,67 @@ inline constexpr reg::PackedArg args[] = { reg::packed(819, MAY_BE_CALLABLE), /* processClosureNodeInternal $nodeCallback */ reg::packed(924, 0, 932), /* processClosureNodeInternal $context */ reg::packed(967, MAY_BE_NULL, 980), /* processClosureNodeInternal $passedToType */ - reg::packed(998, MAY_BE_NULL, 980, false, false, 1017), /* processClosureNodeInternal $nativePassedToType */ - reg::packed(471, 0, 1022), /* processClosureNodeInternal return */ + reg::packed(998, MAY_BE_NULL, 980), /* processClosureNodeInternal $nativePassedToType */ + reg::packed(471, 0, 1017), /* processClosureNodeInternal return */ reg::packed(588, 0, 606), /* processByRefInvocation $nodeScopeResolver */ reg::packed(666, 0, 896), /* processByRefInvocation $expr */ - reg::packed(1106, 0, 1111), /* processByRefInvocation $call */ + reg::packed(1101, 0, 1106), /* processByRefInvocation $call */ reg::packed(733, 0, 739), /* processByRefInvocation $scope */ reg::packed(770, 0, 778), /* processByRefInvocation $storage */ - reg::packed(1131, MAY_BE_ARRAY), /* processByRefInvocation $argumentTypes */ - reg::packed(1145, 0, 739), /* processByRefInvocation $creationScope */ - reg::packed(1159, MAY_BE_BOOL), /* processByRefInvocation $untilFixpoint */ + reg::packed(1126, MAY_BE_ARRAY), /* processByRefInvocation $argumentTypes */ + reg::packed(1140, 0, 739), /* processByRefInvocation $creationScope */ + reg::packed(1154, MAY_BE_BOOL), /* processByRefInvocation $untilFixpoint */ reg::packed(471, MAY_BE_ARRAY), /* processByRefInvocation return */ reg::packed(588, 0, 606), /* walkByRefInvocation $nodeScopeResolver */ reg::packed(666, 0, 896), /* walkByRefInvocation $expr */ reg::packed(733, 0, 739), /* walkByRefInvocation $scope */ reg::packed(770, 0, 778), /* walkByRefInvocation $storage */ - reg::packed(1196, 0, 739), /* walkByRefInvocation $entryScope */ - reg::packed(1207, MAY_BE_CALLABLE), /* walkByRefInvocation $enter */ - reg::packed(1213, MAY_BE_ARRAY), /* walkByRefInvocation $byRefUses */ - reg::packed(1159, MAY_BE_BOOL), /* walkByRefInvocation $untilFixpoint */ + reg::packed(1191, 0, 739), /* walkByRefInvocation $entryScope */ + reg::packed(1202, MAY_BE_CALLABLE), /* walkByRefInvocation $enter */ + reg::packed(1208, MAY_BE_ARRAY), /* walkByRefInvocation $byRefUses */ + reg::packed(1154, MAY_BE_BOOL), /* walkByRefInvocation $untilFixpoint */ reg::packed(471, MAY_BE_ARRAY), /* walkByRefInvocation return */ reg::packed(588, 0, 606), /* processDeferredByRefClosureBody $nodeScopeResolver */ reg::packed(666, 0, 896), /* processDeferredByRefClosureBody $expr */ reg::packed(733, 0, 739), /* processDeferredByRefClosureBody $scope */ reg::packed(770, 0, 778), /* processDeferredByRefClosureBody $storage */ reg::packed(819, MAY_BE_CALLABLE), /* processDeferredByRefClosureBody $nodeCallback */ - reg::packed(1243, MAY_BE_ARRAY), /* processDeferredByRefClosureBody $byRefEntryTypes */ + reg::packed(1238, MAY_BE_ARRAY), /* processDeferredByRefClosureBody $byRefEntryTypes */ reg::packed(471, MAY_BE_NULL, 832), /* processDeferredByRefClosureBody return */ reg::packed(733, 0, 739), /* enterWithCapturedUses $scope */ reg::packed(666, 0, 896), /* enterWithCapturedUses $expr */ - reg::packed(1291, MAY_BE_ARRAY), /* enterWithCapturedUses $callableParameters */ - reg::packed(1145, 0, 739), /* enterWithCapturedUses $creationScope */ + reg::packed(1286, MAY_BE_ARRAY), /* enterWithCapturedUses $callableParameters */ + reg::packed(1140, 0, 739), /* enterWithCapturedUses $creationScope */ reg::packed(471, 0, 739), /* enterWithCapturedUses return */ reg::packed(733, 0, 739), /* assignByRefUses $scope */ - reg::packed(1332, 0, 739), /* assignByRefUses $source */ - reg::packed(1213, MAY_BE_ARRAY), /* assignByRefUses $byRefUses */ + reg::packed(1327, 0, 739), /* assignByRefUses $source */ + reg::packed(1208, MAY_BE_ARRAY), /* assignByRefUses $byRefUses */ reg::packed(471, 0, 739), /* assignByRefUses return */ - reg::packed(1355, 0, 739), /* refineClosureNodeScope $closureScope */ + reg::packed(1350, 0, 739), /* refineClosureNodeScope $closureScope */ reg::packed(733, 0, 739), /* refineClosureNodeScope $scope */ reg::packed(666, 0, 896), /* refineClosureNodeScope $expr */ - reg::packed(1368, MAY_BE_ARRAY), /* refineClosureNodeScope $gatheredReturnStatementsWithScope */ - reg::packed(1402, MAY_BE_ARRAY), /* refineClosureNodeScope $gatheredYieldStatementsWithScope */ - reg::packed(1435, MAY_BE_ARRAY), /* refineClosureNodeScope $executionEnds */ - reg::packed(1449, MAY_BE_ARRAY), /* refineClosureNodeScope $throwPoints */ - reg::packed(1461, MAY_BE_ARRAY), /* refineClosureNodeScope $impurePoints */ - reg::packed(1474, MAY_BE_ARRAY), /* refineClosureNodeScope $invalidateExpressions */ + reg::packed(1363, MAY_BE_ARRAY), /* refineClosureNodeScope $gatheredReturnStatementsWithScope */ + reg::packed(1397, MAY_BE_ARRAY), /* refineClosureNodeScope $gatheredYieldStatementsWithScope */ + reg::packed(1430, MAY_BE_ARRAY), /* refineClosureNodeScope $executionEnds */ + reg::packed(1444, MAY_BE_ARRAY), /* refineClosureNodeScope $throwPoints */ + reg::packed(1456, MAY_BE_ARRAY), /* refineClosureNodeScope $impurePoints */ + reg::packed(1469, MAY_BE_ARRAY), /* refineClosureNodeScope $invalidateExpressions */ reg::packed(770, 0, 778), /* refineClosureNodeScope $storage */ reg::packed(471, 0, 739), /* refineClosureNodeScope return */ reg::packed(733, 0, 739), /* processImmediatelyCalledCallable $scope */ - reg::packed(1519, MAY_BE_ARRAY), /* processImmediatelyCalledCallable $invalidatedExpressions */ - reg::packed(1542, MAY_BE_ARRAY), /* processImmediatelyCalledCallable $uses */ + reg::packed(1514, MAY_BE_ARRAY), /* processImmediatelyCalledCallable $invalidatedExpressions */ + reg::packed(1537, MAY_BE_ARRAY), /* processImmediatelyCalledCallable $uses */ reg::packed(471, 0, 739), /* processImmediatelyCalledCallable return */ reg::packed(588, 0, 606), /* processArrowFunctionNode $nodeScopeResolver */ reg::packed(641, 0, 646), /* processArrowFunctionNode $stmt */ - reg::packed(666, 0, 1580), /* processArrowFunctionNode $expr */ + reg::packed(666, 0, 1575), /* processArrowFunctionNode $expr */ reg::packed(733, 0, 739), /* processArrowFunctionNode $scope */ reg::packed(770, 0, 778), /* processArrowFunctionNode $storage */ reg::packed(819, MAY_BE_CALLABLE), /* processArrowFunctionNode $nodeCallback */ reg::packed(967, MAY_BE_NULL, 980), /* processArrowFunctionNode $passedToType */ - reg::packed(998, MAY_BE_NULL, 980, false, false, 1017), /* processArrowFunctionNode $nativePassedToType */ - reg::packed(924, MAY_BE_NULL, 932, false, false, 1017), /* processArrowFunctionNode $context */ - reg::packed(471, 0, 1614), /* processArrowFunctionNode return */ + reg::packed(998, MAY_BE_NULL, 980), /* processArrowFunctionNode $nativePassedToType */ + reg::packed(924, MAY_BE_NULL, 932), /* processArrowFunctionNode $context */ + reg::packed(471, 0, 1609), /* processArrowFunctionNode return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -213,16 +212,16 @@ inline constexpr sigtab::Sig __construct = { { 459 /* __construct */, 6, 0, 6, r inline constexpr sigtab::Sig getParametersProcessor = { { 509 /* getParametersProcessor */, 0, 6, 0, 6, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig getAttributesHandler = { { 567 /* getAttributesHandler */, 0, 7, 0, 7, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig processAttributeGroupsAndParams = { { 864 /* processAttributeGroupsAndParams */, 6, 8, 6, 14, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processClosureNode = { { 1060 /* processClosureNode */, 8, 15, 9, 24, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig processClosureNodeInternal = { { 1079 /* processClosureNodeInternal */, 8, 25, 9, 34, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processByRefInvocation = { { 1173 /* processByRefInvocation */, 8, 35, 8, 43, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig walkByRefInvocation = { { 1223 /* walkByRefInvocation */, 8, 44, 8, 52, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processDeferredByRefClosureBody = { { 1259 /* processDeferredByRefClosureBody */, 6, 53, 6, 59, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig enterWithCapturedUses = { { 1310 /* enterWithCapturedUses */, 4, 60, 4, 64, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig assignByRefUses = { { 1339 /* assignByRefUses */, 3, 65, 3, 68, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig refineClosureNodeScope = { { 1496 /* refineClosureNodeScope */, 10, 69, 10, 79, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processImmediatelyCalledCallable = { { 1547 /* processImmediatelyCalledCallable */, 3, 80, 3, 83, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig processArrowFunctionNode = { { 1658 /* processArrowFunctionNode */, 7, 84, 9, 93, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig processClosureNode = { { 1055 /* processClosureNode */, 9, 15, 9, 24, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig processClosureNodeInternal = { { 1074 /* processClosureNodeInternal */, 9, 25, 9, 34, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processByRefInvocation = { { 1168 /* processByRefInvocation */, 8, 35, 8, 43, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig walkByRefInvocation = { { 1218 /* walkByRefInvocation */, 8, 44, 8, 52, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processDeferredByRefClosureBody = { { 1254 /* processDeferredByRefClosureBody */, 6, 53, 6, 59, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig enterWithCapturedUses = { { 1305 /* enterWithCapturedUses */, 4, 60, 4, 64, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig assignByRefUses = { { 1334 /* assignByRefUses */, 3, 65, 3, 68, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig refineClosureNodeScope = { { 1491 /* refineClosureNodeScope */, 10, 69, 10, 79, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processImmediatelyCalledCallable = { { 1542 /* processImmediatelyCalledCallable */, 3, 80, 3, 83, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig processArrowFunctionNode = { { 1653 /* processArrowFunctionNode */, 9, 84, 9, 93, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ClosureProcessor diff --git a/turbo-ext/src/generated/ClosureTypeResolver.h b/turbo-ext/src/generated/ClosureTypeResolver.h index e1bfec6f1e4..3fb98dd21b4 100644 --- a/turbo-ext/src/generated/ClosureTypeResolver.h +++ b/turbo-ext/src/generated/ClosureTypeResolver.h @@ -54,48 +54,46 @@ inline constexpr char strings[] = "scope\0" /* 431 */ "PHPStan\\Analyser\\MutatingScope\0" /* 437 */ "shallow\0" /* 468 */ - "false\0" /* 476 */ - "storage\0" /* 482 */ - "PHPStan\\Analyser\\ExpressionResultStorage\0" /* 490 */ - "null\0" /* 531 */ - "passedToType\0" /* 536 */ - "PHPStan\\Type\\Type\0" /* 549 */ - "PHPStan\\Type\\ClosureType\0" /* 567 */ - "getClosureType\0" /* 592 */ - "PhpParser\\Node\\Expr\\Closure\0" /* 607 */ - "returnStatements\0" /* 635 */ - "yieldStatements\0" /* 652 */ - "executionEnds\0" /* 668 */ - "throwPoints\0" /* 682 */ - "impurePoints\0" /* 694 */ - "invalidateExpressions\0" /* 707 */ - "native\0" /* 729 */ - "nativePassedToType\0" /* 736 */ - "buildClosureTypeForClosure\0" /* 755 */ - "PhpParser\\Node\\Expr\\ArrowFunction\0" /* 782 */ - "arrowScope\0" /* 816 */ - "buildClosureTypeForArrowFunction\0" /* 827 */ - "callableParameters\0" /* 860 */ - "parameters\0" /* 879 */ - "closureContextCacheKey\0" /* 890 */ - "freeVariableRoots\0" /* 913 */ - "PhpParser\\Node\\Expr\0" /* 931 */ - "readScope\0" /* 951 */ - "readExprType\0" /* 961 */ - "isVariadic\0" /* 974 */ - "cacheKey\0" /* 985 */ - "contextFree\0" /* 994 */ - "buildClosureTypeFromClosureWalk\0" /* 1006 */ - "resolveArrowFunctionReturnType\0" /* 1038 */ - "deriveOnlyNeverExecutionEnds\0" /* 1069 */ - "buildDeclaredParameters\0" /* 1098 */ - "getDeclaredClosureType\0" /* 1122 */ - "buildParametersAndAcceptors\0" /* 1145 */ - "cachedClosureData\0" /* 1173 */ - "createClosureTypeFromCache\0" /* 1191 */ - "returnType\0" /* 1218 */ - "usedVariables\0" /* 1229 */ - "assembleClosureType"; /* 1243 */ + "storage\0" /* 476 */ + "PHPStan\\Analyser\\ExpressionResultStorage\0" /* 484 */ + "passedToType\0" /* 525 */ + "PHPStan\\Type\\Type\0" /* 538 */ + "PHPStan\\Type\\ClosureType\0" /* 556 */ + "getClosureType\0" /* 581 */ + "PhpParser\\Node\\Expr\\Closure\0" /* 596 */ + "returnStatements\0" /* 624 */ + "yieldStatements\0" /* 641 */ + "executionEnds\0" /* 657 */ + "throwPoints\0" /* 671 */ + "impurePoints\0" /* 683 */ + "invalidateExpressions\0" /* 696 */ + "native\0" /* 718 */ + "nativePassedToType\0" /* 725 */ + "buildClosureTypeForClosure\0" /* 744 */ + "PhpParser\\Node\\Expr\\ArrowFunction\0" /* 771 */ + "arrowScope\0" /* 805 */ + "buildClosureTypeForArrowFunction\0" /* 816 */ + "callableParameters\0" /* 849 */ + "parameters\0" /* 868 */ + "closureContextCacheKey\0" /* 879 */ + "freeVariableRoots\0" /* 902 */ + "PhpParser\\Node\\Expr\0" /* 920 */ + "readScope\0" /* 940 */ + "readExprType\0" /* 950 */ + "isVariadic\0" /* 963 */ + "cacheKey\0" /* 974 */ + "contextFree\0" /* 983 */ + "buildClosureTypeFromClosureWalk\0" /* 995 */ + "resolveArrowFunctionReturnType\0" /* 1027 */ + "deriveOnlyNeverExecutionEnds\0" /* 1058 */ + "buildDeclaredParameters\0" /* 1087 */ + "getDeclaredClosureType\0" /* 1111 */ + "buildParametersAndAcceptors\0" /* 1134 */ + "cachedClosureData\0" /* 1162 */ + "createClosureTypeFromCache\0" /* 1180 */ + "returnType\0" /* 1207 */ + "usedVariables\0" /* 1218 */ + "assembleClosureType"; /* 1232 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 18), /* __construct $nodeScopeResolver */ reg::packed(53, 0, 81), /* __construct $initializerExprTypeResolver */ @@ -106,100 +104,100 @@ inline constexpr reg::PackedArg args[] = { reg::packed(324, MAY_BE_ARRAY), /* findCachedTypes return */ reg::packed(431, 0, 437), /* getClosureType $scope */ reg::packed(348, 0, 353), /* getClosureType $expr */ - reg::packed(468, MAY_BE_BOOL, reg::NoString, false, false, 476), /* getClosureType $shallow */ - reg::packed(482, MAY_BE_NULL, 490, false, false, 531), /* getClosureType $storage */ - reg::packed(536, MAY_BE_NULL, 549, false, false, 531), /* getClosureType $passedToType */ - reg::packed(324, 0, 567), /* getClosureType return */ + reg::packed(468, MAY_BE_BOOL), /* getClosureType $shallow */ + reg::packed(476, MAY_BE_NULL, 484), /* getClosureType $storage */ + reg::packed(525, MAY_BE_NULL, 538), /* getClosureType $passedToType */ + reg::packed(324, 0, 556), /* getClosureType return */ reg::packed(431, 0, 437), /* buildClosureTypeForClosure $scope */ - reg::packed(348, 0, 607), /* buildClosureTypeForClosure $expr */ - reg::packed(635, MAY_BE_ARRAY), /* buildClosureTypeForClosure $returnStatements */ - reg::packed(652, MAY_BE_ARRAY), /* buildClosureTypeForClosure $yieldStatements */ - reg::packed(668, MAY_BE_ARRAY), /* buildClosureTypeForClosure $executionEnds */ - reg::packed(682, MAY_BE_ARRAY), /* buildClosureTypeForClosure $throwPoints */ - reg::packed(694, MAY_BE_ARRAY), /* buildClosureTypeForClosure $impurePoints */ - reg::packed(707, MAY_BE_ARRAY), /* buildClosureTypeForClosure $invalidateExpressions */ - reg::packed(729, MAY_BE_BOOL, reg::NoString, false, false, 476), /* buildClosureTypeForClosure $native */ - reg::packed(482, MAY_BE_NULL, 490, false, false, 531), /* buildClosureTypeForClosure $storage */ - reg::packed(536, MAY_BE_NULL, 549, false, false, 531), /* buildClosureTypeForClosure $passedToType */ - reg::packed(736, MAY_BE_NULL, 549, false, false, 531), /* buildClosureTypeForClosure $nativePassedToType */ - reg::packed(324, 0, 567), /* buildClosureTypeForClosure return */ + reg::packed(348, 0, 596), /* buildClosureTypeForClosure $expr */ + reg::packed(624, MAY_BE_ARRAY), /* buildClosureTypeForClosure $returnStatements */ + reg::packed(641, MAY_BE_ARRAY), /* buildClosureTypeForClosure $yieldStatements */ + reg::packed(657, MAY_BE_ARRAY), /* buildClosureTypeForClosure $executionEnds */ + reg::packed(671, MAY_BE_ARRAY), /* buildClosureTypeForClosure $throwPoints */ + reg::packed(683, MAY_BE_ARRAY), /* buildClosureTypeForClosure $impurePoints */ + reg::packed(696, MAY_BE_ARRAY), /* buildClosureTypeForClosure $invalidateExpressions */ + reg::packed(718, MAY_BE_BOOL), /* buildClosureTypeForClosure $native */ + reg::packed(476, MAY_BE_NULL, 484), /* buildClosureTypeForClosure $storage */ + reg::packed(525, MAY_BE_NULL, 538), /* buildClosureTypeForClosure $passedToType */ + reg::packed(725, MAY_BE_NULL, 538), /* buildClosureTypeForClosure $nativePassedToType */ + reg::packed(324, 0, 556), /* buildClosureTypeForClosure return */ reg::packed(431, 0, 437), /* buildClosureTypeForArrowFunction $scope */ - reg::packed(348, 0, 782), /* buildClosureTypeForArrowFunction $expr */ - reg::packed(816, 0, 437), /* buildClosureTypeForArrowFunction $arrowScope */ - reg::packed(682, MAY_BE_ARRAY), /* buildClosureTypeForArrowFunction $throwPoints */ - reg::packed(694, MAY_BE_ARRAY), /* buildClosureTypeForArrowFunction $impurePoints */ - reg::packed(707, MAY_BE_ARRAY), /* buildClosureTypeForArrowFunction $invalidateExpressions */ - reg::packed(729, MAY_BE_BOOL, reg::NoString, false, false, 476), /* buildClosureTypeForArrowFunction $native */ - reg::packed(482, MAY_BE_NULL, 490, false, false, 531), /* buildClosureTypeForArrowFunction $storage */ - reg::packed(536, MAY_BE_NULL, 549, false, false, 531), /* buildClosureTypeForArrowFunction $passedToType */ - reg::packed(736, MAY_BE_NULL, 549, false, false, 531), /* buildClosureTypeForArrowFunction $nativePassedToType */ - reg::packed(324, 0, 567), /* buildClosureTypeForArrowFunction return */ + reg::packed(348, 0, 771), /* buildClosureTypeForArrowFunction $expr */ + reg::packed(805, 0, 437), /* buildClosureTypeForArrowFunction $arrowScope */ + reg::packed(671, MAY_BE_ARRAY), /* buildClosureTypeForArrowFunction $throwPoints */ + reg::packed(683, MAY_BE_ARRAY), /* buildClosureTypeForArrowFunction $impurePoints */ + reg::packed(696, MAY_BE_ARRAY), /* buildClosureTypeForArrowFunction $invalidateExpressions */ + reg::packed(718, MAY_BE_BOOL), /* buildClosureTypeForArrowFunction $native */ + reg::packed(476, MAY_BE_NULL, 484), /* buildClosureTypeForArrowFunction $storage */ + reg::packed(525, MAY_BE_NULL, 538), /* buildClosureTypeForArrowFunction $passedToType */ + reg::packed(725, MAY_BE_NULL, 538), /* buildClosureTypeForArrowFunction $nativePassedToType */ + reg::packed(324, 0, 556), /* buildClosureTypeForArrowFunction return */ reg::packed(431, 0, 437), /* closureContextCacheKey $scope */ reg::packed(348, 0, 353), /* closureContextCacheKey $expr */ - reg::packed(860, MAY_BE_NULL | MAY_BE_ARRAY), /* closureContextCacheKey $callableParameters */ - reg::packed(879, MAY_BE_ARRAY), /* closureContextCacheKey $parameters */ + reg::packed(849, MAY_BE_NULL | MAY_BE_ARRAY), /* closureContextCacheKey $callableParameters */ + reg::packed(868, MAY_BE_ARRAY), /* closureContextCacheKey $parameters */ reg::packed(324, MAY_BE_STRING), /* closureContextCacheKey return */ reg::packed(348, 0, 353), /* freeVariableRoots $expr */ reg::packed(324, MAY_BE_NULL | MAY_BE_ARRAY), /* freeVariableRoots return */ - reg::packed(482, MAY_BE_NULL, 490), /* readExprType $storage */ - reg::packed(348, 0, 931), /* readExprType $expr */ - reg::packed(951, 0, 437), /* readExprType $readScope */ - reg::packed(729, MAY_BE_BOOL), /* readExprType $native */ - reg::packed(324, 0, 549), /* readExprType return */ + reg::packed(476, MAY_BE_NULL, 484), /* readExprType $storage */ + reg::packed(348, 0, 920), /* readExprType $expr */ + reg::packed(940, 0, 437), /* readExprType $readScope */ + reg::packed(718, MAY_BE_BOOL), /* readExprType $native */ + reg::packed(324, 0, 538), /* readExprType return */ reg::packed(431, 0, 437), /* buildClosureTypeFromClosureWalk $scope */ - reg::packed(348, 0, 607), /* buildClosureTypeFromClosureWalk $expr */ - reg::packed(879, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $parameters */ - reg::packed(974, MAY_BE_BOOL), /* buildClosureTypeFromClosureWalk $isVariadic */ - reg::packed(635, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $returnStatements */ - reg::packed(652, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $yieldStatements */ - reg::packed(668, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $executionEnds */ - reg::packed(682, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $throwPoints */ - reg::packed(694, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $impurePoints */ - reg::packed(707, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $invalidateExpressions */ - reg::packed(985, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 531), /* buildClosureTypeFromClosureWalk $cacheKey */ - reg::packed(729, MAY_BE_BOOL, reg::NoString, false, false, 476), /* buildClosureTypeFromClosureWalk $native */ - reg::packed(482, MAY_BE_NULL, 490, false, false, 531), /* buildClosureTypeFromClosureWalk $storage */ - reg::packed(994, MAY_BE_BOOL, reg::NoString, false, false, 476), /* buildClosureTypeFromClosureWalk $contextFree */ - reg::packed(324, 0, 567), /* buildClosureTypeFromClosureWalk return */ + reg::packed(348, 0, 596), /* buildClosureTypeFromClosureWalk $expr */ + reg::packed(868, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $parameters */ + reg::packed(963, MAY_BE_BOOL), /* buildClosureTypeFromClosureWalk $isVariadic */ + reg::packed(624, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $returnStatements */ + reg::packed(641, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $yieldStatements */ + reg::packed(657, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $executionEnds */ + reg::packed(671, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $throwPoints */ + reg::packed(683, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $impurePoints */ + reg::packed(696, MAY_BE_ARRAY), /* buildClosureTypeFromClosureWalk $invalidateExpressions */ + reg::packed(974, MAY_BE_NULL | MAY_BE_STRING), /* buildClosureTypeFromClosureWalk $cacheKey */ + reg::packed(718, MAY_BE_BOOL), /* buildClosureTypeFromClosureWalk $native */ + reg::packed(476, MAY_BE_NULL, 484), /* buildClosureTypeFromClosureWalk $storage */ + reg::packed(983, MAY_BE_BOOL), /* buildClosureTypeFromClosureWalk $contextFree */ + reg::packed(324, 0, 556), /* buildClosureTypeFromClosureWalk return */ reg::packed(431, 0, 437), /* resolveArrowFunctionReturnType $scope */ - reg::packed(816, 0, 437), /* resolveArrowFunctionReturnType $arrowScope */ - reg::packed(348, 0, 782), /* resolveArrowFunctionReturnType $expr */ - reg::packed(729, MAY_BE_BOOL, reg::NoString, false, false, 476), /* resolveArrowFunctionReturnType $native */ - reg::packed(482, MAY_BE_NULL, 490, false, false, 531), /* resolveArrowFunctionReturnType $storage */ - reg::packed(324, 0, 549), /* resolveArrowFunctionReturnType return */ - reg::packed(668, MAY_BE_ARRAY), /* deriveOnlyNeverExecutionEnds $executionEnds */ + reg::packed(805, 0, 437), /* resolveArrowFunctionReturnType $arrowScope */ + reg::packed(348, 0, 771), /* resolveArrowFunctionReturnType $expr */ + reg::packed(718, MAY_BE_BOOL), /* resolveArrowFunctionReturnType $native */ + reg::packed(476, MAY_BE_NULL, 484), /* resolveArrowFunctionReturnType $storage */ + reg::packed(324, 0, 538), /* resolveArrowFunctionReturnType return */ + reg::packed(657, MAY_BE_ARRAY), /* deriveOnlyNeverExecutionEnds $executionEnds */ reg::packed(324, MAY_BE_NULL | MAY_BE_BOOL), /* deriveOnlyNeverExecutionEnds return */ reg::packed(431, 0, 437), /* buildDeclaredParameters $scope */ reg::packed(348, 0, 353), /* buildDeclaredParameters $expr */ reg::packed(324, MAY_BE_ARRAY), /* buildDeclaredParameters return */ reg::packed(431, 0, 437), /* getDeclaredClosureType $scope */ reg::packed(348, 0, 353), /* getDeclaredClosureType $expr */ - reg::packed(324, 0, 567), /* getDeclaredClosureType return */ + reg::packed(324, 0, 556), /* getDeclaredClosureType return */ reg::packed(431, 0, 437), /* buildParametersAndAcceptors $scope */ reg::packed(348, 0, 353), /* buildParametersAndAcceptors $expr */ - reg::packed(482, MAY_BE_NULL, 490, false, false, 531), /* buildParametersAndAcceptors $storage */ - reg::packed(536, MAY_BE_NULL, 549, false, false, 531), /* buildParametersAndAcceptors $passedToType */ - reg::packed(736, MAY_BE_NULL, 549, false, false, 531), /* buildParametersAndAcceptors $nativePassedToType */ + reg::packed(476, MAY_BE_NULL, 484), /* buildParametersAndAcceptors $storage */ + reg::packed(525, MAY_BE_NULL, 538), /* buildParametersAndAcceptors $passedToType */ + reg::packed(725, MAY_BE_NULL, 538), /* buildParametersAndAcceptors $nativePassedToType */ reg::packed(324, MAY_BE_ARRAY), /* buildParametersAndAcceptors return */ reg::packed(431, 0, 437), /* createClosureTypeFromCache $scope */ reg::packed(348, 0, 353), /* createClosureTypeFromCache $expr */ - reg::packed(879, MAY_BE_ARRAY), /* createClosureTypeFromCache $parameters */ - reg::packed(974, MAY_BE_BOOL), /* createClosureTypeFromCache $isVariadic */ - reg::packed(1173, MAY_BE_ARRAY), /* createClosureTypeFromCache $cachedClosureData */ - reg::packed(994, MAY_BE_BOOL), /* createClosureTypeFromCache $contextFree */ - reg::packed(324, 0, 567), /* createClosureTypeFromCache return */ + reg::packed(868, MAY_BE_ARRAY), /* createClosureTypeFromCache $parameters */ + reg::packed(963, MAY_BE_BOOL), /* createClosureTypeFromCache $isVariadic */ + reg::packed(1162, MAY_BE_ARRAY), /* createClosureTypeFromCache $cachedClosureData */ + reg::packed(983, MAY_BE_BOOL), /* createClosureTypeFromCache $contextFree */ + reg::packed(324, 0, 556), /* createClosureTypeFromCache return */ reg::packed(431, 0, 437), /* assembleClosureType $scope */ reg::packed(348, 0, 353), /* assembleClosureType $expr */ - reg::packed(879, MAY_BE_ARRAY), /* assembleClosureType $parameters */ - reg::packed(974, MAY_BE_BOOL), /* assembleClosureType $isVariadic */ - reg::packed(1218, 0, 549), /* assembleClosureType $returnType */ - reg::packed(682, MAY_BE_ARRAY), /* assembleClosureType $throwPoints */ - reg::packed(694, MAY_BE_ARRAY), /* assembleClosureType $impurePoints */ - reg::packed(707, MAY_BE_ARRAY), /* assembleClosureType $invalidateExpressions */ - reg::packed(1229, MAY_BE_ARRAY), /* assembleClosureType $usedVariables */ - reg::packed(985, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 531), /* assembleClosureType $cacheKey */ - reg::packed(994, MAY_BE_BOOL, reg::NoString, false, false, 476), /* assembleClosureType $contextFree */ - reg::packed(324, 0, 567), /* assembleClosureType return */ + reg::packed(868, MAY_BE_ARRAY), /* assembleClosureType $parameters */ + reg::packed(963, MAY_BE_BOOL), /* assembleClosureType $isVariadic */ + reg::packed(1207, 0, 538), /* assembleClosureType $returnType */ + reg::packed(671, MAY_BE_ARRAY), /* assembleClosureType $throwPoints */ + reg::packed(683, MAY_BE_ARRAY), /* assembleClosureType $impurePoints */ + reg::packed(696, MAY_BE_ARRAY), /* assembleClosureType $invalidateExpressions */ + reg::packed(1218, MAY_BE_ARRAY), /* assembleClosureType $usedVariables */ + reg::packed(974, MAY_BE_NULL | MAY_BE_STRING), /* assembleClosureType $cacheKey */ + reg::packed(983, MAY_BE_BOOL), /* assembleClosureType $contextFree */ + reg::packed(324, 0, 556), /* assembleClosureType return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -209,20 +207,20 @@ namespace sig { inline constexpr sigtab::Sig __construct = { { 312 /* __construct */, 4, 0, 4, reg::NoArg, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig resetFileAnalysisState = { { 325 /* resetFileAnalysisState */, 0, 4, 0, 4, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig findCachedTypes = { { 415 /* findCachedTypes */, 1, 5, 1, 6, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getClosureType = { { 592 /* getClosureType */, 2, 7, 5, 12, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig buildClosureTypeForClosure = { { 755 /* buildClosureTypeForClosure */, 8, 13, 12, 25, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig buildClosureTypeForArrowFunction = { { 827 /* buildClosureTypeForArrowFunction */, 6, 26, 10, 36, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig closureContextCacheKey = { { 890 /* closureContextCacheKey */, 4, 37, 4, 41, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig freeVariableRoots = { { 913 /* freeVariableRoots */, 1, 42, 1, 43, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig readExprType = { { 961 /* readExprType */, 4, 44, 4, 48, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig buildClosureTypeFromClosureWalk = { { 1006 /* buildClosureTypeFromClosureWalk */, 10, 49, 14, 63, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveArrowFunctionReturnType = { { 1038 /* resolveArrowFunctionReturnType */, 3, 64, 5, 69, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig deriveOnlyNeverExecutionEnds = { { 1069 /* deriveOnlyNeverExecutionEnds */, 1, 70, 1, 71, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig buildDeclaredParameters = { { 1098 /* buildDeclaredParameters */, 2, 72, 2, 74, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getDeclaredClosureType = { { 1122 /* getDeclaredClosureType */, 2, 75, 2, 77, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig buildParametersAndAcceptors = { { 1145 /* buildParametersAndAcceptors */, 2, 78, 5, 83, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig createClosureTypeFromCache = { { 1191 /* createClosureTypeFromCache */, 6, 84, 6, 90, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig assembleClosureType = { { 1243 /* assembleClosureType */, 9, 91, 11, 102, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getClosureType = { { 581 /* getClosureType */, 5, 7, 5, 12, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig buildClosureTypeForClosure = { { 744 /* buildClosureTypeForClosure */, 12, 13, 12, 25, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig buildClosureTypeForArrowFunction = { { 816 /* buildClosureTypeForArrowFunction */, 10, 26, 10, 36, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig closureContextCacheKey = { { 879 /* closureContextCacheKey */, 4, 37, 4, 41, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig freeVariableRoots = { { 902 /* freeVariableRoots */, 1, 42, 1, 43, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig readExprType = { { 950 /* readExprType */, 4, 44, 4, 48, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig buildClosureTypeFromClosureWalk = { { 995 /* buildClosureTypeFromClosureWalk */, 14, 49, 14, 63, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveArrowFunctionReturnType = { { 1027 /* resolveArrowFunctionReturnType */, 5, 64, 5, 69, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig deriveOnlyNeverExecutionEnds = { { 1058 /* deriveOnlyNeverExecutionEnds */, 1, 70, 1, 71, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig buildDeclaredParameters = { { 1087 /* buildDeclaredParameters */, 2, 72, 2, 74, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getDeclaredClosureType = { { 1111 /* getDeclaredClosureType */, 2, 75, 2, 77, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig buildParametersAndAcceptors = { { 1134 /* buildParametersAndAcceptors */, 5, 78, 5, 83, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig createClosureTypeFromCache = { { 1180 /* createClosureTypeFromCache */, 6, 84, 6, 90, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig assembleClosureType = { { 1232 /* assembleClosureType */, 11, 91, 11, 102, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::ClosureTypeResolver diff --git a/turbo-ext/src/generated/ConditionalExpressionHolderHelper.h b/turbo-ext/src/generated/ConditionalExpressionHolderHelper.h index 6fd4e915fe9..60d21979bfe 100644 --- a/turbo-ext/src/generated/ConditionalExpressionHolderHelper.h +++ b/turbo-ext/src/generated/ConditionalExpressionHolderHelper.h @@ -50,14 +50,13 @@ inline constexpr char strings[] = "nonVariableTargetScope\0" /* 445 */ "holderSideExpr\0" /* 468 */ "PhpParser\\Node\\Expr\0" /* 483 */ - "null\0" /* 503 */ - "PHPStan\\Analyser\\ConditionalExpressionHolderRecipe\0" /* 508 */ - "buildConditionalHolderRecipe\0" /* 559 */ - "expr\0" /* 588 */ - "PHPStan\\Analyser\\ExpressionResult\0" /* 593 */ - "findConditionResult\0" /* 627 */ - "isUnsplittableCompoundHolderSide\0" /* 647 */ - "isTrackableExpression"; /* 680 */ + "PHPStan\\Analyser\\ConditionalExpressionHolderRecipe\0" /* 503 */ + "buildConditionalHolderRecipe\0" /* 554 */ + "expr\0" /* 583 */ + "PHPStan\\Analyser\\ExpressionResult\0" /* 588 */ + "findConditionResult\0" /* 622 */ + "isUnsplittableCompoundHolderSide\0" /* 642 */ + "isTrackableExpression"; /* 675 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 23), /* __construct $defaultNarrowingHelper */ reg::packed(94, 0, 112), /* buildBranchUnionAugment $nodeScopeResolver */ @@ -73,15 +72,15 @@ inline constexpr reg::PackedArg args[] = { reg::packed(404, MAY_BE_BOOL), /* buildConditionalHolderRecipe $holdersFromSureTypes */ reg::packed(425, MAY_BE_BOOL), /* buildConditionalHolderRecipe $holderSideIsNegated */ reg::packed(445, MAY_BE_NULL, 328), /* buildConditionalHolderRecipe $nonVariableTargetScope */ - reg::packed(468, MAY_BE_NULL, 483, false, false, 503), /* buildConditionalHolderRecipe $holderSideExpr */ - reg::packed(243, MAY_BE_NULL, 508), /* buildConditionalHolderRecipe return */ + reg::packed(468, MAY_BE_NULL, 483), /* buildConditionalHolderRecipe $holderSideExpr */ + reg::packed(243, MAY_BE_NULL, 503), /* buildConditionalHolderRecipe return */ reg::packed(315, 0, 328), /* findConditionResult $composeScope */ - reg::packed(588, 0, 483), /* findConditionResult $expr */ - reg::packed(243, MAY_BE_NULL, 593), /* findConditionResult return */ + reg::packed(583, 0, 483), /* findConditionResult $expr */ + reg::packed(243, MAY_BE_NULL, 588), /* findConditionResult return */ reg::packed(468, MAY_BE_NULL, 483), /* isUnsplittableCompoundHolderSide $holderSideExpr */ reg::packed(425, MAY_BE_BOOL), /* isUnsplittableCompoundHolderSide $holderSideIsNegated */ reg::packed(243, MAY_BE_BOOL), /* isUnsplittableCompoundHolderSide return */ - reg::packed(588, 0, 483), /* isTrackableExpression $expr */ + reg::packed(583, 0, 483), /* isTrackableExpression $expr */ reg::packed(243, MAY_BE_BOOL), /* isTrackableExpression return */ }; using Sig = reg::Sig; @@ -91,10 +90,10 @@ using Sig = reg::Sig; namespace sig { inline constexpr sigtab::Sig __construct = { { 82 /* __construct */, 1, 0, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig buildBranchUnionAugment = { { 291 /* buildBranchUnionAugment */, 6, 1, 6, 7, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig buildConditionalHolderRecipe = { { 559 /* buildConditionalHolderRecipe */, 6, 8, 7, 15, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig findConditionResult = { { 627 /* findConditionResult */, 2, 16, 2, 18, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isUnsplittableCompoundHolderSide = { { 647 /* isUnsplittableCompoundHolderSide */, 2, 19, 2, 21, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isTrackableExpression = { { 680 /* isTrackableExpression */, 1, 22, 1, 23, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig buildConditionalHolderRecipe = { { 554 /* buildConditionalHolderRecipe */, 7, 8, 7, 15, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig findConditionResult = { { 622 /* findConditionResult */, 2, 16, 2, 18, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isUnsplittableCompoundHolderSide = { { 642 /* isUnsplittableCompoundHolderSide */, 2, 19, 2, 21, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isTrackableExpression = { { 675 /* isTrackableExpression */, 1, 22, 1, 23, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::ConditionalExpressionHolderHelper diff --git a/turbo-ext/src/generated/DefaultNarrowingHelper.h b/turbo-ext/src/generated/DefaultNarrowingHelper.h index 9195cda010e..fc344a270a3 100644 --- a/turbo-ext/src/generated/DefaultNarrowingHelper.h +++ b/turbo-ext/src/generated/DefaultNarrowingHelper.h @@ -74,34 +74,33 @@ inline constexpr char strings[] = "createFirstNullsafeReceiverTypes\0" /* 776 */ "resultFor\0" /* 809 */ "Closure\0" /* 819 */ - "null\0" /* 827 */ - "createForSubject\0" /* 832 */ - "storage\0" /* 849 */ - "PHPStan\\Analyser\\ExpressionResultStorage\0" /* 857 */ - "chainResults\0" /* 898 */ - "captureChainResults\0" /* 911 */ - "buildChainTypeReader\0" /* 931 */ - "issetExpr\0" /* 952 */ - "readType\0" /* 962 */ - "rootExpr\0" /* 971 */ - "createIssetTruthyChainTypes\0" /* 980 */ - "varResult\0" /* 1008 */ - "createIssetSingleSubjectNonTrueTypes\0" /* 1018 */ - "call\0" /* 1055 */ - "PhpParser\\Node\\Expr\\CallLike\0" /* 1060 */ - "assertions\0" /* 1089 */ - "PHPStan\\Reflection\\Assertions\0" /* 1100 */ - "parametersAcceptor\0" /* 1130 */ - "PHPStan\\Reflection\\ParametersAcceptor\0" /* 1149 */ - "specifyTypesFromAsserts\0" /* 1187 */ - "specifyTypesFromConditionalReturnType\0" /* 1211 */ - "conditionalType\0" /* 1249 */ - "PHPStan\\Type\\ConditionalTypeForParameter\0" /* 1265 */ - "leftType\0" /* 1306 */ - "rightType\0" /* 1315 */ - "argumentExpr\0" /* 1325 */ - "getConditionalSpecifiedTypes\0" /* 1338 */ - "mayRememberCallSubject"; /* 1367 */ + "createForSubject\0" /* 827 */ + "storage\0" /* 844 */ + "PHPStan\\Analyser\\ExpressionResultStorage\0" /* 852 */ + "chainResults\0" /* 893 */ + "captureChainResults\0" /* 906 */ + "buildChainTypeReader\0" /* 926 */ + "issetExpr\0" /* 947 */ + "readType\0" /* 957 */ + "rootExpr\0" /* 966 */ + "createIssetTruthyChainTypes\0" /* 975 */ + "varResult\0" /* 1003 */ + "createIssetSingleSubjectNonTrueTypes\0" /* 1013 */ + "call\0" /* 1050 */ + "PhpParser\\Node\\Expr\\CallLike\0" /* 1055 */ + "assertions\0" /* 1084 */ + "PHPStan\\Reflection\\Assertions\0" /* 1095 */ + "parametersAcceptor\0" /* 1125 */ + "PHPStan\\Reflection\\ParametersAcceptor\0" /* 1144 */ + "specifyTypesFromAsserts\0" /* 1182 */ + "specifyTypesFromConditionalReturnType\0" /* 1206 */ + "conditionalType\0" /* 1244 */ + "PHPStan\\Type\\ConditionalTypeForParameter\0" /* 1260 */ + "leftType\0" /* 1301 */ + "rightType\0" /* 1310 */ + "argumentExpr\0" /* 1320 */ + "getConditionalSpecifiedTypes\0" /* 1333 */ + "mayRememberCallSubject"; /* 1362 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 12), /* __construct $exprPrinter */ reg::packed(45, MAY_BE_BOOL), /* __construct $rememberPossiblyImpureFunctionValues */ @@ -163,44 +162,44 @@ inline constexpr reg::PackedArg args[] = { reg::packed(521, 0, 526), /* createForSubject $type */ reg::packed(205, 0, 213), /* createForSubject $context */ reg::packed(151, 0, 157), /* createForSubject $scope */ - reg::packed(809, MAY_BE_NULL, 819, false, false, 827), /* createForSubject $resultFor */ + reg::packed(809, MAY_BE_NULL, 819), /* createForSubject $resultFor */ reg::packed(251, 0, 252), /* createForSubject return */ reg::packed(180, 0, 185), /* captureChainResults $node */ - reg::packed(849, 0, 857), /* captureChainResults $storage */ - reg::packed(898, MAY_BE_ARRAY, reg::NoString, true, false), /* captureChainResults $chainResults */ + reg::packed(844, 0, 852), /* captureChainResults $storage */ + reg::packed(893, MAY_BE_ARRAY, reg::NoString, true, false), /* captureChainResults $chainResults */ reg::packed(251, MAY_BE_VOID), /* captureChainResults return */ - reg::packed(898, MAY_BE_ARRAY), /* buildChainTypeReader $chainResults */ + reg::packed(893, MAY_BE_ARRAY), /* buildChainTypeReader $chainResults */ reg::packed(374, 0, 376), /* buildChainTypeReader $s */ reg::packed(251, 0, 819), /* buildChainTypeReader return */ reg::packed(374, 0, 376), /* createIssetTruthyChainTypes $s */ - reg::packed(952, 0, 185), /* createIssetTruthyChainTypes $issetExpr */ - reg::packed(962, 0, 819), /* createIssetTruthyChainTypes $readType */ - reg::packed(971, 0, 185), /* createIssetTruthyChainTypes $rootExpr */ + reg::packed(947, 0, 185), /* createIssetTruthyChainTypes $issetExpr */ + reg::packed(957, 0, 819), /* createIssetTruthyChainTypes $readType */ + reg::packed(966, 0, 185), /* createIssetTruthyChainTypes $rootExpr */ reg::packed(205, 0, 213), /* createIssetTruthyChainTypes $context */ reg::packed(251, 0, 252), /* createIssetTruthyChainTypes return */ reg::packed(374, 0, 376), /* createIssetSingleSubjectNonTrueTypes $s */ - reg::packed(952, 0, 185), /* createIssetSingleSubjectNonTrueTypes $issetExpr */ - reg::packed(1008, 0, 340), /* createIssetSingleSubjectNonTrueTypes $varResult */ - reg::packed(962, MAY_BE_CALLABLE), /* createIssetSingleSubjectNonTrueTypes $readType */ + reg::packed(947, 0, 185), /* createIssetSingleSubjectNonTrueTypes $issetExpr */ + reg::packed(1003, 0, 340), /* createIssetSingleSubjectNonTrueTypes $varResult */ + reg::packed(957, MAY_BE_CALLABLE), /* createIssetSingleSubjectNonTrueTypes $readType */ reg::packed(205, 0, 213), /* createIssetSingleSubjectNonTrueTypes $context */ - reg::packed(971, 0, 185), /* createIssetSingleSubjectNonTrueTypes $rootExpr */ + reg::packed(966, 0, 185), /* createIssetSingleSubjectNonTrueTypes $rootExpr */ reg::packed(251, 0, 252), /* createIssetSingleSubjectNonTrueTypes return */ reg::packed(205, 0, 213), /* specifyTypesFromAsserts $context */ - reg::packed(1055, 0, 1060), /* specifyTypesFromAsserts $call */ - reg::packed(1089, 0, 1100), /* specifyTypesFromAsserts $assertions */ - reg::packed(1130, 0, 1149), /* specifyTypesFromAsserts $parametersAcceptor */ + reg::packed(1050, 0, 1055), /* specifyTypesFromAsserts $call */ + reg::packed(1084, 0, 1095), /* specifyTypesFromAsserts $assertions */ + reg::packed(1125, 0, 1144), /* specifyTypesFromAsserts $parametersAcceptor */ reg::packed(151, 0, 376), /* specifyTypesFromAsserts $scope */ reg::packed(251, MAY_BE_NULL, 252), /* specifyTypesFromAsserts return */ reg::packed(205, 0, 213), /* specifyTypesFromConditionalReturnType $context */ - reg::packed(1055, 0, 1060), /* specifyTypesFromConditionalReturnType $call */ - reg::packed(1130, 0, 1149), /* specifyTypesFromConditionalReturnType $parametersAcceptor */ + reg::packed(1050, 0, 1055), /* specifyTypesFromConditionalReturnType $call */ + reg::packed(1125, 0, 1144), /* specifyTypesFromConditionalReturnType $parametersAcceptor */ reg::packed(151, 0, 376), /* specifyTypesFromConditionalReturnType $scope */ reg::packed(251, MAY_BE_NULL, 252), /* specifyTypesFromConditionalReturnType return */ - reg::packed(1249, 0, 1265), /* getConditionalSpecifiedTypes $conditionalType */ - reg::packed(1306, 0, 526), /* getConditionalSpecifiedTypes $leftType */ - reg::packed(1315, 0, 526), /* getConditionalSpecifiedTypes $rightType */ + reg::packed(1244, 0, 1260), /* getConditionalSpecifiedTypes $conditionalType */ + reg::packed(1301, 0, 526), /* getConditionalSpecifiedTypes $leftType */ + reg::packed(1310, 0, 526), /* getConditionalSpecifiedTypes $rightType */ reg::packed(151, 0, 376), /* getConditionalSpecifiedTypes $scope */ - reg::packed(1325, 0, 185), /* getConditionalSpecifiedTypes $argumentExpr */ + reg::packed(1320, 0, 185), /* getConditionalSpecifiedTypes $argumentExpr */ reg::packed(251, MAY_BE_NULL, 252), /* getConditionalSpecifiedTypes return */ reg::packed(151, 0, 376), /* mayRememberCallSubject $scope */ reg::packed(304, 0, 185), /* mayRememberCallSubject $expr */ @@ -224,15 +223,15 @@ inline constexpr sigtab::Sig createNullsafeReceiverOnlyTypes = { { 664 /* create inline constexpr sigtab::Sig callMayHaveBeenSkipped = { { 724 /* callMayHaveBeenSkipped */, 3, 44, 3, 47, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig nullsafeShortCircuitRuledOut = { { 747 /* nullsafeShortCircuitRuledOut */, 4, 48, 4, 52, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig createFirstNullsafeReceiverTypes = { { 776 /* createFirstNullsafeReceiverTypes */, 2, 53, 2, 55, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig createForSubject = { { 832 /* createForSubject */, 4, 56, 5, 61, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig captureChainResults = { { 911 /* captureChainResults */, 3, 62, 3, 65, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig buildChainTypeReader = { { 931 /* buildChainTypeReader */, 2, 66, 2, 68, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig createIssetTruthyChainTypes = { { 980 /* createIssetTruthyChainTypes */, 5, 69, 5, 74, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig createIssetSingleSubjectNonTrueTypes = { { 1018 /* createIssetSingleSubjectNonTrueTypes */, 6, 75, 6, 81, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig specifyTypesFromAsserts = { { 1187 /* specifyTypesFromAsserts */, 5, 82, 5, 87, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig specifyTypesFromConditionalReturnType = { { 1211 /* specifyTypesFromConditionalReturnType */, 4, 88, 4, 92, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConditionalSpecifiedTypes = { { 1338 /* getConditionalSpecifiedTypes */, 5, 93, 5, 98, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig mayRememberCallSubject = { { 1367 /* mayRememberCallSubject */, 2, 99, 2, 101, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig createForSubject = { { 827 /* createForSubject */, 5, 56, 5, 61, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig captureChainResults = { { 906 /* captureChainResults */, 3, 62, 3, 65, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig buildChainTypeReader = { { 926 /* buildChainTypeReader */, 2, 66, 2, 68, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig createIssetTruthyChainTypes = { { 975 /* createIssetTruthyChainTypes */, 5, 69, 5, 74, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig createIssetSingleSubjectNonTrueTypes = { { 1013 /* createIssetSingleSubjectNonTrueTypes */, 6, 75, 6, 81, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig specifyTypesFromAsserts = { { 1182 /* specifyTypesFromAsserts */, 5, 82, 5, 87, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig specifyTypesFromConditionalReturnType = { { 1206 /* specifyTypesFromConditionalReturnType */, 4, 88, 4, 92, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConditionalSpecifiedTypes = { { 1333 /* getConditionalSpecifiedTypes */, 5, 93, 5, 98, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig mayRememberCallSubject = { { 1362 /* mayRememberCallSubject */, 2, 99, 2, 101, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::DefaultNarrowingHelper diff --git a/turbo-ext/src/generated/Dependencies.h b/turbo-ext/src/generated/Dependencies.h index 8841a3b0de7..bc0a6b0d7c2 100644 --- a/turbo-ext/src/generated/Dependencies.h +++ b/turbo-ext/src/generated/Dependencies.h @@ -47,14 +47,13 @@ inline constexpr char strings[] = "usedTraits\0" /* 44 */ "merged\0" /* 55 */ "__construct\0" /* 62 */ - "[]\0" /* 74 */ - "\0" /* 77 */ - "PHPStan\\Dependency\\Dependencies\0" /* 78 */ - "create\0" /* 110 */ - "dependencies\0" /* 117 */ - "merge\0" /* 130 */ - "callback\0" /* 136 */ - "walk"; /* 145 */ + "\0" /* 74 */ + "PHPStan\\Dependency\\Dependencies\0" /* 75 */ + "create\0" /* 107 */ + "dependencies\0" /* 114 */ + "merge\0" /* 127 */ + "callback\0" /* 133 */ + "walk"; /* 142 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $file */ reg::packed(5, MAY_BE_ARRAY), /* __construct $types */ @@ -64,16 +63,16 @@ inline constexpr reg::PackedArg args[] = { reg::packed(44, MAY_BE_ARRAY), /* __construct $usedTraits */ reg::packed(55, MAY_BE_ARRAY), /* __construct $merged */ reg::packed(0, MAY_BE_STRING), /* create $file */ - reg::packed(5, MAY_BE_ARRAY, reg::NoString, false, false, 74), /* create $types */ - reg::packed(11, MAY_BE_ARRAY, reg::NoString, false, false, 74), /* create $classNames */ - reg::packed(22, MAY_BE_ARRAY, reg::NoString, false, false, 74), /* create $reflections */ - reg::packed(34, MAY_BE_ARRAY, reg::NoString, false, false, 74), /* create $filePaths */ - reg::packed(44, MAY_BE_ARRAY, reg::NoString, false, false, 74), /* create $usedTraits */ - reg::packed(77, MAY_BE_NULL, 78), /* create return */ - reg::packed(117, MAY_BE_NULL, 78, false, true), /* merge $dependencies */ - reg::packed(77, MAY_BE_NULL, 78), /* merge return */ - reg::packed(136, MAY_BE_CALLABLE), /* walk $callback */ - reg::packed(77, MAY_BE_VOID), /* walk return */ + reg::packed(5, MAY_BE_ARRAY), /* create $types */ + reg::packed(11, MAY_BE_ARRAY), /* create $classNames */ + reg::packed(22, MAY_BE_ARRAY), /* create $reflections */ + reg::packed(34, MAY_BE_ARRAY), /* create $filePaths */ + reg::packed(44, MAY_BE_ARRAY), /* create $usedTraits */ + reg::packed(74, MAY_BE_NULL, 75), /* create return */ + reg::packed(114, MAY_BE_NULL, 75, false, true), /* merge $dependencies */ + reg::packed(74, MAY_BE_NULL, 75), /* merge return */ + reg::packed(133, MAY_BE_CALLABLE), /* walk $callback */ + reg::packed(74, MAY_BE_VOID), /* walk return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -81,9 +80,9 @@ using Sig = reg::Sig; /* 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 = { { 62 /* __construct */, 7, 0, 7, reg::NoArg, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig create = { { 110 /* create */, 1, 7, 6, 13, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig merge = { { 130 /* merge */, 0, 14, 1, 15, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig walk = { { 145 /* walk */, 1, 16, 1, 17, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig create = { { 107 /* create */, 6, 7, 6, 13, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig merge = { { 127 /* merge */, 0, 14, 1, 15, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig walk = { { 142 /* walk */, 1, 16, 1, 17, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::Dependencies diff --git a/turbo-ext/src/generated/ExpressionContext.h b/turbo-ext/src/generated/ExpressionContext.h index a82c2c2ee06..56e7edbfad1 100644 --- a/turbo-ext/src/generated/ExpressionContext.h +++ b/turbo-ext/src/generated/ExpressionContext.h @@ -134,9 +134,9 @@ inline constexpr reg::PackedArg args[] = { reg::packed(308, MAY_BE_NULL, 115, false, false, 133), /* __construct $passedToType */ reg::packed(321, MAY_BE_NULL, 115, false, false, 133), /* __construct $nativePassedToType */ reg::packed(340, MAY_BE_NULL, 361, false, false, 133), /* __construct $passedToTypeResolver */ - reg::packed(166, MAY_BE_BOOL, reg::NoString, false, false, 191), /* createTopLevel $resolveTemplateArguments */ + reg::packed(166, MAY_BE_BOOL), /* createTopLevel $resolveTemplateArguments */ reg::packed(381, 0, 382), /* createTopLevel return */ - reg::packed(166, MAY_BE_BOOL, reg::NoString, false, false, 191), /* createDeep $resolveTemplateArguments */ + reg::packed(166, MAY_BE_BOOL), /* createDeep $resolveTemplateArguments */ reg::packed(381, 0, 382), /* createDeep return */ reg::packed(381, 0, 382), /* enterDeep return */ reg::packed(381, 0, 382), /* enterDeepKeepingValueFlow return */ @@ -181,8 +181,8 @@ using Sig = reg::Sig; /* 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 = { { 369 /* __construct */, 3, 0, 15, reg::NoArg, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig createTopLevel = { { 417 /* createTopLevel */, 0, 15, 1, 16, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig createDeep = { { 432 /* createDeep */, 0, 17, 1, 18, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig createTopLevel = { { 417 /* createTopLevel */, 1, 15, 1, 16, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig createDeep = { { 432 /* createDeep */, 1, 17, 1, 18, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig enterDeep = { { 443 /* enterDeep */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig enterDeepKeepingValueFlow = { { 453 /* enterDeepKeepingValueFlow */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig withoutValueFlow = { { 479 /* withoutValueFlow */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; diff --git a/turbo-ext/src/generated/ExpressionResult.h b/turbo-ext/src/generated/ExpressionResult.h index f0971a044d6..3207a0ba883 100644 --- a/turbo-ext/src/generated/ExpressionResult.h +++ b/turbo-ext/src/generated/ExpressionResult.h @@ -105,25 +105,25 @@ inline constexpr char strings[] = "typeCallback\0" /* 292 */ "specifyTypesCallback\0" /* 305 */ "containsNullsafe\0" /* 326 */ - "false\0" /* 343 */ - "issetabilityDescriptor\0" /* 349 */ - "PHPStan\\Analyser\\IssetabilityDescriptor\0" /* 372 */ - "null\0" /* 412 */ - "truthyScopeOverrideResult\0" /* 417 */ - "PHPStan\\Analyser\\ExpressionResult\0" /* 443 */ - "falseyScopeOverrideResult\0" /* 477 */ - "createTypesCallback\0" /* 503 */ - "type\0" /* 523 */ - "PHPStan\\Type\\Type\0" /* 528 */ - "nativeType\0" /* 546 */ - "argsResult\0" /* 557 */ - "PHPStan\\Analyser\\ArgsResult\0" /* 568 */ - "variableFlow\0" /* 596 */ - "PHPStan\\Analyser\\VariableFlow\0" /* 609 */ - "specifiedTypes\0" /* 639 */ - "[]\0" /* 654 */ - "cachedType\0" /* 657 */ - "extensionsDeclined\0" /* 668 */ + "issetabilityDescriptor\0" /* 343 */ + "PHPStan\\Analyser\\IssetabilityDescriptor\0" /* 366 */ + "truthyScopeOverrideResult\0" /* 406 */ + "PHPStan\\Analyser\\ExpressionResult\0" /* 432 */ + "falseyScopeOverrideResult\0" /* 466 */ + "createTypesCallback\0" /* 492 */ + "type\0" /* 512 */ + "PHPStan\\Type\\Type\0" /* 517 */ + "nativeType\0" /* 535 */ + "argsResult\0" /* 546 */ + "PHPStan\\Analyser\\ArgsResult\0" /* 557 */ + "variableFlow\0" /* 585 */ + "PHPStan\\Analyser\\VariableFlow\0" /* 598 */ + "specifiedTypes\0" /* 628 */ + "[]\0" /* 643 */ + "cachedType\0" /* 646 */ + "null\0" /* 657 */ + "extensionsDeclined\0" /* 662 */ + "false\0" /* 681 */ "cachedNativeType\0" /* 687 */ "resolvedType\0" /* 704 */ "resolvedNativeType\0" /* 717 */ @@ -197,73 +197,73 @@ inline constexpr reg::PackedArg args[] = { reg::packed(279, MAY_BE_ARRAY), /* __construct $impurePoints */ reg::packed(292, MAY_BE_NULL | MAY_BE_CALLABLE), /* __construct $typeCallback */ reg::packed(305, MAY_BE_CALLABLE), /* __construct $specifyTypesCallback */ - reg::packed(326, MAY_BE_BOOL, reg::NoString, false, false, 343), /* __construct $containsNullsafe */ - reg::packed(349, MAY_BE_NULL, 372, false, false, 412), /* __construct $issetabilityDescriptor */ - reg::packed(417, MAY_BE_NULL, 443, false, false, 412), /* __construct $truthyScopeOverrideResult */ - reg::packed(477, MAY_BE_NULL, 443, false, false, 412), /* __construct $falseyScopeOverrideResult */ - reg::packed(503, MAY_BE_NULL | MAY_BE_CALLABLE, reg::NoString, false, false, 412), /* __construct $createTypesCallback */ - reg::packed(523, MAY_BE_NULL, 528, false, false, 412), /* __construct $type */ - reg::packed(546, MAY_BE_NULL, 528, false, false, 412), /* __construct $nativeType */ - reg::packed(557, MAY_BE_NULL, 568, false, false, 412), /* __construct $argsResult */ - reg::packed(596, MAY_BE_NULL, 609, false, false, 412), /* __construct $variableFlow */ - reg::packed(639, MAY_BE_ARRAY, reg::NoString, false, false, 654), /* __construct $specifiedTypes */ - reg::packed(657, MAY_BE_NULL, 528, false, false, 412), /* __construct $cachedType */ - reg::packed(668, MAY_BE_BOOL, reg::NoString, false, false, 343), /* __construct $extensionsDeclined */ - reg::packed(687, MAY_BE_NULL, 528, false, false, 412), /* __construct $cachedNativeType */ - reg::packed(704, MAY_BE_NULL, 528, false, false, 412), /* __construct $resolvedType */ - reg::packed(717, MAY_BE_NULL, 528, false, false, 412), /* __construct $resolvedNativeType */ - reg::packed(736, MAY_BE_NULL, 528, false, false, 412), /* __construct $projectedType */ - reg::packed(750, MAY_BE_NULL, 528, false, false, 412), /* __construct $projectedNativeType */ - reg::packed(770, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 412), /* __construct $readVariableNames */ - reg::packed(788, MAY_BE_NULL, 801, false, false, 412), /* __construct $dependencies */ + reg::packed(326, MAY_BE_BOOL), /* __construct $containsNullsafe */ + reg::packed(343, MAY_BE_NULL, 366), /* __construct $issetabilityDescriptor */ + reg::packed(406, MAY_BE_NULL, 432), /* __construct $truthyScopeOverrideResult */ + reg::packed(466, MAY_BE_NULL, 432), /* __construct $falseyScopeOverrideResult */ + reg::packed(492, MAY_BE_NULL | MAY_BE_CALLABLE), /* __construct $createTypesCallback */ + reg::packed(512, MAY_BE_NULL, 517), /* __construct $type */ + reg::packed(535, MAY_BE_NULL, 517), /* __construct $nativeType */ + reg::packed(546, MAY_BE_NULL, 557), /* __construct $argsResult */ + reg::packed(585, MAY_BE_NULL, 598), /* __construct $variableFlow */ + reg::packed(628, MAY_BE_ARRAY, reg::NoString, false, false, 643), /* __construct $specifiedTypes */ + reg::packed(646, MAY_BE_NULL, 517, false, false, 657), /* __construct $cachedType */ + reg::packed(662, MAY_BE_BOOL, reg::NoString, false, false, 681), /* __construct $extensionsDeclined */ + reg::packed(687, MAY_BE_NULL, 517, false, false, 657), /* __construct $cachedNativeType */ + reg::packed(704, MAY_BE_NULL, 517, false, false, 657), /* __construct $resolvedType */ + reg::packed(717, MAY_BE_NULL, 517, false, false, 657), /* __construct $resolvedNativeType */ + reg::packed(736, MAY_BE_NULL, 517, false, false, 657), /* __construct $projectedType */ + reg::packed(750, MAY_BE_NULL, 517, false, false, 657), /* __construct $projectedNativeType */ + reg::packed(770, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 657), /* __construct $readVariableNames */ + reg::packed(788, MAY_BE_NULL, 801, false, false, 657), /* __construct $dependencies */ reg::packed(164, 0, 170), /* finalize $scope */ reg::packed(238, MAY_BE_BOOL), /* finalize $hasYield */ reg::packed(247, MAY_BE_BOOL), /* finalize $isAlwaysTerminating */ reg::packed(267, MAY_BE_ARRAY), /* finalize $throwPoints */ reg::packed(279, MAY_BE_ARRAY), /* finalize $impurePoints */ - reg::packed(596, MAY_BE_NULL, 609), /* finalize $variableFlow */ + reg::packed(585, MAY_BE_NULL, 598), /* finalize $variableFlow */ reg::packed(788, MAY_BE_NULL, 801), /* finalize $dependencies */ - reg::packed(845, 0, 443), /* finalize return */ + reg::packed(845, 0, 432), /* finalize return */ reg::packed(845, 0, 170), /* getScope return */ - reg::packed(845, MAY_BE_NULL, 609), /* getVariableFlow return */ + reg::packed(845, MAY_BE_NULL, 598), /* getVariableFlow return */ reg::packed(164, 0, 170), /* withScope $scope */ - reg::packed(845, 0, 443), /* withScope return */ + reg::packed(845, 0, 432), /* withScope return */ reg::packed(845, MAY_BE_NULL, 801), /* getDependencies return */ reg::packed(788, MAY_BE_NULL, 801), /* withDependencies $dependencies */ - reg::packed(845, 0, 443), /* withDependencies return */ + reg::packed(845, 0, 432), /* withDependencies return */ reg::packed(845, 0, 170), /* getBeforeScope return */ reg::packed(845, 0, 218), /* getExpr return */ - reg::packed(845, MAY_BE_NULL, 568), /* getArgsResult return */ + reg::packed(845, MAY_BE_NULL, 557), /* getArgsResult return */ reg::packed(845, MAY_BE_BOOL), /* hasYield return */ reg::packed(845, MAY_BE_BOOL), /* containsNullsafe return */ reg::packed(164, 0, 170), /* getIssetabilityResolution $scope */ reg::packed(960, MAY_BE_BOOL), /* getIssetabilityResolution $useNativeTypes */ - reg::packed(975, MAY_BE_BOOL, reg::NoString, false, false, 343), /* getIssetabilityResolution $reprocessUntrackedLinks */ + reg::packed(975, MAY_BE_BOOL), /* getIssetabilityResolution $reprocessUntrackedLinks */ reg::packed(845, 0, 999), /* getIssetabilityResolution return */ reg::packed(845, MAY_BE_ARRAY), /* getThrowPoints return */ reg::packed(845, MAY_BE_ARRAY), /* getImpurePoints return */ reg::packed(845, 0, 170), /* getTruthyScope return */ reg::packed(845, 0, 170), /* getFalseyScope return */ - reg::packed(639, 0, 1126), /* withEqualityCheckResult $specifiedTypes */ + reg::packed(628, 0, 1126), /* withEqualityCheckResult $specifiedTypes */ reg::packed(1158, MAY_BE_BOOL), /* withEqualityCheckResult $value */ reg::packed(845, 0, 1126), /* withEqualityCheckResult return */ reg::packed(845, MAY_BE_BOOL), /* isAlwaysTerminating return */ - reg::packed(845, 0, 528), /* getType return */ - reg::packed(845, 0, 528), /* getNativeType return */ + reg::packed(845, 0, 517), /* getType return */ + reg::packed(845, 0, 517), /* getNativeType return */ reg::packed(1210, 0, 170), /* consultExpressionTypeResolverExtensions $readScope */ - reg::packed(845, MAY_BE_NULL, 528), /* consultExpressionTypeResolverExtensions return */ + reg::packed(845, MAY_BE_NULL, 517), /* consultExpressionTypeResolverExtensions return */ reg::packed(1260, MAY_BE_BOOL), /* resolveOwnRawType $nativeTypesPromoted */ - reg::packed(845, 0, 528), /* resolveOwnRawType return */ + reg::packed(845, 0, 517), /* resolveOwnRawType return */ reg::packed(845, MAY_BE_VOID), /* releaseTypeCallbackIfResolved return */ reg::packed(1260, MAY_BE_BOOL), /* resolveOwnType $nativeTypesPromoted */ - reg::packed(845, 0, 528), /* resolveOwnType return */ - reg::packed(523, 0, 528), /* projectVoidToNull $type */ + reg::packed(845, 0, 517), /* resolveOwnType return */ + reg::packed(512, 0, 517), /* projectVoidToNull $type */ reg::packed(1260, MAY_BE_BOOL), /* projectVoidToNull $nativeTypesPromoted */ - reg::packed(845, 0, 528), /* projectVoidToNull return */ + reg::packed(845, 0, 517), /* projectVoidToNull return */ reg::packed(1260, MAY_BE_BOOL), /* projectsVoidToNull $nativeTypesPromoted */ reg::packed(845, MAY_BE_BOOL), /* projectsVoidToNull return */ reg::packed(1260, MAY_BE_BOOL), /* getKeepVoidType $nativeTypesPromoted */ - reg::packed(845, 0, 528), /* getKeepVoidType return */ + reg::packed(845, 0, 517), /* getKeepVoidType return */ reg::packed(164, 0, 170), /* hasTrackedExpressionType $scope */ reg::packed(845, MAY_BE_BOOL), /* hasTrackedExpressionType return */ reg::packed(845, MAY_BE_BOOL), /* canResolveOwnType return */ @@ -272,19 +272,19 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1460, 0, 1468), /* getSpecifiedTypesForScope $context */ reg::packed(845, 0, 1126), /* getSpecifiedTypesForScope return */ reg::packed(1460, 0, 1468), /* getSpecifiedTypes $context */ - reg::packed(1260, MAY_BE_BOOL, reg::NoString, false, false, 343), /* getSpecifiedTypes $nativeTypesPromoted */ + reg::packed(1260, MAY_BE_BOOL), /* getSpecifiedTypes $nativeTypesPromoted */ reg::packed(845, 0, 1126), /* getSpecifiedTypes return */ reg::packed(164, 0, 170), /* getCreatedTypesForScope $scope */ - reg::packed(523, 0, 528), /* getCreatedTypesForScope $type */ + reg::packed(512, 0, 517), /* getCreatedTypesForScope $type */ reg::packed(1460, 0, 1468), /* getCreatedTypesForScope $context */ reg::packed(845, MAY_BE_NULL, 1126), /* getCreatedTypesForScope return */ - reg::packed(523, 0, 528), /* getCreatedTypes $type */ + reg::packed(512, 0, 517), /* getCreatedTypes $type */ reg::packed(1460, 0, 1468), /* getCreatedTypes $context */ - reg::packed(1260, MAY_BE_BOOL, reg::NoString, false, false, 343), /* getCreatedTypes $nativeTypesPromoted */ + reg::packed(1260, MAY_BE_BOOL), /* getCreatedTypes $nativeTypesPromoted */ reg::packed(845, MAY_BE_NULL, 1126), /* getCreatedTypes return */ reg::packed(164, 0, 170), /* getTypeOnScope $scope */ reg::packed(960, MAY_BE_BOOL), /* getTypeOnScope $useNativeTypes */ - reg::packed(845, 0, 528), /* getTypeOnScope return */ + reg::packed(845, 0, 517), /* getTypeOnScope return */ reg::packed(164, 0, 170), /* answersOnScope $scope */ reg::packed(960, MAY_BE_BOOL), /* answersOnScope $useNativeTypes */ reg::packed(845, MAY_BE_BOOL), /* answersOnScope return */ @@ -292,13 +292,13 @@ inline constexpr reg::PackedArg args[] = { reg::packed(845, MAY_BE_BOOL), /* isScopeAuthoritative return */ reg::packed(164, 0, 170), /* askScopeVariableStateMatches $scope */ reg::packed(960, MAY_BE_BOOL), /* askScopeVariableStateMatches $useNativeTypes */ - reg::packed(1641, MAY_BE_BOOL, reg::NoString, false, false, 343), /* askScopeVariableStateMatches $ruleFacingAsk */ + reg::packed(1641, MAY_BE_BOOL), /* askScopeVariableStateMatches $ruleFacingAsk */ reg::packed(845, MAY_BE_BOOL), /* askScopeVariableStateMatches return */ reg::packed(164, 0, 170), /* atAskPosition $scope */ - reg::packed(845, 0, 443), /* atAskPosition return */ + reg::packed(845, 0, 432), /* atAskPosition return */ reg::packed(201, 0, 170), /* onNonNullabilityDevicedScopes $beforeScope */ reg::packed(164, 0, 170), /* onNonNullabilityDevicedScopes $scope */ - reg::packed(845, 0, 443), /* onNonNullabilityDevicedScopes return */ + reg::packed(845, 0, 432), /* onNonNullabilityDevicedScopes return */ reg::packed(845, MAY_BE_ARRAY), /* getReadVariableNames return */ reg::packed(1749, 0, 1754), /* collectReadVariableNames $node */ reg::packed(845, MAY_BE_ARRAY), /* collectReadVariableNames return */ @@ -308,7 +308,7 @@ using Sig = reg::Sig; /* 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 = { { 833 /* __construct */, 11, 0, 30, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 833 /* __construct */, 20, 0, 30, reg::NoArg, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig finalize = { { 846 /* finalize */, 7, 30, 7, 37, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getScope = { { 855 /* getScope */, 0, 38, 0, 38, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getVariableFlow = { { 864 /* getVariableFlow */, 0, 39, 0, 39, ZEND_ACC_PUBLIC } }; @@ -320,7 +320,7 @@ inline constexpr sigtab::Sig getExpr = { { 938 /* getExpr */, 0, 46, 0, 46, ZEND inline constexpr sigtab::Sig getArgsResult = { { 946 /* getArgsResult */, 0, 47, 0, 47, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig hasYield = { { 238 /* hasYield */, 0, 48, 0, 48, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig containsNullsafe = { { 326 /* containsNullsafe */, 0, 49, 0, 49, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getIssetabilityResolution = { { 1039 /* getIssetabilityResolution */, 2, 50, 3, 53, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getIssetabilityResolution = { { 1039 /* getIssetabilityResolution */, 3, 50, 3, 53, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getThrowPoints = { { 1065 /* getThrowPoints */, 0, 54, 0, 54, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getImpurePoints = { { 1080 /* getImpurePoints */, 0, 55, 0, 55, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getTruthyScope = { { 1096 /* getTruthyScope */, 0, 56, 0, 56, ZEND_ACC_PUBLIC } }; @@ -340,13 +340,13 @@ inline constexpr sigtab::Sig hasTrackedExpressionType = { { 1396 /* hasTrackedEx inline constexpr sigtab::Sig canResolveOwnType = { { 1421 /* canResolveOwnType */, 0, 80, 0, 80, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig hasOwnLazyResolution = { { 1439 /* hasOwnLazyResolution */, 0, 81, 0, 81, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig getSpecifiedTypesForScope = { { 1506 /* getSpecifiedTypesForScope */, 2, 82, 2, 84, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getSpecifiedTypes = { { 1532 /* getSpecifiedTypes */, 1, 85, 2, 87, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getSpecifiedTypes = { { 1532 /* getSpecifiedTypes */, 2, 85, 2, 87, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getCreatedTypesForScope = { { 1550 /* getCreatedTypesForScope */, 3, 88, 3, 91, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getCreatedTypes = { { 1574 /* getCreatedTypes */, 2, 92, 3, 95, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getCreatedTypes = { { 1574 /* getCreatedTypes */, 3, 92, 3, 95, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getTypeOnScope = { { 1590 /* getTypeOnScope */, 2, 96, 2, 98, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig answersOnScope = { { 1605 /* answersOnScope */, 2, 99, 2, 101, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig isScopeAuthoritative = { { 1620 /* isScopeAuthoritative */, 1, 102, 1, 103, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig askScopeVariableStateMatches = { { 1655 /* askScopeVariableStateMatches */, 2, 104, 3, 107, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig askScopeVariableStateMatches = { { 1655 /* askScopeVariableStateMatches */, 3, 104, 3, 107, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig atAskPosition = { { 1684 /* atAskPosition */, 1, 108, 1, 109, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig onNonNullabilityDevicedScopes = { { 1698 /* onNonNullabilityDevicedScopes */, 2, 110, 2, 112, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getReadVariableNames = { { 1728 /* getReadVariableNames */, 0, 113, 0, 113, ZEND_ACC_PRIVATE } }; diff --git a/turbo-ext/src/generated/FuncCallHandler.h b/turbo-ext/src/generated/FuncCallHandler.h index 023095f7f69..5d648d8b01b 100644 --- a/turbo-ext/src/generated/FuncCallHandler.h +++ b/turbo-ext/src/generated/FuncCallHandler.h @@ -144,20 +144,19 @@ inline constexpr char strings[] = "normalizedExpr\0" /* 2029 */ "resolvedParametersAcceptor\0" /* 2044 */ "PHPStan\\Analyser\\TypeSpecifierContext\0" /* 2071 */ - "null\0" /* 2109 */ - "PHPStan\\Analyser\\SpecifiedTypes\0" /* 2114 */ - "specifyTypes\0" /* 2146 */ - "specifyTypesFromCallableCall\0" /* 2159 */ - "defaultFuncCallNarrowing\0" /* 2188 */ - "isFuncCallNarrowable\0" /* 2213 */ - "normalizedNode\0" /* 2234 */ - "getDynamicFunctionReturnType\0" /* 2249 */ - "functionName\0" /* 2278 */ - "args\0" /* 2291 */ - "PHPStan\\Analyser\\VariableFlow\0" /* 2296 */ - "getCallVariableFlow\0" /* 2326 */ - "type\0" /* 2346 */ - "compactNames"; /* 2351 */ + "PHPStan\\Analyser\\SpecifiedTypes\0" /* 2109 */ + "specifyTypes\0" /* 2141 */ + "specifyTypesFromCallableCall\0" /* 2154 */ + "defaultFuncCallNarrowing\0" /* 2183 */ + "isFuncCallNarrowable\0" /* 2208 */ + "normalizedNode\0" /* 2229 */ + "getDynamicFunctionReturnType\0" /* 2244 */ + "functionName\0" /* 2273 */ + "args\0" /* 2286 */ + "PHPStan\\Analyser\\VariableFlow\0" /* 2291 */ + "getCallVariableFlow\0" /* 2321 */ + "type\0" /* 2341 */ + "compactNames"; /* 2346 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 19), /* __construct $reflectionProvider */ reg::packed(57, 0, 92), /* __construct $dynamicFunctionThrowTypeExtensions */ @@ -231,34 +230,34 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1855, MAY_BE_NULL, 1374), /* specifyTypes $nameResult */ reg::packed(2044, MAY_BE_NULL, 1693), /* specifyTypes $resolvedParametersAcceptor */ reg::packed(1331, 0, 2071), /* specifyTypes $context */ - reg::packed(1886, MAY_BE_NULL, 1897, false, false, 2109), /* specifyTypes $argsResult */ - reg::packed(1144, 0, 2114), /* specifyTypes return */ + reg::packed(1886, MAY_BE_NULL, 1897), /* specifyTypes $argsResult */ + reg::packed(1144, 0, 2109), /* specifyTypes return */ reg::packed(1331, 0, 2071), /* specifyTypesFromCallableCall $context */ reg::packed(1420, 0, 1425), /* specifyTypesFromCallableCall $call */ reg::packed(1855, MAY_BE_NULL, 1374), /* specifyTypesFromCallableCall $nameResult */ reg::packed(2044, MAY_BE_NULL, 1693), /* specifyTypesFromCallableCall $resolvedParametersAcceptor */ reg::packed(1232, 0, 1238), /* specifyTypesFromCallableCall $scope */ - reg::packed(1144, MAY_BE_NULL, 2114), /* specifyTypesFromCallableCall return */ + reg::packed(1144, MAY_BE_NULL, 2109), /* specifyTypesFromCallableCall return */ reg::packed(1232, 0, 1238), /* defaultFuncCallNarrowing $scope */ reg::packed(1119, 0, 1425), /* defaultFuncCallNarrowing $expr */ reg::packed(1855, MAY_BE_NULL, 1374), /* defaultFuncCallNarrowing $nameResult */ reg::packed(1331, 0, 2071), /* defaultFuncCallNarrowing $context */ - reg::packed(1144, 0, 2114), /* defaultFuncCallNarrowing return */ + reg::packed(1144, 0, 2109), /* defaultFuncCallNarrowing return */ reg::packed(1232, 0, 1238), /* isFuncCallNarrowable $scope */ reg::packed(1119, 0, 1425), /* isFuncCallNarrowable $expr */ reg::packed(1855, MAY_BE_NULL, 1374), /* isFuncCallNarrowable $nameResult */ reg::packed(1144, MAY_BE_BOOL), /* isFuncCallNarrowable return */ reg::packed(1232, 0, 1238), /* getDynamicFunctionReturnType $scope */ - reg::packed(2234, 0, 1425), /* getDynamicFunctionReturnType $normalizedNode */ + reg::packed(2229, 0, 1425), /* getDynamicFunctionReturnType $normalizedNode */ reg::packed(1617, 0, 1636), /* getDynamicFunctionReturnType $functionReflection */ reg::packed(1886, 0, 1897), /* getDynamicFunctionReturnType $argsResult */ reg::packed(1144, MAY_BE_NULL, 1465), /* getDynamicFunctionReturnType return */ - reg::packed(2278, MAY_BE_NULL | MAY_BE_STRING), /* getCallVariableFlow $functionName */ + reg::packed(2273, MAY_BE_NULL | MAY_BE_STRING), /* getCallVariableFlow $functionName */ reg::packed(1420, 0, 1425), /* getCallVariableFlow $call */ - reg::packed(2291, 0, 1897), /* getCallVariableFlow $args */ + reg::packed(2286, 0, 1897), /* getCallVariableFlow $args */ reg::packed(1232, 0, 1238), /* getCallVariableFlow $scope */ - reg::packed(1144, MAY_BE_NULL, 2296), /* getCallVariableFlow return */ - reg::packed(2346, 0, 1465), /* compactNames $type */ + reg::packed(1144, MAY_BE_NULL, 2291), /* getCallVariableFlow return */ + reg::packed(2341, 0, 1465), /* compactNames $type */ reg::packed(1144, MAY_BE_NULL | MAY_BE_ARRAY), /* compactNames return */ }; using Sig = reg::Sig; @@ -275,13 +274,13 @@ inline constexpr sigtab::Sig getFunctionThrowPoint = { { 1797 /* getFunctionThro inline constexpr sigtab::Sig resolveReturnType = { { 1925 /* resolveReturnType */, 7, 46, 7, 53, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig resolveInvokedClosureType = { { 1948 /* resolveInvokedClosureType */, 6, 54, 6, 60, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig getDependencies = { { 2013 /* getDependencies */, 4, 61, 4, 65, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig specifyTypes = { { 2146 /* specifyTypes */, 6, 66, 7, 73, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig specifyTypesFromCallableCall = { { 2159 /* specifyTypesFromCallableCall */, 5, 74, 5, 79, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig defaultFuncCallNarrowing = { { 2188 /* defaultFuncCallNarrowing */, 4, 80, 4, 84, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isFuncCallNarrowable = { { 2213 /* isFuncCallNarrowable */, 3, 85, 3, 88, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getDynamicFunctionReturnType = { { 2249 /* getDynamicFunctionReturnType */, 4, 89, 4, 93, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getCallVariableFlow = { { 2326 /* getCallVariableFlow */, 4, 94, 4, 98, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig compactNames = { { 2351 /* compactNames */, 1, 99, 1, 100, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig specifyTypes = { { 2141 /* specifyTypes */, 7, 66, 7, 73, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig specifyTypesFromCallableCall = { { 2154 /* specifyTypesFromCallableCall */, 5, 74, 5, 79, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig defaultFuncCallNarrowing = { { 2183 /* defaultFuncCallNarrowing */, 4, 80, 4, 84, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isFuncCallNarrowable = { { 2208 /* isFuncCallNarrowable */, 3, 85, 3, 88, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getDynamicFunctionReturnType = { { 2244 /* getDynamicFunctionReturnType */, 4, 89, 4, 93, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getCallVariableFlow = { { 2321 /* getCallVariableFlow */, 4, 94, 4, 98, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig compactNames = { { 2346 /* compactNames */, 1, 99, 1, 100, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; } // namespace sig } // namespace ptdecl::FuncCallHandler diff --git a/turbo-ext/src/generated/InitializerExprTypeResolver.h b/turbo-ext/src/generated/InitializerExprTypeResolver.h index 69ddbf4def1..22493d93f74 100644 --- a/turbo-ext/src/generated/InitializerExprTypeResolver.h +++ b/turbo-ext/src/generated/InitializerExprTypeResolver.h @@ -141,30 +141,29 @@ inline constexpr char strings[] = "constantName\0" /* 1880 */ "classReflection\0" /* 1893 */ "PHPStan\\Reflection\\ClassReflection\0" /* 1909 */ - "false\0" /* 1944 */ - "getClassConstFetchTypeByReflection\0" /* 1950 */ - "fetchedOnType\0" /* 1985 */ - "transformStaticType\0" /* 1999 */ - "getClassConstFetchType\0" /* 2019 */ - "getUnaryPlusType\0" /* 2042 */ - "getUnaryMinusType\0" /* 2059 */ - "getUnaryMinusTypeFromType\0" /* 2077 */ - "getBitwiseNotType\0" /* 2103 */ - "getBitwiseNotTypeFromType\0" /* 2121 */ - "name\0" /* 2147 */ - "PhpParser\\Node\\Name\0" /* 2152 */ - "resolveName\0" /* 2172 */ - "PHPStan\\Type\\TypeWithClassName\0" /* 2184 */ - "resolveTypeByName\0" /* 2215 */ - "classType\0" /* 2233 */ - "methodReflectionCandidate\0" /* 2243 */ - "PHPStan\\Reflection\\MethodReflection\0" /* 2269 */ - "resolveTypeByNameWithLateStaticBinding\0" /* 2305 */ - "toIntBound\0" /* 2344 */ - "getTypeFromValue\0" /* 2355 */ - "PHPStan\\Reflection\\ReflectionProvider\0" /* 2372 */ - "getReflectionProvider\0" /* 2410 */ - "getNeverType"; /* 2432 */ + "getClassConstFetchTypeByReflection\0" /* 1944 */ + "fetchedOnType\0" /* 1979 */ + "transformStaticType\0" /* 1993 */ + "getClassConstFetchType\0" /* 2013 */ + "getUnaryPlusType\0" /* 2036 */ + "getUnaryMinusType\0" /* 2053 */ + "getUnaryMinusTypeFromType\0" /* 2071 */ + "getBitwiseNotType\0" /* 2097 */ + "getBitwiseNotTypeFromType\0" /* 2115 */ + "name\0" /* 2141 */ + "PhpParser\\Node\\Name\0" /* 2146 */ + "resolveName\0" /* 2166 */ + "PHPStan\\Type\\TypeWithClassName\0" /* 2178 */ + "resolveTypeByName\0" /* 2209 */ + "classType\0" /* 2227 */ + "methodReflectionCandidate\0" /* 2237 */ + "PHPStan\\Reflection\\MethodReflection\0" /* 2263 */ + "resolveTypeByNameWithLateStaticBinding\0" /* 2299 */ + "toIntBound\0" /* 2338 */ + "getTypeFromValue\0" /* 2349 */ + "PHPStan\\Reflection\\ReflectionProvider\0" /* 2366 */ + "getReflectionProvider\0" /* 2404 */ + "getNeverType"; /* 2426 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 17), /* __construct $constantResolver */ reg::packed(51, 0, 78), /* __construct $reflectionProviderProvider */ @@ -310,10 +309,10 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1880, MAY_BE_STRING), /* getClassConstFetchTypeByReflection $constantName */ reg::packed(1893, MAY_BE_NULL, 1909), /* getClassConstFetchTypeByReflection $classReflection */ reg::packed(647, MAY_BE_CALLABLE), /* getClassConstFetchTypeByReflection $getTypeCallback */ - reg::packed(927, MAY_BE_BOOL, reg::NoString, false, false, 1944), /* getClassConstFetchTypeByReflection $nativeTypesPromoted */ + reg::packed(927, MAY_BE_BOOL), /* getClassConstFetchTypeByReflection $nativeTypesPromoted */ reg::packed(559, 0, 560), /* getClassConstFetchTypeByReflection return */ reg::packed(799, 0, 560), /* transformStaticType $type */ - reg::packed(1985, 0, 560), /* transformStaticType $fetchedOnType */ + reg::packed(1979, 0, 560), /* transformStaticType $fetchedOnType */ reg::packed(559, 0, 560), /* transformStaticType return */ reg::packed(1834, 0, 1840), /* getClassConstFetchType $class */ reg::packed(1880, MAY_BE_STRING), /* getClassConstFetchType $constantName */ @@ -334,21 +333,21 @@ inline constexpr reg::PackedArg args[] = { reg::packed(559, 0, 560), /* getBitwiseNotType return */ reg::packed(772, 0, 560), /* getBitwiseNotTypeFromType $exprType */ reg::packed(559, 0, 560), /* getBitwiseNotTypeFromType return */ - reg::packed(2147, 0, 2152), /* resolveName $name */ + reg::packed(2141, 0, 2146), /* resolveName $name */ reg::packed(1893, MAY_BE_NULL, 1909), /* resolveName $classReflection */ reg::packed(559, MAY_BE_STRING), /* resolveName return */ - reg::packed(2147, 0, 2152), /* resolveTypeByName $name */ + reg::packed(2141, 0, 2146), /* resolveTypeByName $name */ reg::packed(1893, MAY_BE_NULL, 1909), /* resolveTypeByName $classReflection */ - reg::packed(559, 0, 2184), /* resolveTypeByName return */ - reg::packed(1834, 0, 2152), /* resolveTypeByNameWithLateStaticBinding $class */ - reg::packed(2233, 0, 560), /* resolveTypeByNameWithLateStaticBinding $classType */ - reg::packed(2243, 0, 2269), /* resolveTypeByNameWithLateStaticBinding $methodReflectionCandidate */ + reg::packed(559, 0, 2178), /* resolveTypeByName return */ + reg::packed(1834, 0, 2146), /* resolveTypeByNameWithLateStaticBinding $class */ + reg::packed(2227, 0, 560), /* resolveTypeByNameWithLateStaticBinding $classType */ + reg::packed(2237, 0, 2263), /* resolveTypeByNameWithLateStaticBinding $methodReflectionCandidate */ reg::packed(559, 0, 560), /* resolveTypeByNameWithLateStaticBinding return */ reg::packed(1547, MAY_BE_DOUBLE), /* toIntBound $value */ reg::packed(559, MAY_BE_NULL | MAY_BE_LONG), /* toIntBound return */ reg::packed(1547, 0), /* getTypeFromValue $value */ reg::packed(559, 0, 560), /* getTypeFromValue return */ - reg::packed(559, 0, 2372), /* getReflectionProvider return */ + reg::packed(559, 0, 2366), /* getReflectionProvider return */ reg::packed(1151, 0, 560), /* getNeverType $leftType */ reg::packed(1160, 0, 560), /* getNeverType $rightType */ reg::packed(559, 0, 560), /* getNeverType return */ @@ -397,21 +396,21 @@ inline constexpr sigtab::Sig resolveConstantArrayTypeComparison = { { 1691 /* re inline constexpr sigtab::Sig resolveCommonMath = { { 1755 /* resolveCommonMath */, 3, 129, 3, 132, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig integerRangeMath = { { 1792 /* integerRangeMath */, 3, 133, 3, 136, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig shiftLeftOverflows = { { 1815 /* shiftLeftOverflows */, 2, 137, 2, 139, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig getClassConstFetchTypeByReflection = { { 1950 /* getClassConstFetchTypeByReflection */, 4, 140, 5, 145, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig transformStaticType = { { 1999 /* transformStaticType */, 2, 146, 2, 148, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getClassConstFetchType = { { 2019 /* getClassConstFetchType */, 4, 149, 4, 153, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getUnaryPlusType = { { 2042 /* getUnaryPlusType */, 2, 154, 2, 156, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getUnaryMinusType = { { 2059 /* getUnaryMinusType */, 2, 157, 2, 159, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getUnaryMinusTypeFromType = { { 2077 /* getUnaryMinusTypeFromType */, 2, 160, 2, 162, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getBitwiseNotType = { { 2103 /* getBitwiseNotType */, 2, 163, 2, 165, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getBitwiseNotTypeFromType = { { 2121 /* getBitwiseNotTypeFromType */, 1, 166, 1, 167, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig resolveName = { { 2172 /* resolveName */, 2, 168, 2, 170, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveTypeByName = { { 2215 /* resolveTypeByName */, 2, 171, 2, 173, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveTypeByNameWithLateStaticBinding = { { 2305 /* resolveTypeByNameWithLateStaticBinding */, 3, 174, 3, 177, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig toIntBound = { { 2344 /* toIntBound */, 1, 178, 1, 179, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig getTypeFromValue = { { 2355 /* getTypeFromValue */, 1, 180, 1, 181, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getReflectionProvider = { { 2410 /* getReflectionProvider */, 0, 182, 0, 182, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getNeverType = { { 2432 /* getNeverType */, 2, 183, 2, 185, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getClassConstFetchTypeByReflection = { { 1944 /* getClassConstFetchTypeByReflection */, 5, 140, 5, 145, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig transformStaticType = { { 1993 /* transformStaticType */, 2, 146, 2, 148, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getClassConstFetchType = { { 2013 /* getClassConstFetchType */, 4, 149, 4, 153, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getUnaryPlusType = { { 2036 /* getUnaryPlusType */, 2, 154, 2, 156, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getUnaryMinusType = { { 2053 /* getUnaryMinusType */, 2, 157, 2, 159, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getUnaryMinusTypeFromType = { { 2071 /* getUnaryMinusTypeFromType */, 2, 160, 2, 162, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getBitwiseNotType = { { 2097 /* getBitwiseNotType */, 2, 163, 2, 165, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getBitwiseNotTypeFromType = { { 2115 /* getBitwiseNotTypeFromType */, 1, 166, 1, 167, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig resolveName = { { 2166 /* resolveName */, 2, 168, 2, 170, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveTypeByName = { { 2209 /* resolveTypeByName */, 2, 171, 2, 173, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveTypeByNameWithLateStaticBinding = { { 2299 /* resolveTypeByNameWithLateStaticBinding */, 3, 174, 3, 177, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig toIntBound = { { 2338 /* toIntBound */, 1, 178, 1, 179, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig getTypeFromValue = { { 2349 /* getTypeFromValue */, 1, 180, 1, 181, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getReflectionProvider = { { 2404 /* getReflectionProvider */, 0, 182, 0, 182, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getNeverType = { { 2426 /* getNeverType */, 2, 183, 2, 185, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::InitializerExprTypeResolver diff --git a/turbo-ext/src/generated/InternalThrowPoint.h b/turbo-ext/src/generated/InternalThrowPoint.h index 9dd4fd7bfad..4ff049ea162 100644 --- a/turbo-ext/src/generated/InternalThrowPoint.h +++ b/turbo-ext/src/generated/InternalThrowPoint.h @@ -49,17 +49,16 @@ inline constexpr char strings[] = "toPublic\0" /* 153 */ "PHPStan\\Analyser\\InternalThrowPoint\0" /* 162 */ "createExplicit\0" /* 198 */ - "null\0" /* 213 */ - "createImplicit\0" /* 218 */ - "throwPoint\0" /* 233 */ - "createFromPublic\0" /* 244 */ - "withScope\0" /* 261 */ - "getScope\0" /* 271 */ - "getType\0" /* 280 */ - "getNode\0" /* 288 */ - "isExplicit\0" /* 296 */ - "catchType\0" /* 307 */ - "subtractCatchType"; /* 317 */ + "createImplicit\0" /* 213 */ + "throwPoint\0" /* 228 */ + "createFromPublic\0" /* 239 */ + "withScope\0" /* 256 */ + "getScope\0" /* 266 */ + "getType\0" /* 275 */ + "getNode\0" /* 283 */ + "isExplicit\0" /* 291 */ + "catchType\0" /* 302 */ + "subtractCatchType"; /* 312 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 6), /* __construct $scope */ reg::packed(37, 0, 42), /* __construct $type */ @@ -74,9 +73,9 @@ inline constexpr reg::PackedArg args[] = { reg::packed(124, 0, 162), /* createExplicit return */ reg::packed(0, 0, 6), /* createImplicit $scope */ reg::packed(60, 0, 65), /* createImplicit $node */ - reg::packed(37, MAY_BE_NULL, 42, false, false, 213), /* createImplicit $type */ + reg::packed(37, MAY_BE_NULL, 42), /* createImplicit $type */ reg::packed(124, 0, 162), /* createImplicit return */ - reg::packed(233, 0, 125), /* createFromPublic $throwPoint */ + reg::packed(228, 0, 125), /* createFromPublic $throwPoint */ reg::packed(0, 0, 6), /* createFromPublic $scope */ reg::packed(124, 0, 162), /* createFromPublic return */ reg::packed(0, 0, 6), /* withScope $scope */ @@ -85,7 +84,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(124, 0, 42), /* getType return */ reg::packed(124, MAY_BE_BOOL), /* isExplicit return */ reg::packed(124, MAY_BE_BOOL), /* canContainAnyThrowable return */ - reg::packed(307, 0, 42), /* subtractCatchType $catchType */ + reg::packed(302, 0, 42), /* subtractCatchType $catchType */ reg::packed(124, 0, 162), /* subtractCatchType return */ }; using Sig = reg::Sig; @@ -96,15 +95,15 @@ namespace sig { inline constexpr sigtab::Sig __construct = { { 112 /* __construct */, 5, 0, 5, reg::NoArg, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig toPublic = { { 153 /* toPublic */, 0, 5, 0, 5, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig createExplicit = { { 198 /* createExplicit */, 4, 6, 4, 10, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig createImplicit = { { 218 /* createImplicit */, 2, 11, 3, 14, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig createFromPublic = { { 244 /* createFromPublic */, 2, 15, 2, 17, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig withScope = { { 261 /* withScope */, 1, 18, 1, 19, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getScope = { { 271 /* getScope */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getType = { { 280 /* getType */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getNode = { { 288 /* getNode */, 0, 22, 0, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isExplicit = { { 296 /* isExplicit */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig createImplicit = { { 213 /* createImplicit */, 3, 11, 3, 14, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig createFromPublic = { { 239 /* createFromPublic */, 2, 15, 2, 17, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig withScope = { { 256 /* withScope */, 1, 18, 1, 19, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getScope = { { 266 /* getScope */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getType = { { 275 /* getType */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getNode = { { 283 /* getNode */, 0, 22, 0, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isExplicit = { { 291 /* isExplicit */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig canContainAnyThrowable = { { 89 /* canContainAnyThrowable */, 0, 23, 0, 23, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig subtractCatchType = { { 317 /* subtractCatchType */, 1, 24, 1, 25, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig subtractCatchType = { { 312 /* subtractCatchType */, 1, 24, 1, 25, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::InternalThrowPoint diff --git a/turbo-ext/src/generated/IssetabilityDescriptor.h b/turbo-ext/src/generated/IssetabilityDescriptor.h index 9d00c73ea2d..a40bc873610 100644 --- a/turbo-ext/src/generated/IssetabilityDescriptor.h +++ b/turbo-ext/src/generated/IssetabilityDescriptor.h @@ -41,62 +41,60 @@ namespace sigtab { inline constexpr char strings[] = "kind\0" /* 0 */ "variableName\0" /* 5 */ - "null\0" /* 18 */ - "varResult\0" /* 23 */ - "PHPStan\\Analyser\\ExpressionResult\0" /* 33 */ - "dimResult\0" /* 67 */ - "innerResult\0" /* 77 */ - "reflectionResolver\0" /* 89 */ - "Closure\0" /* 108 */ - "propertyFetch\0" /* 116 */ - "PhpParser\\Node\\Expr\0" /* 130 */ - "__construct\0" /* 150 */ - "\0" /* 162 */ - "PHPStan\\Analyser\\IssetabilityDescriptor\0" /* 163 */ - "variable\0" /* 203 */ - "offset\0" /* 212 */ - "property\0" /* 219 */ - "scope\0" /* 228 */ - "PHPStan\\Analyser\\MutatingScope\0" /* 234 */ - "useNativeTypes\0" /* 265 */ - "expr\0" /* 280 */ - "reprocessUntrackedLinks\0" /* 285 */ - "false\0" /* 309 */ - "PHPStan\\Analyser\\IssetabilityResolution\0" /* 315 */ - "resolve"; /* 355 */ + "varResult\0" /* 18 */ + "PHPStan\\Analyser\\ExpressionResult\0" /* 28 */ + "dimResult\0" /* 62 */ + "innerResult\0" /* 72 */ + "reflectionResolver\0" /* 84 */ + "Closure\0" /* 103 */ + "propertyFetch\0" /* 111 */ + "PhpParser\\Node\\Expr\0" /* 125 */ + "__construct\0" /* 145 */ + "\0" /* 157 */ + "PHPStan\\Analyser\\IssetabilityDescriptor\0" /* 158 */ + "variable\0" /* 198 */ + "offset\0" /* 207 */ + "property\0" /* 214 */ + "scope\0" /* 223 */ + "PHPStan\\Analyser\\MutatingScope\0" /* 229 */ + "useNativeTypes\0" /* 260 */ + "expr\0" /* 275 */ + "reprocessUntrackedLinks\0" /* 280 */ + "PHPStan\\Analyser\\IssetabilityResolution\0" /* 304 */ + "resolve"; /* 344 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $kind */ - reg::packed(5, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 18), /* __construct $variableName */ - reg::packed(23, MAY_BE_NULL, 33, false, false, 18), /* __construct $varResult */ - reg::packed(67, MAY_BE_NULL, 33, false, false, 18), /* __construct $dimResult */ - reg::packed(77, MAY_BE_NULL, 33, false, false, 18), /* __construct $innerResult */ - reg::packed(89, MAY_BE_NULL, 108, false, false, 18), /* __construct $reflectionResolver */ - reg::packed(116, MAY_BE_NULL, 130, false, false, 18), /* __construct $propertyFetch */ + reg::packed(5, MAY_BE_NULL | MAY_BE_STRING), /* __construct $variableName */ + reg::packed(18, MAY_BE_NULL, 28), /* __construct $varResult */ + reg::packed(62, MAY_BE_NULL, 28), /* __construct $dimResult */ + reg::packed(72, MAY_BE_NULL, 28), /* __construct $innerResult */ + reg::packed(84, MAY_BE_NULL, 103), /* __construct $reflectionResolver */ + reg::packed(111, MAY_BE_NULL, 125), /* __construct $propertyFetch */ reg::packed(5, MAY_BE_STRING), /* variable $variableName */ - reg::packed(162, 0, 163), /* variable return */ - reg::packed(23, 0, 33), /* offset $varResult */ - reg::packed(67, 0, 33), /* offset $dimResult */ - reg::packed(162, 0, 163), /* offset return */ - reg::packed(77, MAY_BE_NULL, 33), /* property $innerResult */ - reg::packed(89, 0, 108), /* property $reflectionResolver */ - reg::packed(116, 0, 130), /* property $propertyFetch */ - reg::packed(162, 0, 163), /* property return */ - reg::packed(228, 0, 234), /* resolve $scope */ - reg::packed(265, MAY_BE_BOOL), /* resolve $useNativeTypes */ - reg::packed(280, 0, 130), /* resolve $expr */ - reg::packed(285, MAY_BE_BOOL, reg::NoString, false, false, 309), /* resolve $reprocessUntrackedLinks */ - reg::packed(162, 0, 315), /* resolve return */ + reg::packed(157, 0, 158), /* variable return */ + reg::packed(18, 0, 28), /* offset $varResult */ + reg::packed(62, 0, 28), /* offset $dimResult */ + reg::packed(157, 0, 158), /* offset return */ + reg::packed(72, MAY_BE_NULL, 28), /* property $innerResult */ + reg::packed(84, 0, 103), /* property $reflectionResolver */ + reg::packed(111, 0, 125), /* property $propertyFetch */ + reg::packed(157, 0, 158), /* property return */ + reg::packed(223, 0, 229), /* resolve $scope */ + reg::packed(260, MAY_BE_BOOL), /* resolve $useNativeTypes */ + reg::packed(275, 0, 125), /* resolve $expr */ + reg::packed(280, MAY_BE_BOOL), /* resolve $reprocessUntrackedLinks */ + reg::packed(157, 0, 304), /* resolve 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 = { { 150 /* __construct */, 1, 0, 7, reg::NoArg, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig variable = { { 203 /* variable */, 1, 7, 1, 8, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig offset = { { 212 /* offset */, 2, 9, 2, 11, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig property = { { 219 /* property */, 3, 12, 3, 15, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig resolve = { { 355 /* resolve */, 3, 16, 4, 20, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 145 /* __construct */, 7, 0, 7, reg::NoArg, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig variable = { { 198 /* variable */, 1, 7, 1, 8, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig offset = { { 207 /* offset */, 2, 9, 2, 11, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig property = { { 214 /* property */, 3, 12, 3, 15, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig resolve = { { 344 /* resolve */, 4, 16, 4, 20, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::IssetabilityDescriptor diff --git a/turbo-ext/src/generated/IssetabilityLinkInfo.h b/turbo-ext/src/generated/IssetabilityLinkInfo.h index 4a9c855979c..0cf3030e79e 100644 --- a/turbo-ext/src/generated/IssetabilityLinkInfo.h +++ b/turbo-ext/src/generated/IssetabilityLinkInfo.h @@ -75,176 +75,174 @@ namespace sigtab { inline constexpr char strings[] = "kind\0" /* 0 */ "variableName\0" /* 5 */ - "null\0" /* 18 */ - "hasVariable\0" /* 23 */ - "PHPStan\\TrinaryLogic\0" /* 35 */ - "isOffsetAccessible\0" /* 56 */ - "hasOffsetValue\0" /* 75 */ - "hasExpressionTypeOfExpr\0" /* 90 */ - "false\0" /* 114 */ - "varType\0" /* 120 */ - "PHPStan\\Type\\Type\0" /* 128 */ - "dimType\0" /* 146 */ - "valueType\0" /* 154 */ - "propertyReflection\0" /* 164 */ - "PHPStan\\Rules\\Properties\\FoundPropertyReflection\0" /* 183 */ - "propertyFetch\0" /* 232 */ - "PhpParser\\Node\\Expr\0" /* 246 */ - "reflectionNative\0" /* 266 */ - "hasNativeType\0" /* 283 */ - "isVirtual\0" /* 297 */ - "nativeType\0" /* 307 */ - "hasExpressionTypeOfFetch\0" /* 318 */ - "initializedThisProperty\0" /* 343 */ - "nativeReflectionExists\0" /* 367 */ - "nativeIsPromoted\0" /* 390 */ - "nativeIsReadOnly\0" /* 407 */ - "nativeIsHooked\0" /* 424 */ - "nativeHasDefaultValue\0" /* 439 */ - "leafExpr\0" /* 461 */ - "leafIsNullsafePropertyFetch\0" /* 470 */ - "__construct\0" /* 498 */ - "\0" /* 510 */ - "PHPStan\\Analyser\\IssetabilityLinkInfo\0" /* 511 */ - "variable\0" /* 549 */ - "offset\0" /* 558 */ - "writableType\0" /* 565 */ - "property\0" /* 578 */ - "leaf\0" /* 587 */ - "isVariable\0" /* 592 */ - "isOffset\0" /* 603 */ - "isProperty\0" /* 612 */ - "getVariableName\0" /* 623 */ - "getHasVariable\0" /* 639 */ - "getValueType\0" /* 654 */ - "getIsOffsetAccessible\0" /* 667 */ - "getHasOffsetValue\0" /* 689 */ - "getVarType\0" /* 707 */ - "getDimType\0" /* 718 */ - "getPropertyReflection\0" /* 729 */ - "getPropertyFetch\0" /* 751 */ - "isReflectionNative\0" /* 768 */ - "getNativeType\0" /* 787 */ - "isInitializedThisProperty\0" /* 801 */ - "getLeafExpr"; /* 827 */ + "hasVariable\0" /* 18 */ + "PHPStan\\TrinaryLogic\0" /* 30 */ + "isOffsetAccessible\0" /* 51 */ + "hasOffsetValue\0" /* 70 */ + "hasExpressionTypeOfExpr\0" /* 85 */ + "varType\0" /* 109 */ + "PHPStan\\Type\\Type\0" /* 117 */ + "dimType\0" /* 135 */ + "valueType\0" /* 143 */ + "propertyReflection\0" /* 153 */ + "PHPStan\\Rules\\Properties\\FoundPropertyReflection\0" /* 172 */ + "propertyFetch\0" /* 221 */ + "PhpParser\\Node\\Expr\0" /* 235 */ + "reflectionNative\0" /* 255 */ + "hasNativeType\0" /* 272 */ + "isVirtual\0" /* 286 */ + "nativeType\0" /* 296 */ + "hasExpressionTypeOfFetch\0" /* 307 */ + "initializedThisProperty\0" /* 332 */ + "nativeReflectionExists\0" /* 356 */ + "nativeIsPromoted\0" /* 379 */ + "nativeIsReadOnly\0" /* 396 */ + "nativeIsHooked\0" /* 413 */ + "nativeHasDefaultValue\0" /* 428 */ + "leafExpr\0" /* 450 */ + "leafIsNullsafePropertyFetch\0" /* 459 */ + "__construct\0" /* 487 */ + "\0" /* 499 */ + "PHPStan\\Analyser\\IssetabilityLinkInfo\0" /* 500 */ + "variable\0" /* 538 */ + "offset\0" /* 547 */ + "writableType\0" /* 554 */ + "property\0" /* 567 */ + "leaf\0" /* 576 */ + "isVariable\0" /* 581 */ + "isOffset\0" /* 592 */ + "isProperty\0" /* 601 */ + "getVariableName\0" /* 612 */ + "getHasVariable\0" /* 628 */ + "getValueType\0" /* 643 */ + "getIsOffsetAccessible\0" /* 656 */ + "getHasOffsetValue\0" /* 678 */ + "getVarType\0" /* 696 */ + "getDimType\0" /* 707 */ + "getPropertyReflection\0" /* 718 */ + "getPropertyFetch\0" /* 740 */ + "isReflectionNative\0" /* 757 */ + "getNativeType\0" /* 776 */ + "isInitializedThisProperty\0" /* 790 */ + "getLeafExpr"; /* 816 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $kind */ - reg::packed(5, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 18), /* __construct $variableName */ - reg::packed(23, MAY_BE_NULL, 35, false, false, 18), /* __construct $hasVariable */ - reg::packed(56, MAY_BE_NULL, 35, false, false, 18), /* __construct $isOffsetAccessible */ - reg::packed(75, MAY_BE_NULL, 35, false, false, 18), /* __construct $hasOffsetValue */ - reg::packed(90, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $hasExpressionTypeOfExpr */ - reg::packed(120, MAY_BE_NULL, 128, false, false, 18), /* __construct $varType */ - reg::packed(146, MAY_BE_NULL, 128, false, false, 18), /* __construct $dimType */ - reg::packed(154, MAY_BE_NULL, 128, false, false, 18), /* __construct $valueType */ - reg::packed(164, MAY_BE_NULL, 183, false, false, 18), /* __construct $propertyReflection */ - reg::packed(232, MAY_BE_NULL, 246, false, false, 18), /* __construct $propertyFetch */ - reg::packed(266, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $reflectionNative */ - reg::packed(283, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $hasNativeType */ - reg::packed(297, MAY_BE_NULL, 35, false, false, 18), /* __construct $isVirtual */ - reg::packed(307, MAY_BE_NULL, 128, false, false, 18), /* __construct $nativeType */ - reg::packed(318, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $hasExpressionTypeOfFetch */ - reg::packed(343, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $initializedThisProperty */ - reg::packed(367, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $nativeReflectionExists */ - reg::packed(390, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $nativeIsPromoted */ - reg::packed(407, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $nativeIsReadOnly */ - reg::packed(424, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $nativeIsHooked */ - reg::packed(439, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $nativeHasDefaultValue */ - reg::packed(461, MAY_BE_NULL, 246, false, false, 18), /* __construct $leafExpr */ - reg::packed(470, MAY_BE_BOOL, reg::NoString, false, false, 114), /* __construct $leafIsNullsafePropertyFetch */ + reg::packed(5, MAY_BE_NULL | MAY_BE_STRING), /* __construct $variableName */ + reg::packed(18, MAY_BE_NULL, 30), /* __construct $hasVariable */ + reg::packed(51, MAY_BE_NULL, 30), /* __construct $isOffsetAccessible */ + reg::packed(70, MAY_BE_NULL, 30), /* __construct $hasOffsetValue */ + reg::packed(85, MAY_BE_BOOL), /* __construct $hasExpressionTypeOfExpr */ + reg::packed(109, MAY_BE_NULL, 117), /* __construct $varType */ + reg::packed(135, MAY_BE_NULL, 117), /* __construct $dimType */ + reg::packed(143, MAY_BE_NULL, 117), /* __construct $valueType */ + reg::packed(153, MAY_BE_NULL, 172), /* __construct $propertyReflection */ + reg::packed(221, MAY_BE_NULL, 235), /* __construct $propertyFetch */ + reg::packed(255, MAY_BE_BOOL), /* __construct $reflectionNative */ + reg::packed(272, MAY_BE_BOOL), /* __construct $hasNativeType */ + reg::packed(286, MAY_BE_NULL, 30), /* __construct $isVirtual */ + reg::packed(296, MAY_BE_NULL, 117), /* __construct $nativeType */ + reg::packed(307, MAY_BE_BOOL), /* __construct $hasExpressionTypeOfFetch */ + reg::packed(332, MAY_BE_BOOL), /* __construct $initializedThisProperty */ + reg::packed(356, MAY_BE_BOOL), /* __construct $nativeReflectionExists */ + reg::packed(379, MAY_BE_BOOL), /* __construct $nativeIsPromoted */ + reg::packed(396, MAY_BE_BOOL), /* __construct $nativeIsReadOnly */ + reg::packed(413, MAY_BE_BOOL), /* __construct $nativeIsHooked */ + reg::packed(428, MAY_BE_BOOL), /* __construct $nativeHasDefaultValue */ + reg::packed(450, MAY_BE_NULL, 235), /* __construct $leafExpr */ + reg::packed(459, MAY_BE_BOOL), /* __construct $leafIsNullsafePropertyFetch */ reg::packed(5, MAY_BE_STRING), /* variable $variableName */ - reg::packed(23, 0, 35), /* variable $hasVariable */ - reg::packed(154, 0, 128), /* variable $valueType */ - reg::packed(510, 0, 511), /* variable return */ - reg::packed(56, 0, 35), /* offset $isOffsetAccessible */ - reg::packed(75, 0, 35), /* offset $hasOffsetValue */ - reg::packed(90, MAY_BE_BOOL), /* offset $hasExpressionTypeOfExpr */ - reg::packed(120, 0, 128), /* offset $varType */ - reg::packed(146, 0, 128), /* offset $dimType */ - reg::packed(154, 0, 128), /* offset $valueType */ - reg::packed(510, 0, 511), /* offset return */ - reg::packed(164, MAY_BE_NULL, 183), /* property $propertyReflection */ - reg::packed(232, 0, 246), /* property $propertyFetch */ - reg::packed(266, MAY_BE_BOOL), /* property $reflectionNative */ - reg::packed(283, MAY_BE_BOOL), /* property $hasNativeType */ - reg::packed(297, 0, 35), /* property $isVirtual */ - reg::packed(565, 0, 128), /* property $writableType */ - reg::packed(307, 0, 128), /* property $nativeType */ - reg::packed(318, MAY_BE_BOOL), /* property $hasExpressionTypeOfFetch */ - reg::packed(343, MAY_BE_BOOL), /* property $initializedThisProperty */ - reg::packed(367, MAY_BE_BOOL), /* property $nativeReflectionExists */ - reg::packed(390, MAY_BE_BOOL), /* property $nativeIsPromoted */ - reg::packed(407, MAY_BE_BOOL), /* property $nativeIsReadOnly */ - reg::packed(424, MAY_BE_BOOL), /* property $nativeIsHooked */ - reg::packed(439, MAY_BE_BOOL), /* property $nativeHasDefaultValue */ - reg::packed(510, 0, 511), /* property return */ - reg::packed(154, 0, 128), /* leaf $valueType */ - reg::packed(461, 0, 246), /* leaf $leafExpr */ - reg::packed(470, MAY_BE_BOOL), /* leaf $leafIsNullsafePropertyFetch */ - reg::packed(510, 0, 511), /* leaf return */ - reg::packed(510, MAY_BE_BOOL), /* isVariable return */ - reg::packed(510, MAY_BE_BOOL), /* isOffset return */ - reg::packed(510, MAY_BE_BOOL), /* isProperty return */ - reg::packed(510, MAY_BE_STRING), /* getVariableName return */ - reg::packed(510, 0, 35), /* getHasVariable return */ - reg::packed(510, 0, 128), /* getValueType return */ - reg::packed(510, 0, 35), /* getIsOffsetAccessible return */ - reg::packed(510, 0, 35), /* getHasOffsetValue return */ - reg::packed(510, MAY_BE_BOOL), /* hasExpressionTypeOfExpr return */ - reg::packed(510, 0, 128), /* getVarType return */ - reg::packed(510, 0, 128), /* getDimType return */ - reg::packed(510, MAY_BE_NULL, 183), /* getPropertyReflection return */ - reg::packed(510, 0, 246), /* getPropertyFetch return */ - reg::packed(510, MAY_BE_BOOL), /* isReflectionNative return */ - reg::packed(510, MAY_BE_BOOL), /* hasNativeType return */ - reg::packed(510, 0, 35), /* isVirtual return */ - reg::packed(510, 0, 128), /* getNativeType return */ - reg::packed(510, MAY_BE_BOOL), /* hasExpressionTypeOfFetch return */ - reg::packed(510, MAY_BE_BOOL), /* isInitializedThisProperty return */ - reg::packed(510, MAY_BE_BOOL), /* nativeReflectionExists return */ - reg::packed(510, MAY_BE_BOOL), /* nativeIsPromoted return */ - reg::packed(510, MAY_BE_BOOL), /* nativeIsReadOnly return */ - reg::packed(510, MAY_BE_BOOL), /* nativeIsHooked return */ - reg::packed(510, MAY_BE_BOOL), /* nativeHasDefaultValue return */ - reg::packed(510, 0, 246), /* getLeafExpr return */ - reg::packed(510, MAY_BE_BOOL), /* leafIsNullsafePropertyFetch return */ + reg::packed(18, 0, 30), /* variable $hasVariable */ + reg::packed(143, 0, 117), /* variable $valueType */ + reg::packed(499, 0, 500), /* variable return */ + reg::packed(51, 0, 30), /* offset $isOffsetAccessible */ + reg::packed(70, 0, 30), /* offset $hasOffsetValue */ + reg::packed(85, MAY_BE_BOOL), /* offset $hasExpressionTypeOfExpr */ + reg::packed(109, 0, 117), /* offset $varType */ + reg::packed(135, 0, 117), /* offset $dimType */ + reg::packed(143, 0, 117), /* offset $valueType */ + reg::packed(499, 0, 500), /* offset return */ + reg::packed(153, MAY_BE_NULL, 172), /* property $propertyReflection */ + reg::packed(221, 0, 235), /* property $propertyFetch */ + reg::packed(255, MAY_BE_BOOL), /* property $reflectionNative */ + reg::packed(272, MAY_BE_BOOL), /* property $hasNativeType */ + reg::packed(286, 0, 30), /* property $isVirtual */ + reg::packed(554, 0, 117), /* property $writableType */ + reg::packed(296, 0, 117), /* property $nativeType */ + reg::packed(307, MAY_BE_BOOL), /* property $hasExpressionTypeOfFetch */ + reg::packed(332, MAY_BE_BOOL), /* property $initializedThisProperty */ + reg::packed(356, MAY_BE_BOOL), /* property $nativeReflectionExists */ + reg::packed(379, MAY_BE_BOOL), /* property $nativeIsPromoted */ + reg::packed(396, MAY_BE_BOOL), /* property $nativeIsReadOnly */ + reg::packed(413, MAY_BE_BOOL), /* property $nativeIsHooked */ + reg::packed(428, MAY_BE_BOOL), /* property $nativeHasDefaultValue */ + reg::packed(499, 0, 500), /* property return */ + reg::packed(143, 0, 117), /* leaf $valueType */ + reg::packed(450, 0, 235), /* leaf $leafExpr */ + reg::packed(459, MAY_BE_BOOL), /* leaf $leafIsNullsafePropertyFetch */ + reg::packed(499, 0, 500), /* leaf return */ + reg::packed(499, MAY_BE_BOOL), /* isVariable return */ + reg::packed(499, MAY_BE_BOOL), /* isOffset return */ + reg::packed(499, MAY_BE_BOOL), /* isProperty return */ + reg::packed(499, MAY_BE_STRING), /* getVariableName return */ + reg::packed(499, 0, 30), /* getHasVariable return */ + reg::packed(499, 0, 117), /* getValueType return */ + reg::packed(499, 0, 30), /* getIsOffsetAccessible return */ + reg::packed(499, 0, 30), /* getHasOffsetValue return */ + reg::packed(499, MAY_BE_BOOL), /* hasExpressionTypeOfExpr return */ + reg::packed(499, 0, 117), /* getVarType return */ + reg::packed(499, 0, 117), /* getDimType return */ + reg::packed(499, MAY_BE_NULL, 172), /* getPropertyReflection return */ + reg::packed(499, 0, 235), /* getPropertyFetch return */ + reg::packed(499, MAY_BE_BOOL), /* isReflectionNative return */ + reg::packed(499, MAY_BE_BOOL), /* hasNativeType return */ + reg::packed(499, 0, 30), /* isVirtual return */ + reg::packed(499, 0, 117), /* getNativeType return */ + reg::packed(499, MAY_BE_BOOL), /* hasExpressionTypeOfFetch return */ + reg::packed(499, MAY_BE_BOOL), /* isInitializedThisProperty return */ + reg::packed(499, MAY_BE_BOOL), /* nativeReflectionExists return */ + reg::packed(499, MAY_BE_BOOL), /* nativeIsPromoted return */ + reg::packed(499, MAY_BE_BOOL), /* nativeIsReadOnly return */ + reg::packed(499, MAY_BE_BOOL), /* nativeIsHooked return */ + reg::packed(499, MAY_BE_BOOL), /* nativeHasDefaultValue return */ + reg::packed(499, 0, 235), /* getLeafExpr return */ + reg::packed(499, MAY_BE_BOOL), /* leafIsNullsafePropertyFetch 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 = { { 498 /* __construct */, 1, 0, 24, reg::NoArg, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig variable = { { 549 /* variable */, 3, 24, 3, 27, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig offset = { { 558 /* offset */, 6, 28, 6, 34, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig property = { { 578 /* property */, 14, 35, 14, 49, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig leaf = { { 587 /* leaf */, 3, 50, 3, 53, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig isVariable = { { 592 /* isVariable */, 0, 54, 0, 54, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isOffset = { { 603 /* isOffset */, 0, 55, 0, 55, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isProperty = { { 612 /* isProperty */, 0, 56, 0, 56, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getVariableName = { { 623 /* getVariableName */, 0, 57, 0, 57, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getHasVariable = { { 639 /* getHasVariable */, 0, 58, 0, 58, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getValueType = { { 654 /* getValueType */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getIsOffsetAccessible = { { 667 /* getIsOffsetAccessible */, 0, 60, 0, 60, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getHasOffsetValue = { { 689 /* getHasOffsetValue */, 0, 61, 0, 61, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasExpressionTypeOfExpr = { { 90 /* hasExpressionTypeOfExpr */, 0, 62, 0, 62, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getVarType = { { 707 /* getVarType */, 0, 63, 0, 63, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getDimType = { { 718 /* getDimType */, 0, 64, 0, 64, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPropertyReflection = { { 729 /* getPropertyReflection */, 0, 65, 0, 65, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPropertyFetch = { { 751 /* getPropertyFetch */, 0, 66, 0, 66, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isReflectionNative = { { 768 /* isReflectionNative */, 0, 67, 0, 67, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasNativeType = { { 283 /* hasNativeType */, 0, 68, 0, 68, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isVirtual = { { 297 /* isVirtual */, 0, 69, 0, 69, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getNativeType = { { 787 /* getNativeType */, 0, 70, 0, 70, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasExpressionTypeOfFetch = { { 318 /* hasExpressionTypeOfFetch */, 0, 71, 0, 71, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isInitializedThisProperty = { { 801 /* isInitializedThisProperty */, 0, 72, 0, 72, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig nativeReflectionExists = { { 367 /* nativeReflectionExists */, 0, 73, 0, 73, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig nativeIsPromoted = { { 390 /* nativeIsPromoted */, 0, 74, 0, 74, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig nativeIsReadOnly = { { 407 /* nativeIsReadOnly */, 0, 75, 0, 75, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig nativeIsHooked = { { 424 /* nativeIsHooked */, 0, 76, 0, 76, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig nativeHasDefaultValue = { { 439 /* nativeHasDefaultValue */, 0, 77, 0, 77, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getLeafExpr = { { 827 /* getLeafExpr */, 0, 78, 0, 78, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig leafIsNullsafePropertyFetch = { { 470 /* leafIsNullsafePropertyFetch */, 0, 79, 0, 79, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 487 /* __construct */, 24, 0, 24, reg::NoArg, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig variable = { { 538 /* variable */, 3, 24, 3, 27, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig offset = { { 547 /* offset */, 6, 28, 6, 34, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig property = { { 567 /* property */, 14, 35, 14, 49, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig leaf = { { 576 /* leaf */, 3, 50, 3, 53, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig isVariable = { { 581 /* isVariable */, 0, 54, 0, 54, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isOffset = { { 592 /* isOffset */, 0, 55, 0, 55, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isProperty = { { 601 /* isProperty */, 0, 56, 0, 56, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getVariableName = { { 612 /* getVariableName */, 0, 57, 0, 57, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getHasVariable = { { 628 /* getHasVariable */, 0, 58, 0, 58, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getValueType = { { 643 /* getValueType */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getIsOffsetAccessible = { { 656 /* getIsOffsetAccessible */, 0, 60, 0, 60, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getHasOffsetValue = { { 678 /* getHasOffsetValue */, 0, 61, 0, 61, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasExpressionTypeOfExpr = { { 85 /* hasExpressionTypeOfExpr */, 0, 62, 0, 62, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getVarType = { { 696 /* getVarType */, 0, 63, 0, 63, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getDimType = { { 707 /* getDimType */, 0, 64, 0, 64, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPropertyReflection = { { 718 /* getPropertyReflection */, 0, 65, 0, 65, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPropertyFetch = { { 740 /* getPropertyFetch */, 0, 66, 0, 66, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isReflectionNative = { { 757 /* isReflectionNative */, 0, 67, 0, 67, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasNativeType = { { 272 /* hasNativeType */, 0, 68, 0, 68, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isVirtual = { { 286 /* isVirtual */, 0, 69, 0, 69, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getNativeType = { { 776 /* getNativeType */, 0, 70, 0, 70, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasExpressionTypeOfFetch = { { 307 /* hasExpressionTypeOfFetch */, 0, 71, 0, 71, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isInitializedThisProperty = { { 790 /* isInitializedThisProperty */, 0, 72, 0, 72, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig nativeReflectionExists = { { 356 /* nativeReflectionExists */, 0, 73, 0, 73, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig nativeIsPromoted = { { 379 /* nativeIsPromoted */, 0, 74, 0, 74, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig nativeIsReadOnly = { { 396 /* nativeIsReadOnly */, 0, 75, 0, 75, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig nativeIsHooked = { { 413 /* nativeIsHooked */, 0, 76, 0, 76, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig nativeHasDefaultValue = { { 428 /* nativeHasDefaultValue */, 0, 77, 0, 77, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getLeafExpr = { { 816 /* getLeafExpr */, 0, 78, 0, 78, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig leafIsNullsafePropertyFetch = { { 459 /* leafIsNullsafePropertyFetch */, 0, 79, 0, 79, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::IssetabilityLinkInfo diff --git a/turbo-ext/src/generated/IssetabilityResolution.h b/turbo-ext/src/generated/IssetabilityResolution.h index 6dca1766089..c2b033a36bc 100644 --- a/turbo-ext/src/generated/IssetabilityResolution.h +++ b/turbo-ext/src/generated/IssetabilityResolution.h @@ -39,17 +39,16 @@ inline constexpr char strings[] = "getInner\0" /* 110 */ "typeCallback\0" /* 119 */ "result\0" /* 132 */ - "null\0" /* 139 */ - "isSet\0" /* 144 */ - "isSetUndefined\0" /* 150 */ - "notEmpty"; /* 165 */ + "isSet\0" /* 139 */ + "isSetUndefined\0" /* 145 */ + "notEmpty"; /* 160 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 5), /* __construct $link */ reg::packed(43, MAY_BE_NULL, 49), /* __construct $inner */ reg::packed(101, 0, 5), /* getLink return */ reg::packed(101, MAY_BE_NULL, 49), /* getInner return */ reg::packed(119, MAY_BE_CALLABLE), /* isSet $typeCallback */ - reg::packed(132, MAY_BE_NULL | MAY_BE_BOOL, reg::NoString, false, false, 139), /* isSet $result */ + reg::packed(132, MAY_BE_NULL | MAY_BE_BOOL), /* isSet $result */ reg::packed(101, MAY_BE_NULL | MAY_BE_BOOL), /* isSet return */ reg::packed(101, MAY_BE_NULL | MAY_BE_BOOL), /* isSetUndefined return */ reg::packed(101, MAY_BE_NULL | MAY_BE_BOOL), /* notEmpty return */ @@ -62,9 +61,9 @@ namespace sig { inline constexpr sigtab::Sig __construct = { { 89 /* __construct */, 2, 0, 2, reg::NoArg, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getLink = { { 102 /* getLink */, 0, 2, 0, 2, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getInner = { { 110 /* getInner */, 0, 3, 0, 3, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isSet = { { 144 /* isSet */, 1, 4, 2, 6, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isSetUndefined = { { 150 /* isSetUndefined */, 0, 7, 0, 7, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig notEmpty = { { 165 /* notEmpty */, 0, 8, 0, 8, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isSet = { { 139 /* isSet */, 2, 4, 2, 6, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isSetUndefined = { { 145 /* isSetUndefined */, 0, 7, 0, 7, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig notEmpty = { { 160 /* notEmpty */, 0, 8, 0, 8, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::IssetabilityResolution diff --git a/turbo-ext/src/generated/LruCache.h b/turbo-ext/src/generated/LruCache.h index 5290662b8f2..31d5dd1f06a 100644 --- a/turbo-ext/src/generated/LruCache.h +++ b/turbo-ext/src/generated/LruCache.h @@ -38,51 +38,50 @@ inline void declareProperties(reg::Class &cls) namespace sigtab { inline constexpr char strings[] = "maxCount\0" /* 0 */ - "0\0" /* 9 */ - "maxWeight\0" /* 11 */ - "weightEvictionFloorCount\0" /* 21 */ - "__construct\0" /* 46 */ - "key\0" /* 58 */ - "\0" /* 62 */ - "get\0" /* 63 */ - "value\0" /* 67 */ - "weight\0" /* 73 */ - "set\0" /* 80 */ - "replace\0" /* 84 */ - "count\0" /* 92 */ - "all\0" /* 98 */ - "incomingWeight\0" /* 102 */ - "evict"; /* 117 */ + "maxWeight\0" /* 9 */ + "weightEvictionFloorCount\0" /* 19 */ + "__construct\0" /* 44 */ + "key\0" /* 56 */ + "\0" /* 60 */ + "get\0" /* 61 */ + "value\0" /* 65 */ + "weight\0" /* 71 */ + "set\0" /* 78 */ + "replace\0" /* 82 */ + "count\0" /* 90 */ + "all\0" /* 96 */ + "incomingWeight\0" /* 100 */ + "evict"; /* 115 */ inline constexpr reg::PackedArg args[] = { - reg::packed(0, MAY_BE_LONG, reg::NoString, false, false, 9), /* __construct $maxCount */ - reg::packed(11, MAY_BE_LONG, reg::NoString, false, false, 9), /* __construct $maxWeight */ - reg::packed(21, MAY_BE_LONG, reg::NoString, false, false, 9), /* __construct $weightEvictionFloorCount */ - reg::packed(58, MAY_BE_STRING), /* get $key */ - reg::packed(62, MAY_BE_ANY), /* get return */ - reg::packed(58, MAY_BE_STRING), /* set $key */ - reg::packed(67, MAY_BE_ANY), /* set $value */ - reg::packed(73, MAY_BE_LONG), /* set $weight */ - reg::packed(62, MAY_BE_ARRAY), /* set return */ - reg::packed(58, MAY_BE_STRING), /* replace $key */ - reg::packed(67, MAY_BE_ANY), /* replace $value */ - reg::packed(62, MAY_BE_VOID), /* replace return */ - reg::packed(62, MAY_BE_LONG), /* count return */ - reg::packed(62, MAY_BE_ARRAY), /* all return */ - reg::packed(102, MAY_BE_LONG), /* evict $incomingWeight */ - reg::packed(62, MAY_BE_ARRAY), /* evict return */ + reg::packed(0, MAY_BE_LONG), /* __construct $maxCount */ + reg::packed(9, MAY_BE_LONG), /* __construct $maxWeight */ + reg::packed(19, MAY_BE_LONG), /* __construct $weightEvictionFloorCount */ + reg::packed(56, MAY_BE_STRING), /* get $key */ + reg::packed(60, MAY_BE_ANY), /* get return */ + reg::packed(56, MAY_BE_STRING), /* set $key */ + reg::packed(65, MAY_BE_ANY), /* set $value */ + reg::packed(71, MAY_BE_LONG), /* set $weight */ + reg::packed(60, MAY_BE_ARRAY), /* set return */ + reg::packed(56, MAY_BE_STRING), /* replace $key */ + reg::packed(65, MAY_BE_ANY), /* replace $value */ + reg::packed(60, MAY_BE_VOID), /* replace return */ + reg::packed(60, MAY_BE_LONG), /* count return */ + reg::packed(60, MAY_BE_ARRAY), /* all return */ + reg::packed(100, MAY_BE_LONG), /* evict $incomingWeight */ + reg::packed(60, MAY_BE_ARRAY), /* evict 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 = { { 46 /* __construct */, 0, 0, 3, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig get = { { 63 /* get */, 1, 3, 1, 4, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig set = { { 80 /* set */, 3, 5, 3, 8, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig replace = { { 84 /* replace */, 2, 9, 2, 11, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig count = { { 92 /* count */, 0, 12, 0, 12, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig all = { { 98 /* all */, 0, 13, 0, 13, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig evict = { { 117 /* evict */, 1, 14, 1, 15, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig __construct = { { 44 /* __construct */, 3, 0, 3, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig get = { { 61 /* get */, 1, 3, 1, 4, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig set = { { 78 /* set */, 3, 5, 3, 8, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig replace = { { 82 /* replace */, 2, 9, 2, 11, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig count = { { 90 /* count */, 0, 12, 0, 12, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig all = { { 96 /* all */, 0, 13, 0, 13, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig evict = { { 115 /* evict */, 1, 14, 1, 15, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::LruCache diff --git a/turbo-ext/src/generated/MatchHandler.h b/turbo-ext/src/generated/MatchHandler.h index 618edc01b36..fdd8370cb43 100644 --- a/turbo-ext/src/generated/MatchHandler.h +++ b/turbo-ext/src/generated/MatchHandler.h @@ -70,12 +70,11 @@ inline constexpr char strings[] = "processExpr\0" /* 706 */ "conditions\0" /* 718 */ "condData\0" /* 729 */ - "[]\0" /* 738 */ - "PhpParser\\Node\\Expr\\BinaryOp\\Identical|PhpParser\\Node\\Expr\\FuncCall\0" /* 741 */ - "getFilteringExprForMatchArm\0" /* 809 */ - "isScopeConditionallyImpossible\0" /* 837 */ - "varNames\0" /* 868 */ - "scopeHasNeverVariable"; /* 877 */ + "PhpParser\\Node\\Expr\\BinaryOp\\Identical|PhpParser\\Node\\Expr\\FuncCall\0" /* 738 */ + "getFilteringExprForMatchArm\0" /* 806 */ + "isScopeConditionallyImpossible\0" /* 834 */ + "varNames\0" /* 865 */ + "scopeHasNeverVariable"; /* 874 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_VOID), /* resetFileAnalysisState return */ reg::packed(24, MAY_BE_BOOL), /* __construct $treatPhpDocTypesAsCertain */ @@ -97,12 +96,12 @@ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 672), /* processExpr return */ reg::packed(362, 0, 396), /* getFilteringExprForMatchArm $expr */ reg::packed(718, MAY_BE_ARRAY), /* getFilteringExprForMatchArm $conditions */ - reg::packed(729, MAY_BE_ARRAY, reg::NoString, false, false, 738), /* getFilteringExprForMatchArm $condData */ - reg::packed(0, 0, 741), /* getFilteringExprForMatchArm return */ + reg::packed(729, MAY_BE_ARRAY), /* getFilteringExprForMatchArm $condData */ + reg::packed(0, 0, 738), /* getFilteringExprForMatchArm return */ reg::packed(530, 0, 536), /* isScopeConditionallyImpossible $scope */ reg::packed(0, MAY_BE_BOOL), /* isScopeConditionallyImpossible return */ reg::packed(530, 0, 536), /* scopeHasNeverVariable $scope */ - reg::packed(868, MAY_BE_ARRAY), /* scopeHasNeverVariable $varNames */ + reg::packed(865, MAY_BE_ARRAY), /* scopeHasNeverVariable $varNames */ reg::packed(0, MAY_BE_BOOL), /* scopeHasNeverVariable return */ }; using Sig = reg::Sig; @@ -115,9 +114,9 @@ inline constexpr sigtab::Sig __construct = { { 350 /* __construct */, 5, 1, 5, r inline constexpr sigtab::Sig supports = { { 387 /* supports */, 1, 6, 1, 7, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getCapturedArmScopesAndTypes = { { 423 /* getCapturedArmScopesAndTypes */, 1, 8, 1, 9, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig processExpr = { { 706 /* processExpr */, 7, 10, 7, 17, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getFilteringExprForMatchArm = { { 809 /* getFilteringExprForMatchArm */, 2, 18, 3, 21, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isScopeConditionallyImpossible = { { 837 /* isScopeConditionallyImpossible */, 1, 22, 1, 23, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig scopeHasNeverVariable = { { 877 /* scopeHasNeverVariable */, 2, 24, 2, 26, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getFilteringExprForMatchArm = { { 806 /* getFilteringExprForMatchArm */, 3, 18, 3, 21, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isScopeConditionallyImpossible = { { 834 /* isScopeConditionallyImpossible */, 1, 22, 1, 23, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig scopeHasNeverVariable = { { 874 /* scopeHasNeverVariable */, 2, 24, 2, 26, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::MatchHandler diff --git a/turbo-ext/src/generated/MethodCallHandler.h b/turbo-ext/src/generated/MethodCallHandler.h index 2950b6cbbcb..6b73e57fd63 100644 --- a/turbo-ext/src/generated/MethodCallHandler.h +++ b/turbo-ext/src/generated/MethodCallHandler.h @@ -103,11 +103,10 @@ inline constexpr char strings[] = "walkMethodReflection\0" /* 1313 */ "PHPStan\\Reflection\\ExtendedMethodReflection\0" /* 1334 */ "PHPStan\\Analyser\\TypeSpecifierContext\0" /* 1378 */ - "null\0" /* 1416 */ - "PHPStan\\Analyser\\SpecifiedTypes\0" /* 1421 */ - "specifyTypes\0" /* 1453 */ - "defaultMethodCallNarrowing\0" /* 1466 */ - "isMethodCallNarrowable"; /* 1493 */ + "PHPStan\\Analyser\\SpecifiedTypes\0" /* 1416 */ + "specifyTypes\0" /* 1448 */ + "defaultMethodCallNarrowing\0" /* 1461 */ + "isMethodCallNarrowable"; /* 1488 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 22), /* __construct $calledMethodProcessor */ reg::packed(61, 0, 88), /* __construct $methodCallReturnTypeHelper */ @@ -145,13 +144,13 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1286, MAY_BE_NULL, 1158), /* specifyTypes $resolvedParametersAcceptor */ reg::packed(1313, MAY_BE_NULL, 1334), /* specifyTypes $walkMethodReflection */ reg::packed(961, 0, 1378), /* specifyTypes $context */ - reg::packed(1196, MAY_BE_NULL, 1207, false, false, 1416), /* specifyTypes $argsResult */ - reg::packed(774, 0, 1421), /* specifyTypes return */ + reg::packed(1196, MAY_BE_NULL, 1207), /* specifyTypes $argsResult */ + reg::packed(774, 0, 1416), /* specifyTypes return */ reg::packed(862, 0, 868), /* defaultMethodCallNarrowing $scope */ reg::packed(749, 0, 754), /* defaultMethodCallNarrowing $expr */ reg::packed(1117, 0, 1004), /* defaultMethodCallNarrowing $varResult */ reg::packed(961, 0, 1378), /* defaultMethodCallNarrowing $context */ - reg::packed(774, 0, 1421), /* defaultMethodCallNarrowing return */ + reg::packed(774, 0, 1416), /* defaultMethodCallNarrowing return */ reg::packed(862, 0, 868), /* isMethodCallNarrowable $scope */ reg::packed(749, 0, 754), /* isMethodCallNarrowable $expr */ reg::packed(1117, 0, 1004), /* isMethodCallNarrowable $varResult */ @@ -166,9 +165,9 @@ inline constexpr sigtab::Sig __construct = { { 737 /* __construct */, 11, 0, 11, inline constexpr sigtab::Sig supports = { { 775 /* supports */, 1, 11, 1, 12, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig processExpr = { { 1038 /* processExpr */, 7, 13, 7, 20, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig resolveReturnType = { { 1253 /* resolveReturnType */, 7, 21, 7, 28, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig specifyTypes = { { 1453 /* specifyTypes */, 7, 29, 8, 37, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig defaultMethodCallNarrowing = { { 1466 /* defaultMethodCallNarrowing */, 4, 38, 4, 42, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isMethodCallNarrowable = { { 1493 /* isMethodCallNarrowable */, 3, 43, 3, 46, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig specifyTypes = { { 1448 /* specifyTypes */, 8, 29, 8, 37, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig defaultMethodCallNarrowing = { { 1461 /* defaultMethodCallNarrowing */, 4, 38, 4, 42, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isMethodCallNarrowable = { { 1488 /* isMethodCallNarrowable */, 3, 43, 3, 46, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::MethodCallHandler diff --git a/turbo-ext/src/generated/MethodCallReturnTypeHelper.h b/turbo-ext/src/generated/MethodCallReturnTypeHelper.h index d427d409a31..97c9db54a2d 100644 --- a/turbo-ext/src/generated/MethodCallReturnTypeHelper.h +++ b/turbo-ext/src/generated/MethodCallReturnTypeHelper.h @@ -43,11 +43,10 @@ inline constexpr char strings[] = "PhpParser\\Node\\Expr\\MethodCall|PhpParser\\Node\\Expr\\StaticCall\0" /* 268 */ "preResolvedAcceptor\0" /* 330 */ "PHPStan\\Reflection\\ParametersAcceptor\0" /* 350 */ - "null\0" /* 388 */ - "argsResult\0" /* 393 */ - "PHPStan\\Analyser\\ArgsResult\0" /* 404 */ - "\0" /* 432 */ - "methodCallReturnType"; /* 433 */ + "argsResult\0" /* 388 */ + "PHPStan\\Analyser\\ArgsResult\0" /* 399 */ + "\0" /* 427 */ + "methodCallReturnType"; /* 428 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 35), /* __construct $dynamicReturnTypeExtensionRegistry */ reg::packed(83, 0, 97), /* __construct $storagePrimer */ @@ -55,9 +54,9 @@ inline constexpr reg::PackedArg args[] = { reg::packed(213, 0, 228), /* methodCallReturnType $typeWithMethod */ reg::packed(246, MAY_BE_STRING), /* methodCallReturnType $methodName */ reg::packed(257, 0, 268), /* methodCallReturnType $methodCall */ - reg::packed(330, MAY_BE_NULL, 350, false, false, 388), /* methodCallReturnType $preResolvedAcceptor */ - reg::packed(393, MAY_BE_NULL, 404, false, false, 388), /* methodCallReturnType $argsResult */ - reg::packed(432, MAY_BE_NULL, 228), /* methodCallReturnType return */ + reg::packed(330, MAY_BE_NULL, 350), /* methodCallReturnType $preResolvedAcceptor */ + reg::packed(388, MAY_BE_NULL, 399), /* methodCallReturnType $argsResult */ + reg::packed(427, MAY_BE_NULL, 228), /* methodCallReturnType return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -65,7 +64,7 @@ using Sig = reg::Sig; /* 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 = { { 164 /* __construct */, 2, 0, 2, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig methodCallReturnType = { { 433 /* methodCallReturnType */, 4, 2, 6, 8, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig methodCallReturnType = { { 428 /* methodCallReturnType */, 6, 2, 6, 8, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::MethodCallReturnTypeHelper diff --git a/turbo-ext/src/generated/MutatingScope.h b/turbo-ext/src/generated/MutatingScope.h index e01ebcdf60c..e7ca7d0ede2 100644 --- a/turbo-ext/src/generated/MutatingScope.h +++ b/turbo-ext/src/generated/MutatingScope.h @@ -579,7 +579,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(380, MAY_BE_BOOL), /* duplicateWith $inFirstLevelStatement */ reg::packed(494, MAY_BE_BOOL), /* duplicateWith $afterExtractCall */ reg::packed(738, 0, 523), /* duplicateWith return */ - reg::packed(1845, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 222), /* getClosureScopeCacheKey $relevantRoots */ + reg::packed(1845, MAY_BE_NULL | MAY_BE_ARRAY), /* getClosureScopeCacheKey $relevantRoots */ reg::packed(738, MAY_BE_STRING), /* getClosureScopeCacheKey return */ reg::packed(1883, MAY_BE_STRING), /* exprStringIsRootedIn $exprString */ reg::packed(1894, MAY_BE_ARRAY), /* exprStringIsRootedIn $roots */ @@ -790,7 +790,7 @@ inline constexpr reg::PackedArg args[] = { 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(5262, MAY_BE_BOOL), /* enterExpressionAssign $isPlainWrite */ reg::packed(738, 0, 523), /* enterExpressionAssign return */ reg::packed(966, 0, 1712), /* exitExpressionAssign $expr */ reg::packed(738, 0, 523), /* exitExpressionAssign return */ @@ -897,7 +897,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(6533, 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(6490, MAY_BE_BOOL), /* 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 */ @@ -930,7 +930,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(7249, 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(7308, MAY_BE_NULL | MAY_BE_ARRAY), /* 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 */ @@ -1072,7 +1072,7 @@ inline constexpr sigtab::Sig getScopeNativeType = { { 1753 /* getScopeNativeType inline constexpr sigtab::Sig getNodeKey = { { 1772 /* getNodeKey */, 1, 73, 1, 74, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getExprPrinter = { { 1816 /* getExprPrinter */, 0, 75, 0, 75, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig duplicateWith = { { 1831 /* duplicateWith */, 8, 76, 8, 84, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getClosureScopeCacheKey = { { 1859 /* getClosureScopeCacheKey */, 0, 85, 1, 86, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureScopeCacheKey = { { 1859 /* getClosureScopeCacheKey */, 1, 85, 1, 86, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig exprStringIsRootedIn = { { 1900 /* exprStringIsRootedIn */, 2, 87, 2, 89, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig resolveType = { { 1921 /* resolveType */, 2, 90, 2, 92, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig resolveTypeOfNewWorldHandlerNode = { { 1933 /* resolveTypeOfNewWorldHandlerNode */, 1, 93, 1, 94, ZEND_ACC_PRIVATE } }; @@ -1140,7 +1140,7 @@ inline constexpr sigtab::Sig enterMatch = { { 5127 /* enterMatch */, 3, 274, 3, 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 enterExpressionAssign = { { 5275 /* enterExpressionAssign */, 2, 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 } }; @@ -1179,7 +1179,7 @@ inline constexpr sigtab::Sig exitFirstLevelStatements = { { 6430 /* exitFirstLev 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 mergeWithVariableState = { { 6564 /* mergeWithVariableState */, 2, 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 } }; @@ -1189,7 +1189,7 @@ inline constexpr sigtab::Sig processFinallyScope = { { 7059 /* processFinallySco 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 generalizeWith = { { 7330 /* generalizeWith */, 2, 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 } }; diff --git a/turbo-ext/src/generated/NewHandler.h b/turbo-ext/src/generated/NewHandler.h index 610ce192ea4..53ce8dc5162 100644 --- a/turbo-ext/src/generated/NewHandler.h +++ b/turbo-ext/src/generated/NewHandler.h @@ -106,25 +106,23 @@ inline constexpr char strings[] = "PHPStan\\Type\\Type\0" /* 1409 */ "argsResult\0" /* 1427 */ "PHPStan\\Analyser\\ArgsResult\0" /* 1438 */ - "null\0" /* 1466 */ - "allowUnresolved\0" /* 1471 */ - "true\0" /* 1487 */ - "resolveReturnType\0" /* 1492 */ - "node\0" /* 1510 */ - "exactInstantiation\0" /* 1515 */ - "site\0" /* 1534 */ - "frame\0" /* 1539 */ - "PHPStan\\Analyser\\Generics\\TemplateArgumentFrame\0" /* 1545 */ - "unresolvedArgumentList\0" /* 1593 */ - "type\0" /* 1616 */ - "PHPStan\\Type\\Generic\\UnresolvedTemplateArgumentType\0" /* 1621 */ - "template\0" /* 1673 */ - "PHPStan\\Type\\Generic\\TemplateType\0" /* 1682 */ - "rekeyParentTemplateArgument\0" /* 1716 */ - "resolvedParametersAcceptor\0" /* 1744 */ - "PHPStan\\Analyser\\TypeSpecifierContext\0" /* 1771 */ - "PHPStan\\Analyser\\SpecifiedTypes\0" /* 1809 */ - "specifyTypes"; /* 1841 */ + "allowUnresolved\0" /* 1466 */ + "resolveReturnType\0" /* 1482 */ + "node\0" /* 1500 */ + "exactInstantiation\0" /* 1505 */ + "site\0" /* 1524 */ + "frame\0" /* 1529 */ + "PHPStan\\Analyser\\Generics\\TemplateArgumentFrame\0" /* 1535 */ + "unresolvedArgumentList\0" /* 1583 */ + "type\0" /* 1606 */ + "PHPStan\\Type\\Generic\\UnresolvedTemplateArgumentType\0" /* 1611 */ + "template\0" /* 1663 */ + "PHPStan\\Type\\Generic\\TemplateType\0" /* 1672 */ + "rekeyParentTemplateArgument\0" /* 1706 */ + "resolvedParametersAcceptor\0" /* 1734 */ + "PHPStan\\Analyser\\TypeSpecifierContext\0" /* 1761 */ + "PHPStan\\Analyser\\SpecifiedTypes\0" /* 1799 */ + "specifyTypes"; /* 1831 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 19), /* __construct $reflectionProvider */ reg::packed(57, 0, 96), /* __construct $dynamicStaticMethodThrowTypeExtensions */ @@ -169,32 +167,32 @@ inline constexpr reg::PackedArg args[] = { reg::packed(657, 0, 662), /* resolveReturnType $expr */ reg::packed(1375, MAY_BE_NULL, 1158), /* resolveReturnType $preResolvedAcceptor */ reg::packed(1395, MAY_BE_NULL, 1409), /* resolveReturnType $classExprType */ - reg::packed(1427, MAY_BE_NULL, 1438, false, false, 1466), /* resolveReturnType $argsResult */ - reg::packed(1471, MAY_BE_BOOL, reg::NoString, false, false, 1487), /* resolveReturnType $allowUnresolved */ + reg::packed(1427, MAY_BE_NULL, 1438), /* resolveReturnType $argsResult */ + reg::packed(1466, MAY_BE_BOOL), /* resolveReturnType $allowUnresolved */ reg::packed(682, 0, 1409), /* resolveReturnType return */ reg::packed(770, 0, 776), /* exactInstantiation $scope */ - reg::packed(1510, 0, 968), /* exactInstantiation $node */ + reg::packed(1500, 0, 968), /* exactInstantiation $node */ reg::packed(958, 0, 1289), /* exactInstantiation $className */ reg::packed(1375, MAY_BE_NULL, 1158), /* exactInstantiation $preResolvedAcceptor */ - reg::packed(1427, MAY_BE_NULL, 1438, false, false, 1466), /* exactInstantiation $argsResult */ - reg::packed(1471, MAY_BE_BOOL, reg::NoString, false, false, 1487), /* exactInstantiation $allowUnresolved */ + reg::packed(1427, MAY_BE_NULL, 1438), /* exactInstantiation $argsResult */ + reg::packed(1466, MAY_BE_BOOL), /* exactInstantiation $allowUnresolved */ reg::packed(682, 0, 1409), /* exactInstantiation return */ reg::packed(1088, 0, 1104), /* unresolvedArgumentList $classReflection */ - reg::packed(1534, 0, 968), /* unresolvedArgumentList $site */ - reg::packed(1539, MAY_BE_NULL, 1545), /* unresolvedArgumentList $frame */ - reg::packed(1471, MAY_BE_BOOL), /* unresolvedArgumentList $allowUnresolved */ + reg::packed(1524, 0, 968), /* unresolvedArgumentList $site */ + reg::packed(1529, MAY_BE_NULL, 1535), /* unresolvedArgumentList $frame */ + reg::packed(1466, MAY_BE_BOOL), /* unresolvedArgumentList $allowUnresolved */ reg::packed(682, MAY_BE_ARRAY), /* unresolvedArgumentList return */ - reg::packed(1616, 0, 1621), /* rekeyParentTemplateArgument $type */ - reg::packed(1534, 0, 968), /* rekeyParentTemplateArgument $site */ - reg::packed(1673, 0, 1682), /* rekeyParentTemplateArgument $template */ - reg::packed(1539, MAY_BE_NULL, 1545), /* rekeyParentTemplateArgument $frame */ - reg::packed(1471, MAY_BE_BOOL), /* rekeyParentTemplateArgument $allowUnresolved */ + reg::packed(1606, 0, 1611), /* rekeyParentTemplateArgument $type */ + reg::packed(1524, 0, 968), /* rekeyParentTemplateArgument $site */ + reg::packed(1663, 0, 1672), /* rekeyParentTemplateArgument $template */ + reg::packed(1529, MAY_BE_NULL, 1535), /* rekeyParentTemplateArgument $frame */ + reg::packed(1466, MAY_BE_BOOL), /* rekeyParentTemplateArgument $allowUnresolved */ reg::packed(682, 0, 1409), /* rekeyParentTemplateArgument return */ reg::packed(770, 0, 776), /* specifyTypes $scope */ reg::packed(657, 0, 662), /* specifyTypes $expr */ - reg::packed(1744, MAY_BE_NULL, 1158), /* specifyTypes $resolvedParametersAcceptor */ - reg::packed(869, 0, 1771), /* specifyTypes $context */ - reg::packed(682, 0, 1809), /* specifyTypes return */ + reg::packed(1734, MAY_BE_NULL, 1158), /* specifyTypes $resolvedParametersAcceptor */ + reg::packed(869, 0, 1761), /* specifyTypes $context */ + reg::packed(682, 0, 1799), /* specifyTypes return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -207,11 +205,11 @@ inline constexpr sigtab::Sig processExpr = { { 946 /* processExpr */, 7, 12, 7, inline constexpr sigtab::Sig processConstructorReflection = { { 993 /* processConstructorReflection */, 2, 20, 2, 22, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig getConstructorImpurePoints = { { 1222 /* getConstructorImpurePoints */, 7, 23, 7, 30, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig getConstructorThrowPoint = { { 1350 /* getConstructorThrowPoint */, 7, 31, 7, 38, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveReturnType = { { 1492 /* resolveReturnType */, 4, 39, 6, 45, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig exactInstantiation = { { 1515 /* exactInstantiation */, 4, 46, 6, 52, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig unresolvedArgumentList = { { 1593 /* unresolvedArgumentList */, 4, 53, 4, 57, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig rekeyParentTemplateArgument = { { 1716 /* rekeyParentTemplateArgument */, 5, 58, 5, 63, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig specifyTypes = { { 1841 /* specifyTypes */, 4, 64, 4, 68, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveReturnType = { { 1482 /* resolveReturnType */, 6, 39, 6, 45, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig exactInstantiation = { { 1505 /* exactInstantiation */, 6, 46, 6, 52, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig unresolvedArgumentList = { { 1583 /* unresolvedArgumentList */, 4, 53, 4, 57, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig rekeyParentTemplateArgument = { { 1706 /* rekeyParentTemplateArgument */, 5, 58, 5, 63, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig specifyTypes = { { 1831 /* specifyTypes */, 4, 64, 4, 68, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::NewHandler diff --git a/turbo-ext/src/generated/NonNullabilityHelper.h b/turbo-ext/src/generated/NonNullabilityHelper.h index cacf3b1e5e0..2d7779b7a31 100644 --- a/turbo-ext/src/generated/NonNullabilityHelper.h +++ b/turbo-ext/src/generated/NonNullabilityHelper.h @@ -50,19 +50,20 @@ inline constexpr char strings[] = "exprToSpecify\0" /* 211 */ "PHPStan\\Analyser\\EnsuredNonNullabilityResult\0" /* 225 */ "ensureShallowNonNullability\0" /* 270 */ - "isPricedFromState\0" /* 298 */ - "result\0" /* 316 */ - "PHPStan\\Analyser\\ExpressionResult\0" /* 323 */ - "applyPendingEnsure\0" /* 357 */ - "doEnsureShallowNonNullability\0" /* 376 */ - "ensureNonNullability\0" /* 406 */ - "specifiedExpressions\0" /* 427 */ - "revertNonNullability\0" /* 448 */ - "callback\0" /* 469 */ - "Closure\0" /* 478 */ - "includeExpr\0" /* 486 */ - "true\0" /* 498 */ - "lookForExpressionCallback"; /* 503 */ + "result\0" /* 298 */ + "pending\0" /* 305 */ + "pushActiveEnsure\0" /* 313 */ + "isPricedFromState\0" /* 330 */ + "PHPStan\\Analyser\\ExpressionResult\0" /* 348 */ + "applyPendingEnsure\0" /* 382 */ + "doEnsureShallowNonNullability\0" /* 401 */ + "ensureNonNullability\0" /* 431 */ + "specifiedExpressions\0" /* 452 */ + "revertNonNullability\0" /* 473 */ + "callback\0" /* 494 */ + "Closure\0" /* 503 */ + "includeExpr\0" /* 511 */ + "lookForExpressionCallback"; /* 523 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 12), /* __construct $exprPrinter */ reg::packed(57, MAY_BE_VOID), /* resetFileAnalysisState return */ @@ -73,12 +74,15 @@ inline constexpr reg::PackedArg args[] = { reg::packed(197, 0, 166), /* ensureShallowNonNullability $originalScope */ reg::packed(211, 0, 86), /* ensureShallowNonNullability $exprToSpecify */ reg::packed(57, 0, 225), /* ensureShallowNonNullability return */ + reg::packed(298, 0, 225), /* pushActiveEnsure $result */ + reg::packed(305, MAY_BE_ARRAY), /* pushActiveEnsure $pending */ + reg::packed(57, MAY_BE_VOID), /* pushActiveEnsure return */ reg::packed(81, 0, 86), /* isPricedFromState $expr */ reg::packed(160, 0, 166), /* isPricedFromState $scope */ reg::packed(57, MAY_BE_BOOL), /* isPricedFromState return */ reg::packed(81, 0, 86), /* applyPendingEnsure $expr */ - reg::packed(316, 0, 323), /* applyPendingEnsure $result */ - reg::packed(57, 0, 323), /* applyPendingEnsure return */ + reg::packed(298, 0, 348), /* applyPendingEnsure $result */ + reg::packed(57, 0, 348), /* applyPendingEnsure return */ reg::packed(160, 0, 166), /* doEnsureShallowNonNullability $scope */ reg::packed(197, 0, 166), /* doEnsureShallowNonNullability $originalScope */ reg::packed(211, 0, 86), /* doEnsureShallowNonNullability $exprToSpecify */ @@ -87,12 +91,12 @@ inline constexpr reg::PackedArg args[] = { reg::packed(81, 0, 86), /* ensureNonNullability $expr */ reg::packed(57, 0, 225), /* ensureNonNullability return */ reg::packed(160, 0, 166), /* revertNonNullability $scope */ - reg::packed(427, MAY_BE_ARRAY), /* revertNonNullability $specifiedExpressions */ + reg::packed(452, MAY_BE_ARRAY), /* revertNonNullability $specifiedExpressions */ reg::packed(57, 0, 166), /* revertNonNullability return */ reg::packed(160, 0, 166), /* lookForExpressionCallback $scope */ reg::packed(81, 0, 86), /* lookForExpressionCallback $expr */ - reg::packed(469, 0, 478), /* lookForExpressionCallback $callback */ - reg::packed(486, MAY_BE_BOOL, reg::NoString, false, false, 498), /* lookForExpressionCallback $includeExpr */ + reg::packed(494, 0, 503), /* lookForExpressionCallback $callback */ + reg::packed(511, MAY_BE_BOOL), /* lookForExpressionCallback $includeExpr */ reg::packed(57, 0, 166), /* lookForExpressionCallback return */ }; using Sig = reg::Sig; @@ -104,13 +108,13 @@ inline constexpr sigtab::Sig __construct = { { 45 /* __construct */, 1, 0, 1, re inline constexpr sigtab::Sig resetFileAnalysisState = { { 58 /* resetFileAnalysisState */, 0, 1, 0, 1, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getActiveEnsuredOriginalType = { { 131 /* getActiveEnsuredOriginalType */, 2, 2, 2, 4, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig ensureShallowNonNullability = { { 270 /* ensureShallowNonNullability */, 3, 5, 3, 8, ZEND_ACC_PUBLIC } }; -/* pushActiveEnsure(): no signature — a default value the arginfo source cannot spell */ -inline constexpr sigtab::Sig isPricedFromState = { { 298 /* isPricedFromState */, 2, 9, 2, 11, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig applyPendingEnsure = { { 357 /* applyPendingEnsure */, 2, 12, 2, 14, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig doEnsureShallowNonNullability = { { 376 /* doEnsureShallowNonNullability */, 3, 15, 3, 18, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig ensureNonNullability = { { 406 /* ensureNonNullability */, 2, 19, 2, 21, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig revertNonNullability = { { 448 /* revertNonNullability */, 2, 22, 2, 24, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig lookForExpressionCallback = { { 503 /* lookForExpressionCallback */, 3, 25, 4, 29, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig pushActiveEnsure = { { 313 /* pushActiveEnsure */, 2, 9, 2, 11, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isPricedFromState = { { 330 /* isPricedFromState */, 2, 12, 2, 14, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig applyPendingEnsure = { { 382 /* applyPendingEnsure */, 2, 15, 2, 17, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig doEnsureShallowNonNullability = { { 401 /* doEnsureShallowNonNullability */, 3, 18, 3, 21, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig ensureNonNullability = { { 431 /* ensureNonNullability */, 2, 22, 2, 24, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig revertNonNullability = { { 473 /* revertNonNullability */, 2, 25, 2, 27, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig lookForExpressionCallback = { { 523 /* lookForExpressionCallback */, 4, 28, 4, 32, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::NonNullabilityHelper diff --git a/turbo-ext/src/generated/PreparedAssignTarget.h b/turbo-ext/src/generated/PreparedAssignTarget.h index ba82bba0377..7dcdc5a2af9 100644 --- a/turbo-ext/src/generated/PreparedAssignTarget.h +++ b/turbo-ext/src/generated/PreparedAssignTarget.h @@ -93,51 +93,49 @@ inline constexpr char strings[] = "impurePoints\0" /* 145 */ "isAlwaysTerminating\0" /* 158 */ "rootVar\0" /* 178 */ - "null\0" /* 186 */ - "varResult\0" /* 191 */ - "PHPStan\\Analyser\\ExpressionResult\0" /* 201 */ - "dimFetchStack\0" /* 235 */ - "assignedPropertyExpr\0" /* 249 */ - "offsetTypes\0" /* 270 */ - "offsetNativeTypes\0" /* 282 */ - "existingOffsetTypes\0" /* 300 */ - "existingOffsetNativeTypes\0" /* 320 */ - "offsetSetTargetResult\0" /* 346 */ - "objectResult\0" /* 368 */ - "propertyName\0" /* 381 */ - "propertyHolderType\0" /* 394 */ - "PHPStan\\Type\\Type\0" /* 413 */ - "targetReadResult\0" /* 431 */ - "targetChainResults\0" /* 448 */ - "[]\0" /* 467 */ - "variableNameResult\0" /* 470 */ - "dependencies\0" /* 489 */ - "PHPStan\\Dependency\\Dependencies\0" /* 502 */ - "__construct\0" /* 534 */ - "\0" /* 546 */ - "getDependencies\0" /* 547 */ - "getKind\0" /* 563 */ - "getVar\0" /* 571 */ - "getAssignedExpr\0" /* 578 */ - "getBeforeScope\0" /* 594 */ - "getScope\0" /* 609 */ - "getThrowPoints\0" /* 618 */ - "getImpurePoints\0" /* 633 */ - "getRootVar\0" /* 649 */ - "getVarResult\0" /* 660 */ - "getDimFetchStack\0" /* 673 */ - "getAssignedPropertyExpr\0" /* 690 */ - "getOffsetTypes\0" /* 714 */ - "getOffsetNativeTypes\0" /* 729 */ - "getExistingOffsetTypes\0" /* 750 */ - "getExistingOffsetNativeTypes\0" /* 773 */ - "getOffsetSetTargetResult\0" /* 802 */ - "getObjectResult\0" /* 827 */ - "getPropertyName\0" /* 843 */ - "getPropertyHolderType\0" /* 859 */ - "getTargetReadResult\0" /* 881 */ - "getTargetChainResults\0" /* 901 */ - "getVariableNameResult"; /* 923 */ + "varResult\0" /* 186 */ + "PHPStan\\Analyser\\ExpressionResult\0" /* 196 */ + "dimFetchStack\0" /* 230 */ + "assignedPropertyExpr\0" /* 244 */ + "offsetTypes\0" /* 265 */ + "offsetNativeTypes\0" /* 277 */ + "existingOffsetTypes\0" /* 295 */ + "existingOffsetNativeTypes\0" /* 315 */ + "offsetSetTargetResult\0" /* 341 */ + "objectResult\0" /* 363 */ + "propertyName\0" /* 376 */ + "propertyHolderType\0" /* 389 */ + "PHPStan\\Type\\Type\0" /* 408 */ + "targetReadResult\0" /* 426 */ + "targetChainResults\0" /* 443 */ + "variableNameResult\0" /* 462 */ + "dependencies\0" /* 481 */ + "PHPStan\\Dependency\\Dependencies\0" /* 494 */ + "__construct\0" /* 526 */ + "\0" /* 538 */ + "getDependencies\0" /* 539 */ + "getKind\0" /* 555 */ + "getVar\0" /* 563 */ + "getAssignedExpr\0" /* 570 */ + "getBeforeScope\0" /* 586 */ + "getScope\0" /* 601 */ + "getThrowPoints\0" /* 610 */ + "getImpurePoints\0" /* 625 */ + "getRootVar\0" /* 641 */ + "getVarResult\0" /* 652 */ + "getDimFetchStack\0" /* 665 */ + "getAssignedPropertyExpr\0" /* 682 */ + "getOffsetTypes\0" /* 706 */ + "getOffsetNativeTypes\0" /* 721 */ + "getExistingOffsetTypes\0" /* 742 */ + "getExistingOffsetNativeTypes\0" /* 765 */ + "getOffsetSetTargetResult\0" /* 794 */ + "getObjectResult\0" /* 819 */ + "getPropertyName\0" /* 835 */ + "getPropertyHolderType\0" /* 851 */ + "getTargetReadResult\0" /* 873 */ + "getTargetChainResults\0" /* 893 */ + "getVariableNameResult"; /* 915 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $kind */ reg::packed(5, 0, 9), /* __construct $var */ @@ -150,83 +148,83 @@ inline constexpr reg::PackedArg args[] = { reg::packed(133, MAY_BE_ARRAY), /* __construct $throwPoints */ reg::packed(145, MAY_BE_ARRAY), /* __construct $impurePoints */ reg::packed(158, MAY_BE_BOOL), /* __construct $isAlwaysTerminating */ - reg::packed(178, MAY_BE_NULL, 9, false, false, 186), /* __construct $rootVar */ - reg::packed(191, MAY_BE_NULL, 201, false, false, 186), /* __construct $varResult */ - reg::packed(235, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 186), /* __construct $dimFetchStack */ - reg::packed(249, MAY_BE_NULL, 9, false, false, 186), /* __construct $assignedPropertyExpr */ - reg::packed(270, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 186), /* __construct $offsetTypes */ - reg::packed(282, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 186), /* __construct $offsetNativeTypes */ - reg::packed(300, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 186), /* __construct $existingOffsetTypes */ - reg::packed(320, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 186), /* __construct $existingOffsetNativeTypes */ - reg::packed(346, MAY_BE_NULL, 201, false, false, 186), /* __construct $offsetSetTargetResult */ - reg::packed(368, MAY_BE_NULL, 201, false, false, 186), /* __construct $objectResult */ - reg::packed(381, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 186), /* __construct $propertyName */ - reg::packed(394, MAY_BE_NULL, 413, false, false, 186), /* __construct $propertyHolderType */ - reg::packed(431, MAY_BE_NULL, 201, false, false, 186), /* __construct $targetReadResult */ - reg::packed(448, MAY_BE_ARRAY, reg::NoString, false, false, 467), /* __construct $targetChainResults */ - reg::packed(470, MAY_BE_NULL, 201, false, false, 186), /* __construct $variableNameResult */ - reg::packed(489, MAY_BE_NULL, 502, false, false, 186), /* __construct $dependencies */ - reg::packed(546, MAY_BE_NULL, 502), /* getDependencies return */ - reg::packed(546, MAY_BE_STRING), /* getKind return */ - reg::packed(546, 0, 9), /* getVar return */ - reg::packed(546, 0, 9), /* getAssignedExpr return */ - reg::packed(546, 0, 54), /* getBeforeScope return */ - reg::packed(546, 0, 54), /* getScope return */ - reg::packed(546, MAY_BE_BOOL), /* enterExpressionAssign return */ - reg::packed(546, MAY_BE_BOOL), /* isAssignOp return */ - reg::packed(546, MAY_BE_BOOL), /* hasYield return */ - reg::packed(546, MAY_BE_ARRAY), /* getThrowPoints return */ - reg::packed(546, MAY_BE_ARRAY), /* getImpurePoints return */ - reg::packed(546, MAY_BE_BOOL), /* isAlwaysTerminating return */ - reg::packed(546, 0, 9), /* getRootVar return */ - reg::packed(546, 0, 201), /* getVarResult return */ - reg::packed(546, MAY_BE_ARRAY), /* getDimFetchStack return */ - reg::packed(546, 0, 9), /* getAssignedPropertyExpr return */ - reg::packed(546, MAY_BE_ARRAY), /* getOffsetTypes return */ - reg::packed(546, MAY_BE_ARRAY), /* getOffsetNativeTypes return */ - reg::packed(546, MAY_BE_ARRAY), /* getExistingOffsetTypes return */ - reg::packed(546, MAY_BE_ARRAY), /* getExistingOffsetNativeTypes return */ - reg::packed(546, 0, 201), /* getOffsetSetTargetResult return */ - reg::packed(546, 0, 201), /* getObjectResult return */ - reg::packed(546, MAY_BE_NULL | MAY_BE_STRING), /* getPropertyName return */ - reg::packed(546, 0, 413), /* getPropertyHolderType return */ - reg::packed(546, 0, 201), /* getTargetReadResult return */ - reg::packed(546, MAY_BE_ARRAY), /* getTargetChainResults return */ - reg::packed(546, MAY_BE_NULL, 201), /* getVariableNameResult return */ + reg::packed(178, MAY_BE_NULL, 9), /* __construct $rootVar */ + reg::packed(186, MAY_BE_NULL, 196), /* __construct $varResult */ + reg::packed(230, MAY_BE_NULL | MAY_BE_ARRAY), /* __construct $dimFetchStack */ + reg::packed(244, MAY_BE_NULL, 9), /* __construct $assignedPropertyExpr */ + reg::packed(265, MAY_BE_NULL | MAY_BE_ARRAY), /* __construct $offsetTypes */ + reg::packed(277, MAY_BE_NULL | MAY_BE_ARRAY), /* __construct $offsetNativeTypes */ + reg::packed(295, MAY_BE_NULL | MAY_BE_ARRAY), /* __construct $existingOffsetTypes */ + reg::packed(315, MAY_BE_NULL | MAY_BE_ARRAY), /* __construct $existingOffsetNativeTypes */ + reg::packed(341, MAY_BE_NULL, 196), /* __construct $offsetSetTargetResult */ + reg::packed(363, MAY_BE_NULL, 196), /* __construct $objectResult */ + reg::packed(376, MAY_BE_NULL | MAY_BE_STRING), /* __construct $propertyName */ + reg::packed(389, MAY_BE_NULL, 408), /* __construct $propertyHolderType */ + reg::packed(426, MAY_BE_NULL, 196), /* __construct $targetReadResult */ + reg::packed(443, MAY_BE_ARRAY), /* __construct $targetChainResults */ + reg::packed(462, MAY_BE_NULL, 196), /* __construct $variableNameResult */ + reg::packed(481, MAY_BE_NULL, 494), /* __construct $dependencies */ + reg::packed(538, MAY_BE_NULL, 494), /* getDependencies return */ + reg::packed(538, MAY_BE_STRING), /* getKind return */ + reg::packed(538, 0, 9), /* getVar return */ + reg::packed(538, 0, 9), /* getAssignedExpr return */ + reg::packed(538, 0, 54), /* getBeforeScope return */ + reg::packed(538, 0, 54), /* getScope return */ + reg::packed(538, MAY_BE_BOOL), /* enterExpressionAssign return */ + reg::packed(538, MAY_BE_BOOL), /* isAssignOp return */ + reg::packed(538, MAY_BE_BOOL), /* hasYield return */ + reg::packed(538, MAY_BE_ARRAY), /* getThrowPoints return */ + reg::packed(538, MAY_BE_ARRAY), /* getImpurePoints return */ + reg::packed(538, MAY_BE_BOOL), /* isAlwaysTerminating return */ + reg::packed(538, 0, 9), /* getRootVar return */ + reg::packed(538, 0, 196), /* getVarResult return */ + reg::packed(538, MAY_BE_ARRAY), /* getDimFetchStack return */ + reg::packed(538, 0, 9), /* getAssignedPropertyExpr return */ + reg::packed(538, MAY_BE_ARRAY), /* getOffsetTypes return */ + reg::packed(538, MAY_BE_ARRAY), /* getOffsetNativeTypes return */ + reg::packed(538, MAY_BE_ARRAY), /* getExistingOffsetTypes return */ + reg::packed(538, MAY_BE_ARRAY), /* getExistingOffsetNativeTypes return */ + reg::packed(538, 0, 196), /* getOffsetSetTargetResult return */ + reg::packed(538, 0, 196), /* getObjectResult return */ + reg::packed(538, MAY_BE_NULL | MAY_BE_STRING), /* getPropertyName return */ + reg::packed(538, 0, 408), /* getPropertyHolderType return */ + reg::packed(538, 0, 196), /* getTargetReadResult return */ + reg::packed(538, MAY_BE_ARRAY), /* getTargetChainResults return */ + reg::packed(538, MAY_BE_NULL, 196), /* getVariableNameResult 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 = { { 534 /* __construct */, 11, 0, 27, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getDependencies = { { 547 /* getDependencies */, 0, 27, 0, 27, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getKind = { { 563 /* getKind */, 0, 28, 0, 28, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getVar = { { 571 /* getVar */, 0, 29, 0, 29, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getAssignedExpr = { { 578 /* getAssignedExpr */, 0, 30, 0, 30, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getBeforeScope = { { 594 /* getBeforeScope */, 0, 31, 0, 31, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getScope = { { 609 /* getScope */, 0, 32, 0, 32, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 526 /* __construct */, 27, 0, 27, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getDependencies = { { 539 /* getDependencies */, 0, 27, 0, 27, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getKind = { { 555 /* getKind */, 0, 28, 0, 28, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getVar = { { 563 /* getVar */, 0, 29, 0, 29, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getAssignedExpr = { { 570 /* getAssignedExpr */, 0, 30, 0, 30, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getBeforeScope = { { 586 /* getBeforeScope */, 0, 31, 0, 31, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getScope = { { 601 /* getScope */, 0, 32, 0, 32, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig enterExpressionAssign = { { 91 /* enterExpressionAssign */, 0, 33, 0, 33, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig isAssignOp = { { 113 /* isAssignOp */, 0, 34, 0, 34, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig hasYield = { { 124 /* hasYield */, 0, 35, 0, 35, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getThrowPoints = { { 618 /* getThrowPoints */, 0, 36, 0, 36, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getImpurePoints = { { 633 /* getImpurePoints */, 0, 37, 0, 37, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getThrowPoints = { { 610 /* getThrowPoints */, 0, 36, 0, 36, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getImpurePoints = { { 625 /* getImpurePoints */, 0, 37, 0, 37, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig isAlwaysTerminating = { { 158 /* isAlwaysTerminating */, 0, 38, 0, 38, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getRootVar = { { 649 /* getRootVar */, 0, 39, 0, 39, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getVarResult = { { 660 /* getVarResult */, 0, 40, 0, 40, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getDimFetchStack = { { 673 /* getDimFetchStack */, 0, 41, 0, 41, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getAssignedPropertyExpr = { { 690 /* getAssignedPropertyExpr */, 0, 42, 0, 42, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getOffsetTypes = { { 714 /* getOffsetTypes */, 0, 43, 0, 43, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getOffsetNativeTypes = { { 729 /* getOffsetNativeTypes */, 0, 44, 0, 44, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getExistingOffsetTypes = { { 750 /* getExistingOffsetTypes */, 0, 45, 0, 45, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getExistingOffsetNativeTypes = { { 773 /* getExistingOffsetNativeTypes */, 0, 46, 0, 46, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getOffsetSetTargetResult = { { 802 /* getOffsetSetTargetResult */, 0, 47, 0, 47, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getObjectResult = { { 827 /* getObjectResult */, 0, 48, 0, 48, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPropertyName = { { 843 /* getPropertyName */, 0, 49, 0, 49, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPropertyHolderType = { { 859 /* getPropertyHolderType */, 0, 50, 0, 50, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getTargetReadResult = { { 881 /* getTargetReadResult */, 0, 51, 0, 51, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getTargetChainResults = { { 901 /* getTargetChainResults */, 0, 52, 0, 52, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getVariableNameResult = { { 923 /* getVariableNameResult */, 0, 53, 0, 53, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getRootVar = { { 641 /* getRootVar */, 0, 39, 0, 39, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getVarResult = { { 652 /* getVarResult */, 0, 40, 0, 40, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getDimFetchStack = { { 665 /* getDimFetchStack */, 0, 41, 0, 41, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getAssignedPropertyExpr = { { 682 /* getAssignedPropertyExpr */, 0, 42, 0, 42, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getOffsetTypes = { { 706 /* getOffsetTypes */, 0, 43, 0, 43, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getOffsetNativeTypes = { { 721 /* getOffsetNativeTypes */, 0, 44, 0, 44, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getExistingOffsetTypes = { { 742 /* getExistingOffsetTypes */, 0, 45, 0, 45, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getExistingOffsetNativeTypes = { { 765 /* getExistingOffsetNativeTypes */, 0, 46, 0, 46, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getOffsetSetTargetResult = { { 794 /* getOffsetSetTargetResult */, 0, 47, 0, 47, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getObjectResult = { { 819 /* getObjectResult */, 0, 48, 0, 48, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPropertyName = { { 835 /* getPropertyName */, 0, 49, 0, 49, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPropertyHolderType = { { 851 /* getPropertyHolderType */, 0, 50, 0, 50, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getTargetReadResult = { { 873 /* getTargetReadResult */, 0, 51, 0, 51, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getTargetChainResults = { { 893 /* getTargetChainResults */, 0, 52, 0, 52, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getVariableNameResult = { { 915 /* getVariableNameResult */, 0, 53, 0, 53, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::PreparedAssignTarget diff --git a/turbo-ext/src/generated/ResolvedFunctionVariantWithOriginal.h b/turbo-ext/src/generated/ResolvedFunctionVariantWithOriginal.h index 47db27a51a7..79c639b14aa 100644 --- a/turbo-ext/src/generated/ResolvedFunctionVariantWithOriginal.h +++ b/turbo-ext/src/generated/ResolvedFunctionVariantWithOriginal.h @@ -81,20 +81,18 @@ inline constexpr char strings[] = "resolveConditionalTypes\0" /* 699 */ "positionVariance\0" /* 723 */ "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 740 */ - "null\0" /* 782 */ - "true\0" /* 787 */ - "resolveResolvableTemplateTypes\0" /* 792 */ - "template\0" /* 823 */ - "PHPStan\\Type\\Generic\\TemplateType\0" /* 832 */ - "inferred\0" /* 866 */ - "onlyCovariant\0" /* 875 */ - "unresolvedOrResolvedTemplateArgument\0" /* 889 */ - "narrowTemplateTypesInConditionalTypesForParameter\0" /* 926 */ - "parameterName\0" /* 976 */ - "getTemplateTypeBoundOnlyByParameter\0" /* 990 */ - "templateType\0" /* 1026 */ - "referencesTemplateType\0" /* 1039 */ - "resolveConditionalTypesForParameter"; /* 1062 */ + "resolveResolvableTemplateTypes\0" /* 782 */ + "template\0" /* 813 */ + "PHPStan\\Type\\Generic\\TemplateType\0" /* 822 */ + "inferred\0" /* 856 */ + "onlyCovariant\0" /* 865 */ + "unresolvedOrResolvedTemplateArgument\0" /* 879 */ + "narrowTemplateTypesInConditionalTypesForParameter\0" /* 916 */ + "parameterName\0" /* 966 */ + "getTemplateTypeBoundOnlyByParameter\0" /* 980 */ + "templateType\0" /* 1016 */ + "referencesTemplateType\0" /* 1029 */ + "resolveConditionalTypesForParameter"; /* 1052 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 19), /* __construct $parametersAcceptor */ reg::packed(65, 0, 89), /* __construct $resolvedTemplateTypeMap */ @@ -120,23 +118,23 @@ inline constexpr reg::PackedArg args[] = { reg::packed(214, 0, 377), /* resolveConditionalTypes return */ reg::packed(694, 0, 377), /* resolveResolvableTemplateTypes $type */ reg::packed(723, 0, 740), /* resolveResolvableTemplateTypes $positionVariance */ - reg::packed(501, MAY_BE_NULL, 506, false, false, 782), /* resolveResolvableTemplateTypes $site */ - reg::packed(526, MAY_BE_NULL, 532, false, false, 782), /* resolveResolvableTemplateTypes $frame */ - reg::packed(580, MAY_BE_BOOL, reg::NoString, false, false, 787), /* resolveResolvableTemplateTypes $allowUnresolved */ + reg::packed(501, MAY_BE_NULL, 506), /* resolveResolvableTemplateTypes $site */ + reg::packed(526, MAY_BE_NULL, 532), /* resolveResolvableTemplateTypes $frame */ + reg::packed(580, MAY_BE_BOOL), /* resolveResolvableTemplateTypes $allowUnresolved */ reg::packed(214, 0, 377), /* resolveResolvableTemplateTypes return */ - reg::packed(823, 0, 832), /* unresolvedOrResolvedTemplateArgument $template */ - reg::packed(866, 0, 377), /* unresolvedOrResolvedTemplateArgument $inferred */ + reg::packed(813, 0, 822), /* unresolvedOrResolvedTemplateArgument $template */ + reg::packed(856, 0, 377), /* unresolvedOrResolvedTemplateArgument $inferred */ reg::packed(501, 0, 506), /* unresolvedOrResolvedTemplateArgument $site */ reg::packed(526, 0, 532), /* unresolvedOrResolvedTemplateArgument $frame */ reg::packed(580, MAY_BE_BOOL), /* unresolvedOrResolvedTemplateArgument $allowUnresolved */ - reg::packed(875, MAY_BE_BOOL), /* unresolvedOrResolvedTemplateArgument $onlyCovariant */ + reg::packed(865, MAY_BE_BOOL), /* unresolvedOrResolvedTemplateArgument $onlyCovariant */ reg::packed(214, 0, 377), /* unresolvedOrResolvedTemplateArgument return */ reg::packed(694, 0, 377), /* narrowTemplateTypesInConditionalTypesForParameter $type */ reg::packed(214, 0, 377), /* narrowTemplateTypesInConditionalTypesForParameter return */ - reg::packed(976, MAY_BE_STRING), /* getTemplateTypeBoundOnlyByParameter $parameterName */ - reg::packed(214, MAY_BE_NULL, 832), /* getTemplateTypeBoundOnlyByParameter return */ + reg::packed(966, MAY_BE_STRING), /* getTemplateTypeBoundOnlyByParameter $parameterName */ + reg::packed(214, MAY_BE_NULL, 822), /* getTemplateTypeBoundOnlyByParameter return */ reg::packed(694, 0, 377), /* referencesTemplateType $type */ - reg::packed(1026, 0, 832), /* referencesTemplateType $templateType */ + reg::packed(1016, 0, 822), /* referencesTemplateType $templateType */ reg::packed(214, MAY_BE_BOOL), /* referencesTemplateType return */ reg::packed(694, 0, 377), /* resolveConditionalTypesForParameter $type */ reg::packed(214, 0, 377), /* resolveConditionalTypesForParameter return */ @@ -161,12 +159,12 @@ inline constexpr sigtab::Sig getPhpDocReturnType = { { 641 /* getPhpDocReturnTyp inline constexpr sigtab::Sig getNativeReturnType = { { 661 /* getNativeReturnType */, 0, 18, 0, 18, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig hasBoundArgs = { { 681 /* hasBoundArgs */, 0, 19, 0, 19, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig resolveConditionalTypes = { { 699 /* resolveConditionalTypes */, 1, 20, 1, 21, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig resolveResolvableTemplateTypes = { { 792 /* resolveResolvableTemplateTypes */, 2, 22, 5, 27, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig unresolvedOrResolvedTemplateArgument = { { 889 /* unresolvedOrResolvedTemplateArgument */, 6, 28, 6, 34, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig narrowTemplateTypesInConditionalTypesForParameter = { { 926 /* narrowTemplateTypesInConditionalTypesForParameter */, 1, 35, 1, 36, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getTemplateTypeBoundOnlyByParameter = { { 990 /* getTemplateTypeBoundOnlyByParameter */, 1, 37, 1, 38, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig referencesTemplateType = { { 1039 /* referencesTemplateType */, 2, 39, 2, 41, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig resolveConditionalTypesForParameter = { { 1062 /* resolveConditionalTypesForParameter */, 1, 42, 1, 43, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveResolvableTemplateTypes = { { 782 /* resolveResolvableTemplateTypes */, 5, 22, 5, 27, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig unresolvedOrResolvedTemplateArgument = { { 879 /* unresolvedOrResolvedTemplateArgument */, 6, 28, 6, 34, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig narrowTemplateTypesInConditionalTypesForParameter = { { 916 /* narrowTemplateTypesInConditionalTypesForParameter */, 1, 35, 1, 36, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getTemplateTypeBoundOnlyByParameter = { { 980 /* getTemplateTypeBoundOnlyByParameter */, 1, 37, 1, 38, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig referencesTemplateType = { { 1029 /* referencesTemplateType */, 2, 39, 2, 41, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig resolveConditionalTypesForParameter = { { 1052 /* resolveConditionalTypesForParameter */, 1, 42, 1, 43, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::ResolvedFunctionVariantWithOriginal diff --git a/turbo-ext/src/generated/RicherScopeGetTypeHelper.h b/turbo-ext/src/generated/RicherScopeGetTypeHelper.h index 63e4ec8be90..9ebe57b9d81 100644 --- a/turbo-ext/src/generated/RicherScopeGetTypeHelper.h +++ b/turbo-ext/src/generated/RicherScopeGetTypeHelper.h @@ -40,30 +40,29 @@ inline constexpr char strings[] = "PhpParser\\Node\\Expr\\BinaryOp\\Identical\0" /* 196 */ "nodeScopeResolver\0" /* 235 */ "PHPStan\\Analyser\\NodeScopeResolver\0" /* 253 */ - "null\0" /* 288 */ - "leftType\0" /* 293 */ - "PHPStan\\Type\\Type\0" /* 302 */ - "rightType\0" /* 320 */ - "\0" /* 330 */ - "PHPStan\\Type\\TypeResult\0" /* 331 */ - "getIdenticalResult\0" /* 355 */ - "PhpParser\\Node\\Expr\\BinaryOp\\NotIdentical\0" /* 374 */ - "getNotIdenticalResult"; /* 416 */ + "leftType\0" /* 288 */ + "PHPStan\\Type\\Type\0" /* 297 */ + "rightType\0" /* 315 */ + "\0" /* 325 */ + "PHPStan\\Type\\TypeResult\0" /* 326 */ + "getIdenticalResult\0" /* 350 */ + "PhpParser\\Node\\Expr\\BinaryOp\\NotIdentical\0" /* 369 */ + "getNotIdenticalResult"; /* 411 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 28), /* __construct $initializerExprTypeResolver */ reg::packed(75, 0, 100), /* __construct $propertyReflectionFinder */ reg::packed(162, 0, 168), /* getIdenticalResult $scope */ reg::packed(191, 0, 196), /* getIdenticalResult $expr */ - reg::packed(235, MAY_BE_NULL, 253, false, false, 288), /* getIdenticalResult $nodeScopeResolver */ - reg::packed(293, MAY_BE_NULL, 302, false, false, 288), /* getIdenticalResult $leftType */ - reg::packed(320, MAY_BE_NULL, 302, false, false, 288), /* getIdenticalResult $rightType */ - reg::packed(330, 0, 331), /* getIdenticalResult return */ + reg::packed(235, MAY_BE_NULL, 253), /* getIdenticalResult $nodeScopeResolver */ + reg::packed(288, MAY_BE_NULL, 297), /* getIdenticalResult $leftType */ + reg::packed(315, MAY_BE_NULL, 297), /* getIdenticalResult $rightType */ + reg::packed(325, 0, 326), /* getIdenticalResult return */ reg::packed(162, 0, 168), /* getNotIdenticalResult $scope */ - reg::packed(191, 0, 374), /* getNotIdenticalResult $expr */ - reg::packed(235, MAY_BE_NULL, 253, false, false, 288), /* getNotIdenticalResult $nodeScopeResolver */ - reg::packed(293, MAY_BE_NULL, 302, false, false, 288), /* getNotIdenticalResult $leftType */ - reg::packed(320, MAY_BE_NULL, 302, false, false, 288), /* getNotIdenticalResult $rightType */ - reg::packed(330, 0, 331), /* getNotIdenticalResult return */ + reg::packed(191, 0, 369), /* getNotIdenticalResult $expr */ + reg::packed(235, MAY_BE_NULL, 253), /* getNotIdenticalResult $nodeScopeResolver */ + reg::packed(288, MAY_BE_NULL, 297), /* getNotIdenticalResult $leftType */ + reg::packed(315, MAY_BE_NULL, 297), /* getNotIdenticalResult $rightType */ + reg::packed(325, 0, 326), /* getNotIdenticalResult return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -71,8 +70,8 @@ using Sig = reg::Sig; /* 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 = { { 150 /* __construct */, 2, 0, 2, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getIdenticalResult = { { 355 /* getIdenticalResult */, 2, 2, 5, 7, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getNotIdenticalResult = { { 416 /* getNotIdenticalResult */, 2, 8, 5, 13, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getIdenticalResult = { { 350 /* getIdenticalResult */, 5, 2, 5, 7, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getNotIdenticalResult = { { 411 /* getNotIdenticalResult */, 5, 8, 5, 13, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::RicherScopeGetTypeHelper diff --git a/turbo-ext/src/generated/ScopeOps.h b/turbo-ext/src/generated/ScopeOps.h index 65adcaa4fb6..ba94e01e346 100644 --- a/turbo-ext/src/generated/ScopeOps.h +++ b/turbo-ext/src/generated/ScopeOps.h @@ -51,41 +51,38 @@ inline constexpr char strings[] = "ourVariableTypeHolders\0" /* 451 */ "theirVariableTypeHolders\0" /* 474 */ "differingKeys\0" /* 499 */ - "[]\0" /* 513 */ - "mergeVariableHolders\0" /* 516 */ - "mergedExpressionTypes\0" /* 537 */ - "ourExpressionTypes\0" /* 559 */ - "theirExpressionTypes\0" /* 578 */ - "ourNativeExpressionTypes\0" /* 599 */ - "theirNativeExpressionTypes\0" /* 624 */ - "finishMerge\0" /* 651 */ - "ourConditionalExpressions\0" /* 663 */ - "theirConditionalExpressions\0" /* 689 */ - "intersectConditionalExpressions\0" /* 717 */ - "expr\0" /* 749 */ - "canBeUndefined\0" /* 754 */ - "createConditionalExpressions\0" /* 769 */ - "exprStringToInvalidate\0" /* 798 */ - "invalidateMethodsOnExpression\0" /* 821 */ - "keyMayHideSubExpressions\0" /* 851 */ - "getIntertwinedRefRootVariableName\0" /* 876 */ - "expressionToInvalidate\0" /* 910 */ - "requireMoreCharacters\0" /* 933 */ - "invalidatingClass\0" /* 955 */ - "PHPStan\\Reflection\\ClassReflection\0" /* 973 */ - "keepPropertyFetches\0" /* 1008 */ - "false\0" /* 1028 */ - "invalidateExpressionEntries\0" /* 1034 */ - "PHPStan\\Analyser\\Scope\0" /* 1062 */ - "PhpParser\\Node\0" /* 1085 */ - "expressionToInvalidateClass\0" /* 1100 */ - "containsExpressionToInvalidate\0" /* 1128 */ - "exprToInvalidate\0" /* 1159 */ - "null\0" /* 1176 */ - "shouldInvalidateExpression\0" /* 1181 */ - "isPropertyFetchChainOn\0" /* 1208 */ - "specifiedExpressions\0" /* 1231 */ - "matchConditionalExpressions"; /* 1252 */ + "mergeVariableHolders\0" /* 513 */ + "mergedExpressionTypes\0" /* 534 */ + "ourExpressionTypes\0" /* 556 */ + "theirExpressionTypes\0" /* 575 */ + "ourNativeExpressionTypes\0" /* 596 */ + "theirNativeExpressionTypes\0" /* 621 */ + "finishMerge\0" /* 648 */ + "ourConditionalExpressions\0" /* 660 */ + "theirConditionalExpressions\0" /* 686 */ + "intersectConditionalExpressions\0" /* 714 */ + "expr\0" /* 746 */ + "canBeUndefined\0" /* 751 */ + "createConditionalExpressions\0" /* 766 */ + "exprStringToInvalidate\0" /* 795 */ + "invalidateMethodsOnExpression\0" /* 818 */ + "keyMayHideSubExpressions\0" /* 848 */ + "getIntertwinedRefRootVariableName\0" /* 873 */ + "expressionToInvalidate\0" /* 907 */ + "requireMoreCharacters\0" /* 930 */ + "invalidatingClass\0" /* 952 */ + "PHPStan\\Reflection\\ClassReflection\0" /* 970 */ + "keepPropertyFetches\0" /* 1005 */ + "invalidateExpressionEntries\0" /* 1025 */ + "PHPStan\\Analyser\\Scope\0" /* 1053 */ + "PhpParser\\Node\0" /* 1076 */ + "expressionToInvalidateClass\0" /* 1091 */ + "containsExpressionToInvalidate\0" /* 1119 */ + "exprToInvalidate\0" /* 1150 */ + "shouldInvalidateExpression\0" /* 1167 */ + "isPropertyFetchChainOn\0" /* 1194 */ + "specifiedExpressions\0" /* 1217 */ + "matchConditionalExpressions"; /* 1238 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 5), /* nodeKey $node */ reg::packed(25, 0, 37), /* nodeKey $exprPrinter */ @@ -117,67 +114,67 @@ inline constexpr reg::PackedArg args[] = { reg::packed(70, 0, 85), /* scopeWith return */ reg::packed(451, MAY_BE_ARRAY), /* mergeVariableHolders $ourVariableTypeHolders */ reg::packed(474, MAY_BE_ARRAY), /* mergeVariableHolders $theirVariableTypeHolders */ - reg::packed(499, MAY_BE_ARRAY, reg::NoString, true, false, 513), /* mergeVariableHolders $differingKeys */ + reg::packed(499, MAY_BE_ARRAY, reg::NoString, true, false), /* mergeVariableHolders $differingKeys */ reg::packed(70, MAY_BE_ARRAY), /* mergeVariableHolders return */ - reg::packed(537, MAY_BE_ARRAY), /* finishMerge $mergedExpressionTypes */ - reg::packed(559, MAY_BE_ARRAY), /* finishMerge $ourExpressionTypes */ - reg::packed(578, MAY_BE_ARRAY), /* finishMerge $theirExpressionTypes */ - reg::packed(599, MAY_BE_ARRAY), /* finishMerge $ourNativeExpressionTypes */ - reg::packed(624, MAY_BE_ARRAY), /* finishMerge $theirNativeExpressionTypes */ + reg::packed(534, MAY_BE_ARRAY), /* finishMerge $mergedExpressionTypes */ + reg::packed(556, MAY_BE_ARRAY), /* finishMerge $ourExpressionTypes */ + reg::packed(575, MAY_BE_ARRAY), /* finishMerge $theirExpressionTypes */ + reg::packed(596, MAY_BE_ARRAY), /* finishMerge $ourNativeExpressionTypes */ + reg::packed(621, MAY_BE_ARRAY), /* finishMerge $theirNativeExpressionTypes */ reg::packed(70, MAY_BE_ARRAY), /* finishMerge return */ - reg::packed(663, MAY_BE_ARRAY), /* intersectConditionalExpressions $ourConditionalExpressions */ - reg::packed(689, MAY_BE_ARRAY), /* intersectConditionalExpressions $theirConditionalExpressions */ + reg::packed(660, MAY_BE_ARRAY), /* intersectConditionalExpressions $ourConditionalExpressions */ + reg::packed(686, MAY_BE_ARRAY), /* intersectConditionalExpressions $theirConditionalExpressions */ reg::packed(70, MAY_BE_ARRAY), /* intersectConditionalExpressions return */ - reg::packed(749, 0, 5), /* canBeUndefined $expr */ + reg::packed(746, 0, 5), /* canBeUndefined $expr */ reg::packed(70, MAY_BE_BOOL), /* canBeUndefined return */ reg::packed(292, MAY_BE_ARRAY), /* createConditionalExpressions $conditionalExpressions */ - reg::packed(559, MAY_BE_ARRAY), /* createConditionalExpressions $ourExpressionTypes */ - reg::packed(578, MAY_BE_ARRAY), /* createConditionalExpressions $theirExpressionTypes */ - reg::packed(537, MAY_BE_ARRAY), /* createConditionalExpressions $mergedExpressionTypes */ + reg::packed(556, MAY_BE_ARRAY), /* createConditionalExpressions $ourExpressionTypes */ + reg::packed(575, MAY_BE_ARRAY), /* createConditionalExpressions $theirExpressionTypes */ + reg::packed(534, MAY_BE_ARRAY), /* createConditionalExpressions $mergedExpressionTypes */ reg::packed(499, MAY_BE_ARRAY), /* createConditionalExpressions $differingKeys */ reg::packed(70, MAY_BE_ARRAY), /* createConditionalExpressions return */ reg::packed(25, 0, 37), /* invalidateMethodsOnExpression $exprPrinter */ - reg::packed(798, MAY_BE_STRING), /* invalidateMethodsOnExpression $exprStringToInvalidate */ + reg::packed(795, MAY_BE_STRING), /* invalidateMethodsOnExpression $exprStringToInvalidate */ reg::packed(254, MAY_BE_ARRAY), /* invalidateMethodsOnExpression $expressionTypes */ reg::packed(270, MAY_BE_ARRAY), /* invalidateMethodsOnExpression $nativeExpressionTypes */ reg::packed(70, MAY_BE_NULL | MAY_BE_ARRAY), /* invalidateMethodsOnExpression return */ reg::packed(155, MAY_BE_STRING), /* keyMayHideSubExpressions $exprString */ reg::packed(70, MAY_BE_BOOL), /* keyMayHideSubExpressions return */ - reg::packed(749, 0, 5), /* getIntertwinedRefRootVariableName $expr */ + reg::packed(746, 0, 5), /* getIntertwinedRefRootVariableName $expr */ reg::packed(70, MAY_BE_NULL | MAY_BE_STRING), /* getIntertwinedRefRootVariableName return */ reg::packed(79, 0, 85), /* invalidateExpressionEntries $scope */ reg::packed(25, 0, 37), /* invalidateExpressionEntries $exprPrinter */ - reg::packed(798, MAY_BE_STRING), /* invalidateExpressionEntries $exprStringToInvalidate */ - reg::packed(910, 0, 5), /* invalidateExpressionEntries $expressionToInvalidate */ - reg::packed(933, MAY_BE_BOOL), /* invalidateExpressionEntries $requireMoreCharacters */ - reg::packed(955, MAY_BE_NULL, 973), /* invalidateExpressionEntries $invalidatingClass */ + reg::packed(795, MAY_BE_STRING), /* invalidateExpressionEntries $exprStringToInvalidate */ + reg::packed(907, 0, 5), /* invalidateExpressionEntries $expressionToInvalidate */ + reg::packed(930, MAY_BE_BOOL), /* invalidateExpressionEntries $requireMoreCharacters */ + reg::packed(952, MAY_BE_NULL, 970), /* invalidateExpressionEntries $invalidatingClass */ reg::packed(254, MAY_BE_ARRAY), /* invalidateExpressionEntries $expressionTypes */ reg::packed(270, MAY_BE_ARRAY), /* invalidateExpressionEntries $nativeExpressionTypes */ reg::packed(292, MAY_BE_ARRAY), /* invalidateExpressionEntries $conditionalExpressions */ - reg::packed(1008, MAY_BE_BOOL, reg::NoString, false, false, 1028), /* invalidateExpressionEntries $keepPropertyFetches */ + reg::packed(1005, MAY_BE_BOOL), /* invalidateExpressionEntries $keepPropertyFetches */ reg::packed(70, MAY_BE_NULL | MAY_BE_ARRAY), /* invalidateExpressionEntries return */ - reg::packed(79, 0, 1062), /* containsExpressionToInvalidate $scope */ + reg::packed(79, 0, 1053), /* containsExpressionToInvalidate $scope */ reg::packed(25, 0, 37), /* containsExpressionToInvalidate $exprPrinter */ - reg::packed(0, 0, 1085), /* containsExpressionToInvalidate $node */ - reg::packed(1100, MAY_BE_STRING), /* containsExpressionToInvalidate $expressionToInvalidateClass */ - reg::packed(798, MAY_BE_STRING), /* containsExpressionToInvalidate $exprStringToInvalidate */ + reg::packed(0, 0, 1076), /* containsExpressionToInvalidate $node */ + reg::packed(1091, MAY_BE_STRING), /* containsExpressionToInvalidate $expressionToInvalidateClass */ + reg::packed(795, MAY_BE_STRING), /* containsExpressionToInvalidate $exprStringToInvalidate */ reg::packed(70, MAY_BE_BOOL), /* containsExpressionToInvalidate return */ reg::packed(79, 0, 85), /* shouldInvalidateExpression $scope */ reg::packed(25, 0, 37), /* shouldInvalidateExpression $exprPrinter */ - reg::packed(798, MAY_BE_STRING), /* shouldInvalidateExpression $exprStringToInvalidate */ - reg::packed(1159, 0, 5), /* shouldInvalidateExpression $exprToInvalidate */ - reg::packed(749, 0, 5), /* shouldInvalidateExpression $expr */ + reg::packed(795, MAY_BE_STRING), /* shouldInvalidateExpression $exprStringToInvalidate */ + reg::packed(1150, 0, 5), /* shouldInvalidateExpression $exprToInvalidate */ + reg::packed(746, 0, 5), /* shouldInvalidateExpression $expr */ reg::packed(155, MAY_BE_STRING), /* shouldInvalidateExpression $exprString */ - reg::packed(933, MAY_BE_BOOL, reg::NoString, false, false, 1028), /* shouldInvalidateExpression $requireMoreCharacters */ - reg::packed(955, MAY_BE_NULL, 973, false, false, 1176), /* shouldInvalidateExpression $invalidatingClass */ - reg::packed(1008, MAY_BE_BOOL, reg::NoString, false, false, 1028), /* shouldInvalidateExpression $keepPropertyFetches */ + reg::packed(930, MAY_BE_BOOL), /* shouldInvalidateExpression $requireMoreCharacters */ + reg::packed(952, MAY_BE_NULL, 970), /* shouldInvalidateExpression $invalidatingClass */ + reg::packed(1005, MAY_BE_BOOL), /* shouldInvalidateExpression $keepPropertyFetches */ reg::packed(70, MAY_BE_BOOL), /* shouldInvalidateExpression return */ - reg::packed(749, 0, 5), /* isPropertyFetchChainOn $expr */ - reg::packed(798, MAY_BE_STRING), /* isPropertyFetchChainOn $exprStringToInvalidate */ + reg::packed(746, 0, 5), /* isPropertyFetchChainOn $expr */ + reg::packed(795, MAY_BE_STRING), /* isPropertyFetchChainOn $exprStringToInvalidate */ reg::packed(25, 0, 37), /* isPropertyFetchChainOn $exprPrinter */ reg::packed(70, MAY_BE_BOOL), /* isPropertyFetchChainOn return */ reg::packed(292, MAY_BE_ARRAY), /* matchConditionalExpressions $conditionalExpressions */ - reg::packed(1231, MAY_BE_ARRAY), /* matchConditionalExpressions $specifiedExpressions */ + reg::packed(1217, MAY_BE_ARRAY), /* matchConditionalExpressions $specifiedExpressions */ reg::packed(70, MAY_BE_ARRAY), /* matchConditionalExpressions return */ }; using Sig = reg::Sig; @@ -191,19 +188,19 @@ inline constexpr sigtab::Sig expressionTypeByKey = { { 166 /* expressionTypeByKe inline constexpr sigtab::Sig hasExpressionType = { { 207 /* hasExpressionType */, 3, 11, 3, 14, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig hasVariableType = { { 238 /* hasVariableType */, 2, 15, 2, 17, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig scopeWith = { { 441 /* scopeWith */, 9, 18, 9, 27, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig mergeVariableHolders = { { 516 /* mergeVariableHolders */, 2, 28, 3, 31, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig finishMerge = { { 651 /* finishMerge */, 5, 32, 5, 37, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig intersectConditionalExpressions = { { 717 /* intersectConditionalExpressions */, 2, 38, 2, 40, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig canBeUndefined = { { 754 /* canBeUndefined */, 1, 41, 1, 42, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig createConditionalExpressions = { { 769 /* createConditionalExpressions */, 5, 43, 5, 48, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig invalidateMethodsOnExpression = { { 821 /* invalidateMethodsOnExpression */, 4, 49, 4, 53, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig keyMayHideSubExpressions = { { 851 /* keyMayHideSubExpressions */, 1, 54, 1, 55, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig getIntertwinedRefRootVariableName = { { 876 /* getIntertwinedRefRootVariableName */, 1, 56, 1, 57, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig invalidateExpressionEntries = { { 1034 /* invalidateExpressionEntries */, 9, 58, 10, 68, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig containsExpressionToInvalidate = { { 1128 /* containsExpressionToInvalidate */, 5, 69, 5, 74, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig shouldInvalidateExpression = { { 1181 /* shouldInvalidateExpression */, 6, 75, 9, 84, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig isPropertyFetchChainOn = { { 1208 /* isPropertyFetchChainOn */, 3, 85, 3, 88, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig matchConditionalExpressions = { { 1252 /* matchConditionalExpressions */, 2, 89, 2, 91, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig mergeVariableHolders = { { 513 /* mergeVariableHolders */, 3, 28, 3, 31, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig finishMerge = { { 648 /* finishMerge */, 5, 32, 5, 37, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig intersectConditionalExpressions = { { 714 /* intersectConditionalExpressions */, 2, 38, 2, 40, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig canBeUndefined = { { 751 /* canBeUndefined */, 1, 41, 1, 42, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig createConditionalExpressions = { { 766 /* createConditionalExpressions */, 5, 43, 5, 48, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig invalidateMethodsOnExpression = { { 818 /* invalidateMethodsOnExpression */, 4, 49, 4, 53, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig keyMayHideSubExpressions = { { 848 /* keyMayHideSubExpressions */, 1, 54, 1, 55, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig getIntertwinedRefRootVariableName = { { 873 /* getIntertwinedRefRootVariableName */, 1, 56, 1, 57, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig invalidateExpressionEntries = { { 1025 /* invalidateExpressionEntries */, 10, 58, 10, 68, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig containsExpressionToInvalidate = { { 1119 /* containsExpressionToInvalidate */, 5, 69, 5, 74, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig shouldInvalidateExpression = { { 1167 /* shouldInvalidateExpression */, 9, 75, 9, 84, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig isPropertyFetchChainOn = { { 1194 /* isPropertyFetchChainOn */, 3, 85, 3, 88, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig matchConditionalExpressions = { { 1238 /* matchConditionalExpressions */, 2, 89, 2, 91, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; } // namespace sig } // namespace ptdecl::ScopeOps diff --git a/turbo-ext/src/generated/StaticCallHandler.h b/turbo-ext/src/generated/StaticCallHandler.h index fa4fb3b8676..657644f9b29 100644 --- a/turbo-ext/src/generated/StaticCallHandler.h +++ b/turbo-ext/src/generated/StaticCallHandler.h @@ -99,16 +99,15 @@ inline constexpr char strings[] = "walkMethodReflection\0" /* 1254 */ "PHPStan\\Reflection\\ExtendedMethodReflection\0" /* 1275 */ "PHPStan\\Analyser\\TypeSpecifierContext\0" /* 1319 */ - "null\0" /* 1357 */ - "PHPStan\\Analyser\\SpecifiedTypes\0" /* 1362 */ - "specifyTypes\0" /* 1394 */ - "defaultStaticCallNarrowing\0" /* 1407 */ - "isStaticCallNarrowable\0" /* 1434 */ - "class\0" /* 1457 */ - "PhpParser\\Node\\Name\0" /* 1463 */ - "methodName\0" /* 1483 */ - "PHPStan\\Type\\TypeWithClassName\0" /* 1494 */ - "resolveTypeByNameWithLateStaticBinding"; /* 1525 */ + "PHPStan\\Analyser\\SpecifiedTypes\0" /* 1357 */ + "specifyTypes\0" /* 1389 */ + "defaultStaticCallNarrowing\0" /* 1402 */ + "isStaticCallNarrowable\0" /* 1429 */ + "class\0" /* 1452 */ + "PhpParser\\Node\\Name\0" /* 1458 */ + "methodName\0" /* 1478 */ + "PHPStan\\Type\\TypeWithClassName\0" /* 1489 */ + "resolveTypeByNameWithLateStaticBinding"; /* 1520 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 27), /* __construct $methodCallReturnTypeHelper */ reg::packed(90, 0, 113), /* __construct $methodThrowPointHelper */ @@ -145,21 +144,21 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1227, MAY_BE_NULL, 1099), /* specifyTypes $resolvedParametersAcceptor */ reg::packed(1254, MAY_BE_NULL, 1275), /* specifyTypes $walkMethodReflection */ reg::packed(900, 0, 1319), /* specifyTypes $context */ - reg::packed(1137, MAY_BE_NULL, 1148, false, false, 1357), /* specifyTypes $argsResult */ - reg::packed(713, 0, 1362), /* specifyTypes return */ + reg::packed(1137, MAY_BE_NULL, 1148), /* specifyTypes $argsResult */ + reg::packed(713, 0, 1357), /* specifyTypes return */ reg::packed(801, 0, 807), /* defaultStaticCallNarrowing $scope */ reg::packed(688, 0, 693), /* defaultStaticCallNarrowing $expr */ reg::packed(1056, MAY_BE_NULL, 943), /* defaultStaticCallNarrowing $classResult */ reg::packed(900, 0, 1319), /* defaultStaticCallNarrowing $context */ - reg::packed(713, 0, 1362), /* defaultStaticCallNarrowing return */ + reg::packed(713, 0, 1357), /* defaultStaticCallNarrowing return */ reg::packed(801, 0, 807), /* isStaticCallNarrowable $scope */ reg::packed(688, 0, 693), /* isStaticCallNarrowable $expr */ reg::packed(1056, MAY_BE_NULL, 943), /* isStaticCallNarrowable $classResult */ reg::packed(713, MAY_BE_BOOL), /* isStaticCallNarrowable return */ reg::packed(801, 0, 807), /* resolveTypeByNameWithLateStaticBinding $scope */ - reg::packed(1457, 0, 1463), /* resolveTypeByNameWithLateStaticBinding $class */ - reg::packed(1483, MAY_BE_STRING), /* resolveTypeByNameWithLateStaticBinding $methodName */ - reg::packed(713, 0, 1494), /* resolveTypeByNameWithLateStaticBinding return */ + reg::packed(1452, 0, 1458), /* resolveTypeByNameWithLateStaticBinding $class */ + reg::packed(1478, MAY_BE_STRING), /* resolveTypeByNameWithLateStaticBinding $methodName */ + reg::packed(713, 0, 1489), /* resolveTypeByNameWithLateStaticBinding return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -170,10 +169,10 @@ inline constexpr sigtab::Sig __construct = { { 676 /* __construct */, 10, 0, 10, inline constexpr sigtab::Sig supports = { { 714 /* supports */, 1, 10, 1, 11, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig processExpr = { { 977 /* processExpr */, 7, 12, 7, 19, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig resolveReturnType = { { 1194 /* resolveReturnType */, 7, 20, 7, 27, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig specifyTypes = { { 1394 /* specifyTypes */, 7, 28, 8, 36, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig defaultStaticCallNarrowing = { { 1407 /* defaultStaticCallNarrowing */, 4, 37, 4, 41, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isStaticCallNarrowable = { { 1434 /* isStaticCallNarrowable */, 3, 42, 3, 45, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveTypeByNameWithLateStaticBinding = { { 1525 /* resolveTypeByNameWithLateStaticBinding */, 3, 46, 3, 49, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig specifyTypes = { { 1389 /* specifyTypes */, 8, 28, 8, 36, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig defaultStaticCallNarrowing = { { 1402 /* defaultStaticCallNarrowing */, 4, 37, 4, 41, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isStaticCallNarrowable = { { 1429 /* isStaticCallNarrowable */, 3, 42, 3, 45, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveTypeByNameWithLateStaticBinding = { { 1520 /* resolveTypeByNameWithLateStaticBinding */, 3, 46, 3, 49, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::StaticCallHandler diff --git a/turbo-ext/src/generated/TemplateArgumentConstraints.h b/turbo-ext/src/generated/TemplateArgumentConstraints.h index a99892d298e..e4e7522e188 100644 --- a/turbo-ext/src/generated/TemplateArgumentConstraints.h +++ b/turbo-ext/src/generated/TemplateArgumentConstraints.h @@ -35,70 +35,69 @@ namespace sigtab { inline constexpr char strings[] = "left\0" /* 0 */ "PHPStan\\Analyser\\Generics\\TemplateArgumentConstraints\0" /* 5 */ - "null\0" /* 59 */ - "right\0" /* 64 */ - "fact\0" /* 70 */ - "until\0" /* 75 */ - "__construct\0" /* 81 */ - "\0" /* 93 */ - "createEmpty\0" /* 94 */ - "isEmpty\0" /* 106 */ - "other\0" /* 114 */ - "merge\0" /* 120 */ - "entry\0" /* 126 */ - "exit\0" /* 132 */ - "withRecordedFacts\0" /* 137 */ - "marker\0" /* 155 */ - "PHPStan\\Type\\Generic\\UnresolvedTemplateArgumentType\0" /* 162 */ - "withSite\0" /* 214 */ - "type\0" /* 223 */ - "PHPStan\\Type\\Type\0" /* 228 */ - "variance\0" /* 246 */ - "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 255 */ - "withSend\0" /* 297 */ - "withLowerBound\0" /* 306 */ - "withUnconstrainingSend\0" /* 321 */ - "getFacts"; /* 344 */ + "right\0" /* 59 */ + "fact\0" /* 65 */ + "until\0" /* 70 */ + "__construct\0" /* 76 */ + "\0" /* 88 */ + "createEmpty\0" /* 89 */ + "isEmpty\0" /* 101 */ + "other\0" /* 109 */ + "merge\0" /* 115 */ + "entry\0" /* 121 */ + "exit\0" /* 127 */ + "withRecordedFacts\0" /* 132 */ + "marker\0" /* 150 */ + "PHPStan\\Type\\Generic\\UnresolvedTemplateArgumentType\0" /* 157 */ + "withSite\0" /* 209 */ + "type\0" /* 218 */ + "PHPStan\\Type\\Type\0" /* 223 */ + "variance\0" /* 241 */ + "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 250 */ + "withSend\0" /* 292 */ + "withLowerBound\0" /* 301 */ + "withUnconstrainingSend\0" /* 316 */ + "getFacts"; /* 339 */ inline constexpr reg::PackedArg args[] = { - reg::packed(0, MAY_BE_NULL, 5, false, false, 59), /* __construct $left */ - reg::packed(64, MAY_BE_NULL, 5, false, false, 59), /* __construct $right */ - reg::packed(70, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 59), /* __construct $fact */ - reg::packed(75, MAY_BE_NULL, 5, false, false, 59), /* __construct $until */ - reg::packed(93, 0, 5), /* createEmpty return */ - reg::packed(93, MAY_BE_BOOL), /* isEmpty return */ - reg::packed(114, 0, 5), /* merge $other */ - reg::packed(93, 0, 5), /* merge return */ - reg::packed(126, MAY_BE_NULL, 5), /* withRecordedFacts $entry */ - reg::packed(132, 0, 5), /* withRecordedFacts $exit */ - reg::packed(93, 0, 5), /* withRecordedFacts return */ - reg::packed(155, 0, 162), /* withSite $marker */ - reg::packed(93, 0, 5), /* withSite return */ - reg::packed(155, 0, 162), /* withSend $marker */ - reg::packed(223, 0, 228), /* withSend $type */ - reg::packed(246, 0, 255), /* withSend $variance */ - reg::packed(93, 0, 5), /* withSend return */ - reg::packed(155, 0, 162), /* withLowerBound $marker */ - reg::packed(223, 0, 228), /* withLowerBound $type */ - reg::packed(93, 0, 5), /* withLowerBound return */ - reg::packed(155, 0, 162), /* withUnconstrainingSend $marker */ - reg::packed(93, 0, 5), /* withUnconstrainingSend return */ - reg::packed(93, _ZEND_TYPE_ITERABLE_BIT), /* getFacts return */ + reg::packed(0, MAY_BE_NULL, 5), /* __construct $left */ + reg::packed(59, MAY_BE_NULL, 5), /* __construct $right */ + reg::packed(65, MAY_BE_NULL | MAY_BE_ARRAY), /* __construct $fact */ + reg::packed(70, MAY_BE_NULL, 5), /* __construct $until */ + reg::packed(88, 0, 5), /* createEmpty return */ + reg::packed(88, MAY_BE_BOOL), /* isEmpty return */ + reg::packed(109, 0, 5), /* merge $other */ + reg::packed(88, 0, 5), /* merge return */ + reg::packed(121, MAY_BE_NULL, 5), /* withRecordedFacts $entry */ + reg::packed(127, 0, 5), /* withRecordedFacts $exit */ + reg::packed(88, 0, 5), /* withRecordedFacts return */ + reg::packed(150, 0, 157), /* withSite $marker */ + reg::packed(88, 0, 5), /* withSite return */ + reg::packed(150, 0, 157), /* withSend $marker */ + reg::packed(218, 0, 223), /* withSend $type */ + reg::packed(241, 0, 250), /* withSend $variance */ + reg::packed(88, 0, 5), /* withSend return */ + reg::packed(150, 0, 157), /* withLowerBound $marker */ + reg::packed(218, 0, 223), /* withLowerBound $type */ + reg::packed(88, 0, 5), /* withLowerBound return */ + reg::packed(150, 0, 157), /* withUnconstrainingSend $marker */ + reg::packed(88, 0, 5), /* withUnconstrainingSend return */ + reg::packed(88, _ZEND_TYPE_ITERABLE_BIT), /* getFacts 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 = { { 81 /* __construct */, 0, 0, 4, reg::NoArg, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig createEmpty = { { 94 /* createEmpty */, 0, 4, 0, 4, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig isEmpty = { { 106 /* isEmpty */, 0, 5, 0, 5, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig merge = { { 120 /* merge */, 1, 6, 1, 7, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withRecordedFacts = { { 137 /* withRecordedFacts */, 2, 8, 2, 10, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withSite = { { 214 /* withSite */, 1, 11, 1, 12, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withSend = { { 297 /* withSend */, 3, 13, 3, 16, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withLowerBound = { { 306 /* withLowerBound */, 2, 17, 2, 19, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withUnconstrainingSend = { { 321 /* withUnconstrainingSend */, 1, 20, 1, 21, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getFacts = { { 344 /* getFacts */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 76 /* __construct */, 4, 0, 4, reg::NoArg, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig createEmpty = { { 89 /* createEmpty */, 0, 4, 0, 4, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig isEmpty = { { 101 /* isEmpty */, 0, 5, 0, 5, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig merge = { { 115 /* merge */, 1, 6, 1, 7, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withRecordedFacts = { { 132 /* withRecordedFacts */, 2, 8, 2, 10, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withSite = { { 209 /* withSite */, 1, 11, 1, 12, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withSend = { { 292 /* withSend */, 3, 13, 3, 16, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withLowerBound = { { 301 /* withLowerBound */, 2, 17, 2, 19, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withUnconstrainingSend = { { 316 /* withUnconstrainingSend */, 1, 20, 1, 21, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getFacts = { { 339 /* getFacts */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::TemplateArgumentConstraints diff --git a/turbo-ext/src/generated/TemplateArgumentFrame.h b/turbo-ext/src/generated/TemplateArgumentFrame.h index 36c4b178245..3289741e2c9 100644 --- a/turbo-ext/src/generated/TemplateArgumentFrame.h +++ b/turbo-ext/src/generated/TemplateArgumentFrame.h @@ -52,143 +52,140 @@ inline constexpr char strings[] = "site\0" /* 84 */ "PhpParser\\Node\\Expr\0" /* 89 */ "allowUnresolved\0" /* 109 */ - "null\0" /* 125 */ - "\0" /* 130 */ - "PHPStan\\Type\\Type\0" /* 131 */ - "returnTypeOfCall\0" /* 149 */ - "parent\0" /* 166 */ - "PHPStan\\Analyser\\Generics\\TemplateArgumentFrame\0" /* 173 */ - "resolutions\0" /* 221 */ - "siteStatementIndexes\0" /* 233 */ - "[]\0" /* 254 */ - "closureSignatureBody\0" /* 257 */ - "PhpParser\\Node\0" /* 278 */ - "closureSignatureStmts\0" /* 293 */ - "settledClosureSites\0" /* 315 */ - "observingClosures\0" /* 335 */ - "false\0" /* 353 */ - "byRefSites\0" /* 359 */ - "staticVariableTypes\0" /* 370 */ - "staticVariableConditionalExpressions\0" /* 390 */ - "__construct\0" /* 427 */ - "var\0" /* 439 */ - "PhpParser\\Node\\Expr\\Variable\0" /* 443 */ - "getStaticVariableTypes\0" /* 472 */ - "stmt\0" /* 495 */ - "PhpParser\\Node\\Stmt\\Static_\0" /* 500 */ - "getStaticVariableConditionalExpressions\0" /* 528 */ - "statementIndexes\0" /* 568 */ - "conditionalExpressions\0" /* 585 */ - "withStaticVariableTypes\0" /* 608 */ - "getByRefSiteMode\0" /* 632 */ - "getLocalByRefSites\0" /* 649 */ - "closureResolutions\0" /* 668 */ - "closureSiteStatementIndexes\0" /* 687 */ - "withObservedClosures\0" /* 715 */ - "isSettledClosureSite\0" /* 736 */ - "getParent\0" /* 757 */ - "getClosureSignatureBody\0" /* 767 */ - "getClosureSignatureStmts\0" /* 791 */ - "isObserving\0" /* 816 */ - "isObservingClosures\0" /* 828 */ - "firstSiteStatementIndex\0" /* 848 */ - "statementIndex\0" /* 872 */ - "ownsSiteInStatement\0" /* 887 */ - "hasSiteAtOrAfter\0" /* 907 */ - "template\0" /* 924 */ - "PHPStan\\Type\\Generic\\TemplateType\0" /* 933 */ - "resolveOrUnconstrained\0" /* 967 */ - "resolve\0" /* 990 */ - "resolveUnconstrained\0" /* 998 */ - "templateName\0" /* 1019 */ - "getResolutionCacheKeySuffix\0" /* 1032 */ - "key"; /* 1060 */ + "\0" /* 125 */ + "PHPStan\\Type\\Type\0" /* 126 */ + "returnTypeOfCall\0" /* 144 */ + "parent\0" /* 161 */ + "PHPStan\\Analyser\\Generics\\TemplateArgumentFrame\0" /* 168 */ + "resolutions\0" /* 216 */ + "siteStatementIndexes\0" /* 228 */ + "closureSignatureBody\0" /* 249 */ + "PhpParser\\Node\0" /* 270 */ + "closureSignatureStmts\0" /* 285 */ + "settledClosureSites\0" /* 307 */ + "observingClosures\0" /* 327 */ + "byRefSites\0" /* 345 */ + "staticVariableTypes\0" /* 356 */ + "staticVariableConditionalExpressions\0" /* 376 */ + "__construct\0" /* 413 */ + "var\0" /* 425 */ + "PhpParser\\Node\\Expr\\Variable\0" /* 429 */ + "getStaticVariableTypes\0" /* 458 */ + "stmt\0" /* 481 */ + "PhpParser\\Node\\Stmt\\Static_\0" /* 486 */ + "getStaticVariableConditionalExpressions\0" /* 514 */ + "statementIndexes\0" /* 554 */ + "conditionalExpressions\0" /* 571 */ + "withStaticVariableTypes\0" /* 594 */ + "getByRefSiteMode\0" /* 618 */ + "getLocalByRefSites\0" /* 635 */ + "closureResolutions\0" /* 654 */ + "closureSiteStatementIndexes\0" /* 673 */ + "withObservedClosures\0" /* 701 */ + "isSettledClosureSite\0" /* 722 */ + "getParent\0" /* 743 */ + "getClosureSignatureBody\0" /* 753 */ + "getClosureSignatureStmts\0" /* 777 */ + "isObserving\0" /* 802 */ + "isObservingClosures\0" /* 814 */ + "firstSiteStatementIndex\0" /* 834 */ + "statementIndex\0" /* 858 */ + "ownsSiteInStatement\0" /* 873 */ + "hasSiteAtOrAfter\0" /* 893 */ + "template\0" /* 910 */ + "PHPStan\\Type\\Generic\\TemplateType\0" /* 919 */ + "resolveOrUnconstrained\0" /* 953 */ + "resolve\0" /* 976 */ + "resolveUnconstrained\0" /* 984 */ + "templateName\0" /* 1005 */ + "getResolutionCacheKeySuffix\0" /* 1018 */ + "key"; /* 1046 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 9), /* returnTypeOfCall $acceptor */ reg::packed(47, 0, 53), /* returnTypeOfCall $scope */ reg::packed(84, 0, 89), /* returnTypeOfCall $site */ - reg::packed(109, MAY_BE_NULL | MAY_BE_BOOL, reg::NoString, false, false, 125), /* returnTypeOfCall $allowUnresolved */ - reg::packed(130, 0, 131), /* returnTypeOfCall return */ - reg::packed(166, MAY_BE_NULL, 173), /* __construct $parent */ - reg::packed(221, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 125), /* __construct $resolutions */ - reg::packed(233, MAY_BE_ARRAY, reg::NoString, false, false, 254), /* __construct $siteStatementIndexes */ - reg::packed(257, MAY_BE_NULL, 278, false, false, 125), /* __construct $closureSignatureBody */ - reg::packed(293, MAY_BE_ARRAY, reg::NoString, false, false, 254), /* __construct $closureSignatureStmts */ - reg::packed(315, MAY_BE_ARRAY, reg::NoString, false, false, 254), /* __construct $settledClosureSites */ - reg::packed(335, MAY_BE_BOOL, reg::NoString, false, false, 353), /* __construct $observingClosures */ - reg::packed(359, MAY_BE_ARRAY, reg::NoString, false, false, 254), /* __construct $byRefSites */ - reg::packed(370, MAY_BE_ARRAY, reg::NoString, false, false, 254), /* __construct $staticVariableTypes */ - reg::packed(390, MAY_BE_ARRAY, reg::NoString, false, false, 254), /* __construct $staticVariableConditionalExpressions */ - reg::packed(439, 0, 443), /* getStaticVariableTypes $var */ - reg::packed(130, MAY_BE_NULL | MAY_BE_ARRAY), /* getStaticVariableTypes return */ - reg::packed(495, 0, 500), /* getStaticVariableConditionalExpressions $stmt */ - reg::packed(130, MAY_BE_ARRAY), /* getStaticVariableConditionalExpressions return */ - reg::packed(370, MAY_BE_ARRAY), /* withStaticVariableTypes $staticVariableTypes */ - reg::packed(568, MAY_BE_ARRAY), /* withStaticVariableTypes $statementIndexes */ - reg::packed(585, MAY_BE_ARRAY, reg::NoString, false, false, 254), /* withStaticVariableTypes $conditionalExpressions */ - reg::packed(130, 0, 173), /* withStaticVariableTypes return */ + reg::packed(109, MAY_BE_NULL | MAY_BE_BOOL), /* returnTypeOfCall $allowUnresolved */ + reg::packed(125, 0, 126), /* returnTypeOfCall return */ + reg::packed(161, MAY_BE_NULL, 168), /* __construct $parent */ + reg::packed(216, MAY_BE_NULL | MAY_BE_ARRAY), /* __construct $resolutions */ + reg::packed(228, MAY_BE_ARRAY), /* __construct $siteStatementIndexes */ + reg::packed(249, MAY_BE_NULL, 270), /* __construct $closureSignatureBody */ + reg::packed(285, MAY_BE_ARRAY), /* __construct $closureSignatureStmts */ + reg::packed(307, MAY_BE_ARRAY), /* __construct $settledClosureSites */ + reg::packed(327, MAY_BE_BOOL), /* __construct $observingClosures */ + reg::packed(345, MAY_BE_ARRAY), /* __construct $byRefSites */ + reg::packed(356, MAY_BE_ARRAY), /* __construct $staticVariableTypes */ + reg::packed(376, MAY_BE_ARRAY), /* __construct $staticVariableConditionalExpressions */ + reg::packed(425, 0, 429), /* getStaticVariableTypes $var */ + reg::packed(125, MAY_BE_NULL | MAY_BE_ARRAY), /* getStaticVariableTypes return */ + reg::packed(481, 0, 486), /* getStaticVariableConditionalExpressions $stmt */ + reg::packed(125, MAY_BE_ARRAY), /* getStaticVariableConditionalExpressions return */ + reg::packed(356, MAY_BE_ARRAY), /* withStaticVariableTypes $staticVariableTypes */ + reg::packed(554, MAY_BE_ARRAY), /* withStaticVariableTypes $statementIndexes */ + reg::packed(571, MAY_BE_ARRAY), /* withStaticVariableTypes $conditionalExpressions */ + reg::packed(125, 0, 168), /* withStaticVariableTypes return */ reg::packed(84, 0, 89), /* getByRefSiteMode $site */ - reg::packed(130, MAY_BE_NULL | MAY_BE_STRING), /* getByRefSiteMode return */ - reg::packed(130, MAY_BE_ARRAY), /* getLocalByRefSites return */ - reg::packed(668, MAY_BE_ARRAY), /* withObservedClosures $closureResolutions */ - reg::packed(687, MAY_BE_ARRAY), /* withObservedClosures $closureSiteStatementIndexes */ - reg::packed(315, MAY_BE_ARRAY), /* withObservedClosures $settledClosureSites */ - reg::packed(359, MAY_BE_ARRAY, reg::NoString, false, false, 254), /* withObservedClosures $byRefSites */ - reg::packed(130, 0, 173), /* withObservedClosures return */ + reg::packed(125, MAY_BE_NULL | MAY_BE_STRING), /* getByRefSiteMode return */ + reg::packed(125, MAY_BE_ARRAY), /* getLocalByRefSites return */ + reg::packed(654, MAY_BE_ARRAY), /* withObservedClosures $closureResolutions */ + reg::packed(673, MAY_BE_ARRAY), /* withObservedClosures $closureSiteStatementIndexes */ + reg::packed(307, MAY_BE_ARRAY), /* withObservedClosures $settledClosureSites */ + reg::packed(345, MAY_BE_ARRAY), /* withObservedClosures $byRefSites */ + reg::packed(125, 0, 168), /* withObservedClosures return */ reg::packed(84, 0, 89), /* isSettledClosureSite $site */ - reg::packed(130, MAY_BE_BOOL), /* isSettledClosureSite return */ - reg::packed(130, MAY_BE_NULL, 173), /* getParent return */ - reg::packed(130, MAY_BE_NULL, 278), /* getClosureSignatureBody return */ - reg::packed(130, MAY_BE_ARRAY), /* getClosureSignatureStmts return */ - reg::packed(130, MAY_BE_BOOL), /* isObserving return */ - reg::packed(130, MAY_BE_BOOL), /* isObservingClosures return */ - reg::packed(130, MAY_BE_NULL | MAY_BE_LONG), /* firstSiteStatementIndex return */ - reg::packed(872, MAY_BE_LONG), /* ownsSiteInStatement $statementIndex */ - reg::packed(130, MAY_BE_BOOL), /* ownsSiteInStatement return */ - reg::packed(872, MAY_BE_LONG), /* hasSiteAtOrAfter $statementIndex */ - reg::packed(130, MAY_BE_BOOL), /* hasSiteAtOrAfter return */ + reg::packed(125, MAY_BE_BOOL), /* isSettledClosureSite return */ + reg::packed(125, MAY_BE_NULL, 168), /* getParent return */ + reg::packed(125, MAY_BE_NULL, 270), /* getClosureSignatureBody return */ + reg::packed(125, MAY_BE_ARRAY), /* getClosureSignatureStmts return */ + reg::packed(125, MAY_BE_BOOL), /* isObserving return */ + reg::packed(125, MAY_BE_BOOL), /* isObservingClosures return */ + reg::packed(125, MAY_BE_NULL | MAY_BE_LONG), /* firstSiteStatementIndex return */ + reg::packed(858, MAY_BE_LONG), /* ownsSiteInStatement $statementIndex */ + reg::packed(125, MAY_BE_BOOL), /* ownsSiteInStatement return */ + reg::packed(858, MAY_BE_LONG), /* hasSiteAtOrAfter $statementIndex */ + reg::packed(125, MAY_BE_BOOL), /* hasSiteAtOrAfter return */ reg::packed(84, 0, 89), /* resolveOrUnconstrained $site */ - reg::packed(924, 0, 933), /* resolveOrUnconstrained $template */ - reg::packed(130, 0, 131), /* resolveOrUnconstrained return */ + reg::packed(910, 0, 919), /* resolveOrUnconstrained $template */ + reg::packed(125, 0, 126), /* resolveOrUnconstrained return */ reg::packed(84, 0, 89), /* resolveUnconstrained $site */ - reg::packed(924, 0, 933), /* resolveUnconstrained $template */ - reg::packed(990, MAY_BE_CALLABLE), /* resolveUnconstrained $resolve */ - reg::packed(130, 0, 131), /* resolveUnconstrained return */ + reg::packed(910, 0, 919), /* resolveUnconstrained $template */ + reg::packed(976, MAY_BE_CALLABLE), /* resolveUnconstrained $resolve */ + reg::packed(125, 0, 126), /* resolveUnconstrained return */ reg::packed(84, 0, 89), /* resolve $site */ - reg::packed(1019, MAY_BE_STRING), /* resolve $templateName */ - reg::packed(130, MAY_BE_NULL, 131), /* resolve return */ - reg::packed(130, MAY_BE_STRING), /* getResolutionCacheKeySuffix return */ + reg::packed(1005, MAY_BE_STRING), /* resolve $templateName */ + reg::packed(125, MAY_BE_NULL, 126), /* resolve return */ + reg::packed(125, MAY_BE_STRING), /* getResolutionCacheKeySuffix return */ reg::packed(84, 0, 89), /* key $site */ - reg::packed(1019, MAY_BE_STRING), /* key $templateName */ - reg::packed(130, MAY_BE_STRING), /* key return */ + reg::packed(1005, MAY_BE_STRING), /* key $templateName */ + reg::packed(125, MAY_BE_STRING), /* key 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 returnTypeOfCall = { { 149 /* returnTypeOfCall */, 3, 0, 4, 4, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig __construct = { { 427 /* __construct */, 1, 5, 10, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getStaticVariableTypes = { { 472 /* getStaticVariableTypes */, 1, 15, 1, 16, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getStaticVariableConditionalExpressions = { { 528 /* getStaticVariableConditionalExpressions */, 1, 17, 1, 18, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withStaticVariableTypes = { { 608 /* withStaticVariableTypes */, 2, 19, 3, 22, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getByRefSiteMode = { { 632 /* getByRefSiteMode */, 1, 23, 1, 24, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getLocalByRefSites = { { 649 /* getLocalByRefSites */, 0, 25, 0, 25, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig withObservedClosures = { { 715 /* withObservedClosures */, 3, 26, 4, 30, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isSettledClosureSite = { { 736 /* isSettledClosureSite */, 1, 31, 1, 32, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getParent = { { 757 /* getParent */, 0, 33, 0, 33, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getClosureSignatureBody = { { 767 /* getClosureSignatureBody */, 0, 34, 0, 34, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getClosureSignatureStmts = { { 791 /* getClosureSignatureStmts */, 0, 35, 0, 35, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isObserving = { { 816 /* isObserving */, 0, 36, 0, 36, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isObservingClosures = { { 828 /* isObservingClosures */, 0, 37, 0, 37, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig firstSiteStatementIndex = { { 848 /* firstSiteStatementIndex */, 0, 38, 0, 38, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig ownsSiteInStatement = { { 887 /* ownsSiteInStatement */, 1, 39, 1, 40, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasSiteAtOrAfter = { { 907 /* hasSiteAtOrAfter */, 1, 41, 1, 42, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig resolveOrUnconstrained = { { 967 /* resolveOrUnconstrained */, 2, 43, 2, 45, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig resolveUnconstrained = { { 998 /* resolveUnconstrained */, 3, 46, 3, 49, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig resolve = { { 990 /* resolve */, 2, 50, 2, 52, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getResolutionCacheKeySuffix = { { 1032 /* getResolutionCacheKeySuffix */, 0, 53, 0, 53, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig key = { { 1060 /* key */, 2, 54, 2, 56, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig returnTypeOfCall = { { 144 /* returnTypeOfCall */, 4, 0, 4, 4, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig __construct = { { 413 /* __construct */, 10, 5, 10, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getStaticVariableTypes = { { 458 /* getStaticVariableTypes */, 1, 15, 1, 16, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getStaticVariableConditionalExpressions = { { 514 /* getStaticVariableConditionalExpressions */, 1, 17, 1, 18, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withStaticVariableTypes = { { 594 /* withStaticVariableTypes */, 3, 19, 3, 22, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getByRefSiteMode = { { 618 /* getByRefSiteMode */, 1, 23, 1, 24, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getLocalByRefSites = { { 635 /* getLocalByRefSites */, 0, 25, 0, 25, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig withObservedClosures = { { 701 /* withObservedClosures */, 4, 26, 4, 30, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isSettledClosureSite = { { 722 /* isSettledClosureSite */, 1, 31, 1, 32, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getParent = { { 743 /* getParent */, 0, 33, 0, 33, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureSignatureBody = { { 753 /* getClosureSignatureBody */, 0, 34, 0, 34, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClosureSignatureStmts = { { 777 /* getClosureSignatureStmts */, 0, 35, 0, 35, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isObserving = { { 802 /* isObserving */, 0, 36, 0, 36, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isObservingClosures = { { 814 /* isObservingClosures */, 0, 37, 0, 37, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig firstSiteStatementIndex = { { 834 /* firstSiteStatementIndex */, 0, 38, 0, 38, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig ownsSiteInStatement = { { 873 /* ownsSiteInStatement */, 1, 39, 1, 40, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasSiteAtOrAfter = { { 893 /* hasSiteAtOrAfter */, 1, 41, 1, 42, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig resolveOrUnconstrained = { { 953 /* resolveOrUnconstrained */, 2, 43, 2, 45, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig resolveUnconstrained = { { 984 /* resolveUnconstrained */, 3, 46, 3, 49, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig resolve = { { 976 /* resolve */, 2, 50, 2, 52, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getResolutionCacheKeySuffix = { { 1018 /* getResolutionCacheKeySuffix */, 0, 53, 0, 53, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig key = { { 1046 /* key */, 2, 54, 2, 56, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; } // namespace sig } // namespace ptdecl::TemplateArgumentFrame diff --git a/turbo-ext/src/generated/TemplateArgumentObserver.h b/turbo-ext/src/generated/TemplateArgumentObserver.h index 8fd71ca386a..4f1df345429 100644 --- a/turbo-ext/src/generated/TemplateArgumentObserver.h +++ b/turbo-ext/src/generated/TemplateArgumentObserver.h @@ -28,133 +28,131 @@ inline constexpr char strings[] = "PHPStan\\Analyser\\Generics\\TemplateArgumentConstraints\0" /* 24 */ "collectSites\0" /* 78 */ "templateArgumentsOnly\0" /* 91 */ - "false\0" /* 113 */ - "containsMarker\0" /* 119 */ - "declared\0" /* 134 */ - "actual\0" /* 143 */ - "collectSend\0" /* 150 */ - "parameterType\0" /* 162 */ - "argumentType\0" /* 176 */ - "collectClosureArgument\0" /* 189 */ - "acceptor\0" /* 212 */ - "PHPStan\\Reflection\\ParametersAcceptor\0" /* 221 */ - "argumentTypes\0" /* 259 */ - "isPure\0" /* 273 */ - "collectClosureArguments\0" /* 280 */ - "collectEscape\0" /* 304 */ - "types\0" /* 318 */ - "carriesClosureSignatureMarkers\0" /* 324 */ - "containsClosureSignatureMarker\0" /* 355 */ - "constraints\0" /* 386 */ - "observeClosureSend\0" /* 398 */ - "PHPStan\\Type\\ClosureType\0" /* 417 */ - "observeClosureSendToCallable\0" /* 442 */ - "closureType\0" /* 471 */ - "escapeByRefUses\0" /* 483 */ - "escapeClosures\0" /* 499 */ - "collectArgument\0" /* 514 */ - "site\0" /* 530 */ - "PhpParser\\Node\\Expr\0" /* 535 */ - "classTemplates\0" /* 555 */ - "PHPStan\\Type\\Generic\\TemplateTypeMap\0" /* 570 */ - "null\0" /* 607 */ - "collectCall\0" /* 612 */ - "templates\0" /* 624 */ - "replaceInferableTemplates\0" /* 634 */ - "isCallArgument\0" /* 660 */ - "observeSend\0" /* 675 */ - "declaredArgument\0" /* 687 */ - "argument\0" /* 704 */ - "variance\0" /* 713 */ - "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 722 */ - "observeArgumentSend\0" /* 764 */ - "marker\0" /* 784 */ - "PHPStan\\Type\\Generic\\UnresolvedTemplateArgumentType\0" /* 791 */ - "observeMarkerSend\0" /* 843 */ - "isInertSendTarget\0" /* 861 */ - "observeArgument\0" /* 879 */ - "observeLowerBound\0" /* 895 */ - "isUninformativeSendTarget\0" /* 913 */ - "hasOnlyInferableTemplates"; /* 939 */ + "containsMarker\0" /* 113 */ + "declared\0" /* 128 */ + "actual\0" /* 137 */ + "collectSend\0" /* 144 */ + "parameterType\0" /* 156 */ + "argumentType\0" /* 170 */ + "collectClosureArgument\0" /* 183 */ + "acceptor\0" /* 206 */ + "PHPStan\\Reflection\\ParametersAcceptor\0" /* 215 */ + "argumentTypes\0" /* 253 */ + "isPure\0" /* 267 */ + "collectClosureArguments\0" /* 274 */ + "collectEscape\0" /* 298 */ + "types\0" /* 312 */ + "carriesClosureSignatureMarkers\0" /* 318 */ + "containsClosureSignatureMarker\0" /* 349 */ + "constraints\0" /* 380 */ + "observeClosureSend\0" /* 392 */ + "PHPStan\\Type\\ClosureType\0" /* 411 */ + "observeClosureSendToCallable\0" /* 436 */ + "closureType\0" /* 465 */ + "escapeByRefUses\0" /* 477 */ + "escapeClosures\0" /* 493 */ + "collectArgument\0" /* 508 */ + "site\0" /* 524 */ + "PhpParser\\Node\\Expr\0" /* 529 */ + "classTemplates\0" /* 549 */ + "PHPStan\\Type\\Generic\\TemplateTypeMap\0" /* 564 */ + "collectCall\0" /* 601 */ + "templates\0" /* 613 */ + "replaceInferableTemplates\0" /* 623 */ + "isCallArgument\0" /* 649 */ + "observeSend\0" /* 664 */ + "declaredArgument\0" /* 676 */ + "argument\0" /* 693 */ + "variance\0" /* 702 */ + "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 711 */ + "observeArgumentSend\0" /* 753 */ + "marker\0" /* 773 */ + "PHPStan\\Type\\Generic\\UnresolvedTemplateArgumentType\0" /* 780 */ + "observeMarkerSend\0" /* 832 */ + "isInertSendTarget\0" /* 850 */ + "observeArgument\0" /* 868 */ + "observeLowerBound\0" /* 884 */ + "isUninformativeSendTarget\0" /* 902 */ + "hasOnlyInferableTemplates"; /* 928 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 5), /* collectSites $type */ reg::packed(23, 0, 24), /* collectSites return */ reg::packed(0, 0, 5), /* containsMarker $type */ - reg::packed(91, MAY_BE_BOOL, reg::NoString, false, false, 113), /* containsMarker $templateArgumentsOnly */ + reg::packed(91, MAY_BE_BOOL), /* containsMarker $templateArgumentsOnly */ reg::packed(23, MAY_BE_BOOL), /* containsMarker return */ - reg::packed(134, 0, 5), /* collectSend $declared */ - reg::packed(143, 0, 5), /* collectSend $actual */ + reg::packed(128, 0, 5), /* collectSend $declared */ + reg::packed(137, 0, 5), /* collectSend $actual */ reg::packed(23, 0, 24), /* collectSend return */ - reg::packed(162, 0, 5), /* collectClosureArgument $parameterType */ - reg::packed(176, 0, 5), /* collectClosureArgument $argumentType */ + reg::packed(156, 0, 5), /* collectClosureArgument $parameterType */ + reg::packed(170, 0, 5), /* collectClosureArgument $argumentType */ reg::packed(23, 0, 24), /* collectClosureArgument return */ - reg::packed(212, 0, 221), /* collectClosureArguments $acceptor */ - reg::packed(259, MAY_BE_ARRAY), /* collectClosureArguments $argumentTypes */ - reg::packed(273, MAY_BE_BOOL), /* collectClosureArguments $isPure */ + reg::packed(206, 0, 215), /* collectClosureArguments $acceptor */ + reg::packed(253, MAY_BE_ARRAY), /* collectClosureArguments $argumentTypes */ + reg::packed(267, MAY_BE_BOOL), /* collectClosureArguments $isPure */ reg::packed(23, 0, 24), /* collectClosureArguments return */ reg::packed(0, 0, 5), /* collectEscape $type */ reg::packed(23, 0, 24), /* collectEscape return */ - reg::packed(318, MAY_BE_ARRAY), /* carriesClosureSignatureMarkers $types */ + reg::packed(312, MAY_BE_ARRAY), /* carriesClosureSignatureMarkers $types */ reg::packed(23, MAY_BE_BOOL), /* carriesClosureSignatureMarkers return */ reg::packed(0, 0, 5), /* containsClosureSignatureMarker $type */ reg::packed(23, MAY_BE_BOOL), /* containsClosureSignatureMarker return */ - reg::packed(386, 0, 24), /* observeClosureSend $constraints */ - reg::packed(134, 0, 5), /* observeClosureSend $declared */ - reg::packed(143, 0, 5), /* observeClosureSend $actual */ + reg::packed(380, 0, 24), /* observeClosureSend $constraints */ + reg::packed(128, 0, 5), /* observeClosureSend $declared */ + reg::packed(137, 0, 5), /* observeClosureSend $actual */ reg::packed(23, 0, 24), /* observeClosureSend return */ - reg::packed(386, 0, 24), /* observeClosureSendToCallable $constraints */ - reg::packed(134, 0, 5), /* observeClosureSendToCallable $declared */ - reg::packed(143, 0, 417), /* observeClosureSendToCallable $actual */ + reg::packed(380, 0, 24), /* observeClosureSendToCallable $constraints */ + reg::packed(128, 0, 5), /* observeClosureSendToCallable $declared */ + reg::packed(137, 0, 411), /* observeClosureSendToCallable $actual */ reg::packed(23, 0, 24), /* observeClosureSendToCallable return */ - reg::packed(386, 0, 24), /* escapeByRefUses $constraints */ - reg::packed(471, 0, 417), /* escapeByRefUses $closureType */ + reg::packed(380, 0, 24), /* escapeByRefUses $constraints */ + reg::packed(465, 0, 411), /* escapeByRefUses $closureType */ reg::packed(23, 0, 24), /* escapeByRefUses return */ - reg::packed(386, 0, 24), /* escapeClosures $constraints */ + reg::packed(380, 0, 24), /* escapeClosures $constraints */ reg::packed(0, 0, 5), /* escapeClosures $type */ reg::packed(23, 0, 24), /* escapeClosures return */ - reg::packed(162, 0, 5), /* collectArgument $parameterType */ - reg::packed(176, 0, 5), /* collectArgument $argumentType */ - reg::packed(273, MAY_BE_BOOL, reg::NoString, false, false, 113), /* collectArgument $isPure */ + reg::packed(156, 0, 5), /* collectArgument $parameterType */ + reg::packed(170, 0, 5), /* collectArgument $argumentType */ + reg::packed(267, MAY_BE_BOOL), /* collectArgument $isPure */ reg::packed(23, 0, 24), /* collectArgument return */ - reg::packed(530, 0, 535), /* collectCall $site */ - reg::packed(212, 0, 221), /* collectCall $acceptor */ - reg::packed(259, MAY_BE_ARRAY), /* collectCall $argumentTypes */ - reg::packed(555, MAY_BE_NULL, 570, false, false, 607), /* collectCall $classTemplates */ + reg::packed(524, 0, 529), /* collectCall $site */ + reg::packed(206, 0, 215), /* collectCall $acceptor */ + reg::packed(253, MAY_BE_ARRAY), /* collectCall $argumentTypes */ + reg::packed(549, MAY_BE_NULL, 564), /* collectCall $classTemplates */ reg::packed(23, 0, 24), /* collectCall return */ reg::packed(0, 0, 5), /* replaceInferableTemplates $type */ - reg::packed(530, 0, 535), /* replaceInferableTemplates $site */ - reg::packed(624, 0, 570), /* replaceInferableTemplates $templates */ - reg::packed(386, 0, 24, true, false), /* replaceInferableTemplates $constraints */ + reg::packed(524, 0, 529), /* replaceInferableTemplates $site */ + reg::packed(613, 0, 564), /* replaceInferableTemplates $templates */ + reg::packed(380, 0, 24, true, false), /* replaceInferableTemplates $constraints */ reg::packed(23, 0, 5), /* replaceInferableTemplates return */ - reg::packed(386, 0, 24), /* observeSend $constraints */ - reg::packed(134, 0, 5), /* observeSend $declared */ - reg::packed(143, 0, 5), /* observeSend $actual */ - reg::packed(660, MAY_BE_BOOL, reg::NoString, false, false, 113), /* observeSend $isCallArgument */ + reg::packed(380, 0, 24), /* observeSend $constraints */ + reg::packed(128, 0, 5), /* observeSend $declared */ + reg::packed(137, 0, 5), /* observeSend $actual */ + reg::packed(649, MAY_BE_BOOL), /* observeSend $isCallArgument */ reg::packed(23, 0, 24), /* observeSend return */ - reg::packed(386, 0, 24), /* observeArgumentSend $constraints */ - reg::packed(687, 0, 5), /* observeArgumentSend $declaredArgument */ - reg::packed(704, 0, 5), /* observeArgumentSend $argument */ - reg::packed(713, 0, 722), /* observeArgumentSend $variance */ - reg::packed(660, MAY_BE_BOOL), /* observeArgumentSend $isCallArgument */ + reg::packed(380, 0, 24), /* observeArgumentSend $constraints */ + reg::packed(676, 0, 5), /* observeArgumentSend $declaredArgument */ + reg::packed(693, 0, 5), /* observeArgumentSend $argument */ + reg::packed(702, 0, 711), /* observeArgumentSend $variance */ + reg::packed(649, MAY_BE_BOOL), /* observeArgumentSend $isCallArgument */ reg::packed(23, 0, 24), /* observeArgumentSend return */ - reg::packed(386, 0, 24), /* observeMarkerSend $constraints */ - reg::packed(687, 0, 5), /* observeMarkerSend $declaredArgument */ - reg::packed(784, 0, 791), /* observeMarkerSend $marker */ - reg::packed(713, 0, 722), /* observeMarkerSend $variance */ - reg::packed(660, MAY_BE_BOOL), /* observeMarkerSend $isCallArgument */ + reg::packed(380, 0, 24), /* observeMarkerSend $constraints */ + reg::packed(676, 0, 5), /* observeMarkerSend $declaredArgument */ + reg::packed(773, 0, 780), /* observeMarkerSend $marker */ + reg::packed(702, 0, 711), /* observeMarkerSend $variance */ + reg::packed(649, MAY_BE_BOOL), /* observeMarkerSend $isCallArgument */ reg::packed(23, 0, 24), /* observeMarkerSend return */ - reg::packed(134, 0, 5), /* isInertSendTarget $declared */ - reg::packed(660, MAY_BE_BOOL), /* isInertSendTarget $isCallArgument */ + reg::packed(128, 0, 5), /* isInertSendTarget $declared */ + reg::packed(649, MAY_BE_BOOL), /* isInertSendTarget $isCallArgument */ reg::packed(23, MAY_BE_BOOL), /* isInertSendTarget return */ - reg::packed(386, 0, 24), /* observeArgument $constraints */ - reg::packed(162, 0, 5), /* observeArgument $parameterType */ - reg::packed(176, 0, 5), /* observeArgument $argumentType */ + reg::packed(380, 0, 24), /* observeArgument $constraints */ + reg::packed(156, 0, 5), /* observeArgument $parameterType */ + reg::packed(170, 0, 5), /* observeArgument $argumentType */ reg::packed(23, 0, 24), /* observeArgument return */ - reg::packed(386, 0, 24), /* observeLowerBound $constraints */ - reg::packed(162, 0, 5), /* observeLowerBound $parameterType */ - reg::packed(176, 0, 5), /* observeLowerBound $argumentType */ + reg::packed(380, 0, 24), /* observeLowerBound $constraints */ + reg::packed(156, 0, 5), /* observeLowerBound $parameterType */ + reg::packed(170, 0, 5), /* observeLowerBound $argumentType */ reg::packed(23, 0, 24), /* observeLowerBound return */ - reg::packed(687, 0, 5), /* isUninformativeSendTarget $declaredArgument */ + reg::packed(676, 0, 5), /* isUninformativeSendTarget $declaredArgument */ reg::packed(23, MAY_BE_BOOL), /* isUninformativeSendTarget return */ reg::packed(0, 0, 5), /* hasOnlyInferableTemplates $type */ reg::packed(23, MAY_BE_BOOL), /* hasOnlyInferableTemplates return */ @@ -165,28 +163,28 @@ using Sig = reg::Sig; /* 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 collectSites = { { 78 /* collectSites */, 1, 0, 1, 1, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig containsMarker = { { 119 /* containsMarker */, 1, 2, 2, 4, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig collectSend = { { 150 /* collectSend */, 2, 5, 2, 7, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig collectClosureArgument = { { 189 /* collectClosureArgument */, 2, 8, 2, 10, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig collectClosureArguments = { { 280 /* collectClosureArguments */, 3, 11, 3, 14, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig collectEscape = { { 304 /* collectEscape */, 1, 15, 1, 16, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig carriesClosureSignatureMarkers = { { 324 /* carriesClosureSignatureMarkers */, 1, 17, 1, 18, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig containsClosureSignatureMarker = { { 355 /* containsClosureSignatureMarker */, 1, 19, 1, 20, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeClosureSend = { { 398 /* observeClosureSend */, 3, 21, 3, 24, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeClosureSendToCallable = { { 442 /* observeClosureSendToCallable */, 3, 25, 3, 28, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig escapeByRefUses = { { 483 /* escapeByRefUses */, 2, 29, 2, 31, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig escapeClosures = { { 499 /* escapeClosures */, 2, 32, 2, 34, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig collectArgument = { { 514 /* collectArgument */, 2, 35, 3, 38, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig collectCall = { { 612 /* collectCall */, 3, 39, 4, 43, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig replaceInferableTemplates = { { 634 /* replaceInferableTemplates */, 4, 44, 4, 48, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeSend = { { 675 /* observeSend */, 3, 49, 4, 53, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeArgumentSend = { { 764 /* observeArgumentSend */, 5, 54, 5, 59, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeMarkerSend = { { 843 /* observeMarkerSend */, 5, 60, 5, 65, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isInertSendTarget = { { 861 /* isInertSendTarget */, 2, 66, 2, 68, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig observeArgument = { { 879 /* observeArgument */, 3, 69, 3, 72, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeLowerBound = { { 895 /* observeLowerBound */, 3, 73, 3, 76, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isUninformativeSendTarget = { { 913 /* isUninformativeSendTarget */, 1, 77, 1, 78, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig hasOnlyInferableTemplates = { { 939 /* hasOnlyInferableTemplates */, 1, 79, 1, 80, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig containsMarker = { { 113 /* containsMarker */, 2, 2, 2, 4, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig collectSend = { { 144 /* collectSend */, 2, 5, 2, 7, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig collectClosureArgument = { { 183 /* collectClosureArgument */, 2, 8, 2, 10, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig collectClosureArguments = { { 274 /* collectClosureArguments */, 3, 11, 3, 14, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig collectEscape = { { 298 /* collectEscape */, 1, 15, 1, 16, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig carriesClosureSignatureMarkers = { { 318 /* carriesClosureSignatureMarkers */, 1, 17, 1, 18, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig containsClosureSignatureMarker = { { 349 /* containsClosureSignatureMarker */, 1, 19, 1, 20, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeClosureSend = { { 392 /* observeClosureSend */, 3, 21, 3, 24, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeClosureSendToCallable = { { 436 /* observeClosureSendToCallable */, 3, 25, 3, 28, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig escapeByRefUses = { { 477 /* escapeByRefUses */, 2, 29, 2, 31, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig escapeClosures = { { 493 /* escapeClosures */, 2, 32, 2, 34, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig collectArgument = { { 508 /* collectArgument */, 3, 35, 3, 38, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig collectCall = { { 601 /* collectCall */, 4, 39, 4, 43, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig replaceInferableTemplates = { { 623 /* replaceInferableTemplates */, 4, 44, 4, 48, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeSend = { { 664 /* observeSend */, 4, 49, 4, 53, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeArgumentSend = { { 753 /* observeArgumentSend */, 5, 54, 5, 59, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeMarkerSend = { { 832 /* observeMarkerSend */, 5, 60, 5, 65, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isInertSendTarget = { { 850 /* isInertSendTarget */, 2, 66, 2, 68, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig observeArgument = { { 868 /* observeArgument */, 3, 69, 3, 72, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeLowerBound = { { 884 /* observeLowerBound */, 3, 73, 3, 76, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isUninformativeSendTarget = { { 902 /* isUninformativeSendTarget */, 1, 77, 1, 78, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig hasOnlyInferableTemplates = { { 928 /* hasOnlyInferableTemplates */, 1, 79, 1, 80, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; } // namespace sig } // namespace ptdecl::TemplateArgumentObserver diff --git a/turbo-ext/src/generated/TemplateArgumentResolver.h b/turbo-ext/src/generated/TemplateArgumentResolver.h index 703c7ff4b75..ca81ca5dcd5 100644 --- a/turbo-ext/src/generated/TemplateArgumentResolver.h +++ b/turbo-ext/src/generated/TemplateArgumentResolver.h @@ -29,72 +29,70 @@ inline constexpr char strings[] = "statementStartTokenPositions\0" /* 121 */ "closureSignatureBody\0" /* 150 */ "PhpParser\\Node\0" /* 171 */ - "null\0" /* 186 */ - "closureSignatureStmts\0" /* 191 */ - "[]\0" /* 213 */ - "\0" /* 216 */ - "resolve\0" /* 217 */ - "frame\0" /* 225 */ - "resolveObservedClosures\0" /* 231 */ - "closuresOnly\0" /* 255 */ - "closureSiteIds\0" /* 268 */ - "collectObservations\0" /* 283 */ - "observations\0" /* 303 */ - "resolutions\0" /* 316 */ - "settleClosureSites\0" /* 328 */ - "siteIndexes\0" /* 347 */ - "collectByRefSites\0" /* 359 */ - "hasChangedTemplateArgument\0" /* 377 */ - "settledClosureSites\0" /* 404 */ - "collectSiteStatementIndexes\0" /* 424 */ - "tokenPosition\0" /* 452 */ - "positions\0" /* 466 */ - "locateStatement"; /* 476 */ + "closureSignatureStmts\0" /* 186 */ + "\0" /* 208 */ + "resolve\0" /* 209 */ + "frame\0" /* 217 */ + "resolveObservedClosures\0" /* 223 */ + "closuresOnly\0" /* 247 */ + "closureSiteIds\0" /* 260 */ + "collectObservations\0" /* 275 */ + "observations\0" /* 295 */ + "resolutions\0" /* 308 */ + "settleClosureSites\0" /* 320 */ + "siteIndexes\0" /* 339 */ + "collectByRefSites\0" /* 351 */ + "hasChangedTemplateArgument\0" /* 369 */ + "settledClosureSites\0" /* 396 */ + "collectSiteStatementIndexes\0" /* 416 */ + "tokenPosition\0" /* 444 */ + "positions\0" /* 458 */ + "locateStatement"; /* 468 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 12), /* resolve $constraints */ reg::packed(66, MAY_BE_NULL, 73), /* resolve $parent */ reg::packed(121, MAY_BE_ARRAY), /* resolve $statementStartTokenPositions */ - reg::packed(150, MAY_BE_NULL, 171, false, false, 186), /* resolve $closureSignatureBody */ - reg::packed(191, MAY_BE_ARRAY, reg::NoString, false, false, 213), /* resolve $closureSignatureStmts */ - reg::packed(216, 0, 73), /* resolve return */ + reg::packed(150, MAY_BE_NULL, 171), /* resolve $closureSignatureBody */ + reg::packed(186, MAY_BE_ARRAY), /* resolve $closureSignatureStmts */ + reg::packed(208, 0, 73), /* resolve return */ reg::packed(0, 0, 12), /* resolveObservedClosures $constraints */ - reg::packed(225, 0, 73), /* resolveObservedClosures $frame */ + reg::packed(217, 0, 73), /* resolveObservedClosures $frame */ reg::packed(121, MAY_BE_ARRAY), /* resolveObservedClosures $statementStartTokenPositions */ - reg::packed(216, 0, 73), /* resolveObservedClosures return */ + reg::packed(208, 0, 73), /* resolveObservedClosures return */ reg::packed(0, 0, 12), /* collectObservations $constraints */ reg::packed(121, MAY_BE_ARRAY), /* collectObservations $statementStartTokenPositions */ - reg::packed(255, MAY_BE_BOOL), /* collectObservations $closuresOnly */ - reg::packed(268, MAY_BE_ARRAY, reg::NoString, true, false), /* collectObservations $closureSiteIds */ - reg::packed(216, MAY_BE_ARRAY), /* collectObservations return */ - reg::packed(303, MAY_BE_ARRAY), /* settleClosureSites $observations */ - reg::packed(316, MAY_BE_ARRAY), /* settleClosureSites $resolutions */ - reg::packed(216, MAY_BE_ARRAY), /* settleClosureSites return */ - reg::packed(303, MAY_BE_ARRAY), /* collectByRefSites $observations */ - reg::packed(347, MAY_BE_ARRAY), /* collectByRefSites $siteIndexes */ - reg::packed(216, MAY_BE_ARRAY), /* collectByRefSites return */ - reg::packed(303, MAY_BE_ARRAY), /* hasChangedTemplateArgument $observations */ - reg::packed(316, MAY_BE_ARRAY), /* hasChangedTemplateArgument $resolutions */ - reg::packed(216, MAY_BE_BOOL), /* hasChangedTemplateArgument return */ - reg::packed(347, MAY_BE_ARRAY), /* collectSiteStatementIndexes $siteIndexes */ - reg::packed(404, MAY_BE_ARRAY), /* collectSiteStatementIndexes $settledClosureSites */ - reg::packed(216, MAY_BE_ARRAY), /* collectSiteStatementIndexes return */ - reg::packed(452, MAY_BE_LONG), /* locateStatement $tokenPosition */ - reg::packed(466, MAY_BE_ARRAY), /* locateStatement $positions */ - reg::packed(216, MAY_BE_LONG), /* locateStatement return */ + reg::packed(247, MAY_BE_BOOL), /* collectObservations $closuresOnly */ + reg::packed(260, MAY_BE_ARRAY, reg::NoString, true, false), /* collectObservations $closureSiteIds */ + reg::packed(208, MAY_BE_ARRAY), /* collectObservations return */ + reg::packed(295, MAY_BE_ARRAY), /* settleClosureSites $observations */ + reg::packed(308, MAY_BE_ARRAY), /* settleClosureSites $resolutions */ + reg::packed(208, MAY_BE_ARRAY), /* settleClosureSites return */ + reg::packed(295, MAY_BE_ARRAY), /* collectByRefSites $observations */ + reg::packed(339, MAY_BE_ARRAY), /* collectByRefSites $siteIndexes */ + reg::packed(208, MAY_BE_ARRAY), /* collectByRefSites return */ + reg::packed(295, MAY_BE_ARRAY), /* hasChangedTemplateArgument $observations */ + reg::packed(308, MAY_BE_ARRAY), /* hasChangedTemplateArgument $resolutions */ + reg::packed(208, MAY_BE_BOOL), /* hasChangedTemplateArgument return */ + reg::packed(339, MAY_BE_ARRAY), /* collectSiteStatementIndexes $siteIndexes */ + reg::packed(396, MAY_BE_ARRAY), /* collectSiteStatementIndexes $settledClosureSites */ + reg::packed(208, MAY_BE_ARRAY), /* collectSiteStatementIndexes return */ + reg::packed(444, MAY_BE_LONG), /* locateStatement $tokenPosition */ + reg::packed(458, MAY_BE_ARRAY), /* locateStatement $positions */ + reg::packed(208, MAY_BE_LONG), /* locateStatement 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 resolve = { { 217 /* resolve */, 3, 0, 5, 5, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig resolveObservedClosures = { { 231 /* resolveObservedClosures */, 3, 6, 3, 9, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig collectObservations = { { 283 /* collectObservations */, 4, 10, 4, 14, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig settleClosureSites = { { 328 /* settleClosureSites */, 2, 15, 2, 17, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig collectByRefSites = { { 359 /* collectByRefSites */, 2, 18, 2, 20, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig hasChangedTemplateArgument = { { 377 /* hasChangedTemplateArgument */, 2, 21, 2, 23, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig collectSiteStatementIndexes = { { 424 /* collectSiteStatementIndexes */, 2, 24, 2, 26, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig locateStatement = { { 476 /* locateStatement */, 2, 27, 2, 29, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolve = { { 209 /* resolve */, 5, 0, 5, 5, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig resolveObservedClosures = { { 223 /* resolveObservedClosures */, 3, 6, 3, 9, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig collectObservations = { { 275 /* collectObservations */, 4, 10, 4, 14, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig settleClosureSites = { { 320 /* settleClosureSites */, 2, 15, 2, 17, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig collectByRefSites = { { 351 /* collectByRefSites */, 2, 18, 2, 20, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig hasChangedTemplateArgument = { { 369 /* hasChangedTemplateArgument */, 2, 21, 2, 23, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig collectSiteStatementIndexes = { { 416 /* collectSiteStatementIndexes */, 2, 24, 2, 26, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig locateStatement = { { 468 /* locateStatement */, 2, 27, 2, 29, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::TemplateArgumentResolver diff --git a/turbo-ext/src/generated/VarAnnotationProcessor.h b/turbo-ext/src/generated/VarAnnotationProcessor.h index 105f87ccd32..fb20b84d3ae 100644 --- a/turbo-ext/src/generated/VarAnnotationProcessor.h +++ b/turbo-ext/src/generated/VarAnnotationProcessor.h @@ -36,16 +36,15 @@ inline constexpr char strings[] = "node\0" /* 106 */ "PhpParser\\Node\\Stmt\0" /* 111 */ "changed\0" /* 131 */ - "false\0" /* 139 */ - "\0" /* 145 */ - "processVarAnnotation"; /* 146 */ + "\0" /* 139 */ + "processVarAnnotation"; /* 140 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 15), /* __construct $fileTypeMapper */ reg::packed(55, 0, 61), /* processVarAnnotation $scope */ reg::packed(92, MAY_BE_ARRAY), /* processVarAnnotation $variableNames */ reg::packed(106, 0, 111), /* processVarAnnotation $node */ - reg::packed(131, MAY_BE_BOOL, reg::NoString, true, false, 139), /* processVarAnnotation $changed */ - reg::packed(145, 0, 61), /* processVarAnnotation return */ + reg::packed(131, MAY_BE_BOOL, reg::NoString, true, false), /* processVarAnnotation $changed */ + reg::packed(139, 0, 61), /* processVarAnnotation return */ }; using Sig = reg::Sig; } // namespace sigtab @@ -53,7 +52,7 @@ using Sig = reg::Sig; /* 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 = { { 43 /* __construct */, 1, 0, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig processVarAnnotation = { { 146 /* processVarAnnotation */, 3, 1, 4, 5, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig processVarAnnotation = { { 140 /* processVarAnnotation */, 4, 1, 4, 5, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::VarAnnotationProcessor diff --git a/turbo-ext/src/generated/VariableAccessFlow.h b/turbo-ext/src/generated/VariableAccessFlow.h index 94912c44b2b..1db67e05b01 100644 --- a/turbo-ext/src/generated/VariableAccessFlow.h +++ b/turbo-ext/src/generated/VariableAccessFlow.h @@ -42,29 +42,27 @@ inline constexpr char strings[] = "name\0" /* 5 */ "write\0" /* 10 */ "PHPStan\\Node\\Variable\\VariableWrite\0" /* 16 */ - "null\0" /* 52 */ - "type\0" /* 57 */ - "PHPStan\\Type\\Type\0" /* 62 */ - "targetId\0" /* 80 */ - "container\0" /* 89 */ - "false\0" /* 99 */ - "offset\0" /* 105 */ - "__construct"; /* 112 */ + "type\0" /* 52 */ + "PHPStan\\Type\\Type\0" /* 57 */ + "targetId\0" /* 75 */ + "container\0" /* 84 */ + "offset\0" /* 94 */ + "__construct"; /* 101 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $kind */ reg::packed(5, MAY_BE_STRING), /* __construct $name */ - reg::packed(10, MAY_BE_NULL, 16, false, false, 52), /* __construct $write */ - reg::packed(57, MAY_BE_NULL, 62, false, false, 52), /* __construct $type */ - reg::packed(80, MAY_BE_NULL | MAY_BE_LONG, reg::NoString, false, false, 52), /* __construct $targetId */ - reg::packed(89, MAY_BE_BOOL, reg::NoString, false, false, 99), /* __construct $container */ - reg::packed(105, MAY_BE_ANY, reg::NoString, false, false, 52), /* __construct $offset */ + reg::packed(10, MAY_BE_NULL, 16), /* __construct $write */ + reg::packed(52, MAY_BE_NULL, 57), /* __construct $type */ + reg::packed(75, MAY_BE_NULL | MAY_BE_LONG), /* __construct $targetId */ + reg::packed(84, MAY_BE_BOOL), /* __construct $container */ + reg::packed(94, MAY_BE_ANY), /* __construct $offset */ }; 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 = { { 112 /* __construct */, 2, 0, 7, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 101 /* __construct */, 7, 0, 7, reg::NoArg, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::VariableAccessFlow diff --git a/turbo-ext/src/generated/VariableControlFlow.h b/turbo-ext/src/generated/VariableControlFlow.h index 64b4189a142..bd9af6340b0 100644 --- a/turbo-ext/src/generated/VariableControlFlow.h +++ b/turbo-ext/src/generated/VariableControlFlow.h @@ -56,51 +56,46 @@ namespace sigtab { inline constexpr char strings[] = "kind\0" /* 0 */ "children\0" /* 5 */ - "[]\0" /* 14 */ - "name\0" /* 17 */ - "null\0" /* 22 */ - "type\0" /* 27 */ - "PHPStan\\Type\\Type\0" /* 32 */ - "level\0" /* 50 */ - "1\0" /* 56 */ - "atLeastOnce\0" /* 58 */ - "false\0" /* 70 */ - "canExit\0" /* 76 */ - "true\0" /* 84 */ - "catches\0" /* 89 */ - "arrow\0" /* 97 */ - "PhpParser\\Node\\Expr\\ArrowFunction\0" /* 103 */ - "cases\0" /* 137 */ - "canRepeat\0" /* 143 */ - "canContainAnyThrowable\0" /* 153 */ - "stmt\0" /* 176 */ - "PhpParser\\Node\\Stmt\\Foreach_|PhpParser\\Node\\Stmt\\For_\0" /* 181 */ - "bindings\0" /* 235 */ - "ownWrites\0" /* 244 */ - "__construct"; /* 254 */ + "name\0" /* 14 */ + "type\0" /* 19 */ + "PHPStan\\Type\\Type\0" /* 24 */ + "level\0" /* 42 */ + "atLeastOnce\0" /* 48 */ + "canExit\0" /* 60 */ + "catches\0" /* 68 */ + "arrow\0" /* 76 */ + "PhpParser\\Node\\Expr\\ArrowFunction\0" /* 82 */ + "cases\0" /* 116 */ + "canRepeat\0" /* 122 */ + "canContainAnyThrowable\0" /* 132 */ + "stmt\0" /* 155 */ + "PhpParser\\Node\\Stmt\\Foreach_|PhpParser\\Node\\Stmt\\For_\0" /* 160 */ + "bindings\0" /* 214 */ + "ownWrites\0" /* 223 */ + "__construct"; /* 233 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $kind */ - reg::packed(5, MAY_BE_ARRAY, reg::NoString, false, false, 14), /* __construct $children */ - reg::packed(17, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 22), /* __construct $name */ - reg::packed(27, MAY_BE_NULL, 32, false, false, 22), /* __construct $type */ - reg::packed(50, MAY_BE_LONG, reg::NoString, false, false, 56), /* __construct $level */ - reg::packed(58, MAY_BE_BOOL, reg::NoString, false, false, 70), /* __construct $atLeastOnce */ - reg::packed(76, MAY_BE_BOOL, reg::NoString, false, false, 84), /* __construct $canExit */ - reg::packed(89, MAY_BE_ARRAY, reg::NoString, false, false, 14), /* __construct $catches */ - reg::packed(97, MAY_BE_NULL, 103, false, false, 22), /* __construct $arrow */ - reg::packed(137, MAY_BE_ARRAY, reg::NoString, false, false, 14), /* __construct $cases */ - reg::packed(143, MAY_BE_BOOL, reg::NoString, false, false, 84), /* __construct $canRepeat */ - reg::packed(153, MAY_BE_BOOL, reg::NoString, false, false, 70), /* __construct $canContainAnyThrowable */ - reg::packed(176, MAY_BE_NULL, 181, false, false, 22), /* __construct $stmt */ - reg::packed(235, MAY_BE_ARRAY, reg::NoString, false, false, 14), /* __construct $bindings */ - reg::packed(244, MAY_BE_ARRAY, reg::NoString, false, false, 14), /* __construct $ownWrites */ + reg::packed(5, MAY_BE_ARRAY), /* __construct $children */ + reg::packed(14, MAY_BE_NULL | MAY_BE_STRING), /* __construct $name */ + reg::packed(19, MAY_BE_NULL, 24), /* __construct $type */ + reg::packed(42, MAY_BE_LONG), /* __construct $level */ + reg::packed(48, MAY_BE_BOOL), /* __construct $atLeastOnce */ + reg::packed(60, MAY_BE_BOOL), /* __construct $canExit */ + reg::packed(68, MAY_BE_ARRAY), /* __construct $catches */ + reg::packed(76, MAY_BE_NULL, 82), /* __construct $arrow */ + reg::packed(116, MAY_BE_ARRAY), /* __construct $cases */ + reg::packed(122, MAY_BE_BOOL), /* __construct $canRepeat */ + reg::packed(132, MAY_BE_BOOL), /* __construct $canContainAnyThrowable */ + reg::packed(155, MAY_BE_NULL, 160), /* __construct $stmt */ + reg::packed(214, MAY_BE_ARRAY), /* __construct $bindings */ + reg::packed(223, MAY_BE_ARRAY), /* __construct $ownWrites */ }; 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 = { { 254 /* __construct */, 1, 0, 15, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig __construct = { { 233 /* __construct */, 15, 0, 15, reg::NoArg, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::VariableControlFlow diff --git a/turbo-ext/src/generated/VariableFlow.h b/turbo-ext/src/generated/VariableFlow.h index 4cdd50de57f..f8505ea0356 100644 --- a/turbo-ext/src/generated/VariableFlow.h +++ b/turbo-ext/src/generated/VariableFlow.h @@ -41,50 +41,46 @@ inline constexpr char strings[] = "outputs\0" /* 124 */ "name\0" /* 132 */ "targetId\0" /* 137 */ - "null\0" /* 146 */ - "container\0" /* 151 */ - "false\0" /* 161 */ - "offset\0" /* 167 */ - "read\0" /* 174 */ - "condition\0" /* 179 */ - "if\0" /* 189 */ - "else\0" /* 192 */ - "conditional\0" /* 197 */ - "cases\0" /* 209 */ - "exhaustive\0" /* 215 */ - "switch\0" /* 226 */ - "write\0" /* 233 */ - "PHPStan\\Node\\Variable\\VariableWrite\0" /* 239 */ - "redundantType\0" /* 275 */ - "PHPStan\\Type\\Type\0" /* 289 */ - "discard\0" /* 307 */ - "writeId\0" /* 315 */ - "inputs\0" /* 323 */ - "escape\0" /* 330 */ - "mention\0" /* 337 */ - "all\0" /* 345 */ - "level\0" /* 349 */ - "1\0" /* 355 */ - "exit\0" /* 357 */ - "type\0" /* 362 */ - "canContinue\0" /* 367 */ - "canContainAnyThrowable\0" /* 379 */ - "throwing\0" /* 402 */ - "update\0" /* 411 */ - "atLeastOnce\0" /* 418 */ - "canExit\0" /* 430 */ - "canRepeat\0" /* 438 */ - "true\0" /* 448 */ - "loop\0" /* 453 */ - "stmt\0" /* 458 */ - "PhpParser\\Node\\Stmt\\Foreach_|PhpParser\\Node\\Stmt\\For_\0" /* 463 */ - "flow\0" /* 517 */ - "bindings\0" /* 522 */ - "ownWrites\0" /* 531 */ - "loopStatement\0" /* 541 */ - "catches\0" /* 555 */ - "finally\0" /* 563 */ - "tryCatch"; /* 571 */ + "container\0" /* 146 */ + "offset\0" /* 156 */ + "read\0" /* 163 */ + "condition\0" /* 168 */ + "if\0" /* 178 */ + "else\0" /* 181 */ + "conditional\0" /* 186 */ + "cases\0" /* 198 */ + "exhaustive\0" /* 204 */ + "switch\0" /* 215 */ + "write\0" /* 222 */ + "PHPStan\\Node\\Variable\\VariableWrite\0" /* 228 */ + "redundantType\0" /* 264 */ + "PHPStan\\Type\\Type\0" /* 278 */ + "discard\0" /* 296 */ + "writeId\0" /* 304 */ + "inputs\0" /* 312 */ + "escape\0" /* 319 */ + "mention\0" /* 326 */ + "all\0" /* 334 */ + "level\0" /* 338 */ + "exit\0" /* 344 */ + "type\0" /* 349 */ + "canContinue\0" /* 354 */ + "canContainAnyThrowable\0" /* 366 */ + "throwing\0" /* 389 */ + "update\0" /* 398 */ + "atLeastOnce\0" /* 405 */ + "canExit\0" /* 417 */ + "canRepeat\0" /* 425 */ + "loop\0" /* 435 */ + "stmt\0" /* 440 */ + "PhpParser\\Node\\Stmt\\Foreach_|PhpParser\\Node\\Stmt\\For_\0" /* 445 */ + "flow\0" /* 499 */ + "bindings\0" /* 504 */ + "ownWrites\0" /* 513 */ + "loopStatement\0" /* 523 */ + "catches\0" /* 537 */ + "finally\0" /* 545 */ + "tryCatch"; /* 553 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $kind */ reg::packed(17, MAY_BE_NULL, 23, false, true), /* sequence $flows */ @@ -96,24 +92,24 @@ inline constexpr reg::PackedArg args[] = { reg::packed(124, MAY_BE_NULL, 23), /* arrow $outputs */ reg::packed(53, 0, 23), /* arrow return */ reg::packed(132, MAY_BE_STRING), /* read $name */ - reg::packed(137, MAY_BE_NULL | MAY_BE_LONG, reg::NoString, false, false, 146), /* read $targetId */ - reg::packed(151, MAY_BE_BOOL, reg::NoString, false, false, 161), /* read $container */ - reg::packed(167, 0, reg::NoString, false, false, 146), /* read $offset */ + reg::packed(137, MAY_BE_NULL | MAY_BE_LONG), /* read $targetId */ + reg::packed(146, MAY_BE_BOOL), /* read $container */ + reg::packed(156, 0), /* read $offset */ reg::packed(53, MAY_BE_NULL, 23), /* read return */ - reg::packed(179, MAY_BE_NULL, 23), /* conditional $condition */ - reg::packed(189, MAY_BE_NULL, 23), /* conditional $if */ - reg::packed(192, MAY_BE_NULL, 23), /* conditional $else */ + reg::packed(168, MAY_BE_NULL, 23), /* conditional $condition */ + reg::packed(178, MAY_BE_NULL, 23), /* conditional $if */ + reg::packed(181, MAY_BE_NULL, 23), /* conditional $else */ reg::packed(53, MAY_BE_NULL, 23), /* conditional return */ - reg::packed(179, MAY_BE_NULL, 23), /* switch $condition */ - reg::packed(209, MAY_BE_ARRAY), /* switch $cases */ - reg::packed(215, MAY_BE_BOOL), /* switch $exhaustive */ + reg::packed(168, MAY_BE_NULL, 23), /* switch $condition */ + reg::packed(198, MAY_BE_ARRAY), /* switch $cases */ + reg::packed(204, MAY_BE_BOOL), /* switch $exhaustive */ reg::packed(53, 0, 23), /* switch return */ - reg::packed(233, 0, 239), /* write $write */ - reg::packed(275, MAY_BE_NULL, 289, false, false, 146), /* write $redundantType */ + reg::packed(222, 0, 228), /* write $write */ + reg::packed(264, MAY_BE_NULL, 278), /* write $redundantType */ reg::packed(53, 0, 23), /* write return */ - reg::packed(233, 0, 239), /* discard $write */ + reg::packed(222, 0, 228), /* discard $write */ reg::packed(53, 0, 23), /* discard return */ - reg::packed(315, MAY_BE_LONG), /* inputs $writeId */ + reg::packed(304, MAY_BE_LONG), /* inputs $writeId */ reg::packed(137, MAY_BE_NULL | MAY_BE_LONG), /* inputs $targetId */ reg::packed(53, 0, 23), /* inputs return */ reg::packed(132, MAY_BE_STRING), /* escape $name */ @@ -123,28 +119,28 @@ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* all $kind */ reg::packed(53, 0, 23), /* all return */ reg::packed(0, MAY_BE_STRING), /* exit $kind */ - reg::packed(349, MAY_BE_LONG, reg::NoString, false, false, 355), /* exit $level */ - reg::packed(132, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 146), /* exit $name */ + reg::packed(338, MAY_BE_LONG), /* exit $level */ + reg::packed(132, MAY_BE_NULL | MAY_BE_STRING), /* exit $name */ reg::packed(53, 0, 23), /* exit return */ - reg::packed(362, 0, 289), /* throwing $type */ - reg::packed(367, MAY_BE_BOOL), /* throwing $canContinue */ - reg::packed(379, MAY_BE_BOOL, reg::NoString, false, false, 161), /* throwing $canContainAnyThrowable */ + reg::packed(349, 0, 278), /* throwing $type */ + reg::packed(354, MAY_BE_BOOL), /* throwing $canContinue */ + reg::packed(366, MAY_BE_BOOL), /* throwing $canContainAnyThrowable */ reg::packed(53, 0, 23), /* throwing return */ - reg::packed(179, MAY_BE_NULL, 23), /* loop $condition */ + reg::packed(168, MAY_BE_NULL, 23), /* loop $condition */ reg::packed(119, MAY_BE_NULL, 23), /* loop $body */ - reg::packed(411, MAY_BE_NULL, 23), /* loop $update */ - reg::packed(418, MAY_BE_BOOL), /* loop $atLeastOnce */ - reg::packed(430, MAY_BE_BOOL), /* loop $canExit */ - reg::packed(438, MAY_BE_BOOL, reg::NoString, false, false, 448), /* loop $canRepeat */ + reg::packed(398, MAY_BE_NULL, 23), /* loop $update */ + reg::packed(405, MAY_BE_BOOL), /* loop $atLeastOnce */ + reg::packed(417, MAY_BE_BOOL), /* loop $canExit */ + reg::packed(425, MAY_BE_BOOL), /* loop $canRepeat */ reg::packed(53, 0, 23), /* loop return */ - reg::packed(458, 0, 463), /* loopStatement $stmt */ - reg::packed(517, MAY_BE_NULL, 23), /* loopStatement $flow */ - reg::packed(522, MAY_BE_ARRAY), /* loopStatement $bindings */ - reg::packed(531, MAY_BE_ARRAY), /* loopStatement $ownWrites */ + reg::packed(440, 0, 445), /* loopStatement $stmt */ + reg::packed(499, MAY_BE_NULL, 23), /* loopStatement $flow */ + reg::packed(504, MAY_BE_ARRAY), /* loopStatement $bindings */ + reg::packed(513, MAY_BE_ARRAY), /* loopStatement $ownWrites */ reg::packed(53, MAY_BE_NULL, 23), /* loopStatement return */ reg::packed(119, MAY_BE_NULL, 23), /* tryCatch $body */ - reg::packed(555, MAY_BE_ARRAY), /* tryCatch $catches */ - reg::packed(563, MAY_BE_NULL, 23), /* tryCatch $finally */ + reg::packed(537, MAY_BE_ARRAY), /* tryCatch $catches */ + reg::packed(545, MAY_BE_NULL, 23), /* tryCatch $finally */ reg::packed(53, 0, 23), /* tryCatch return */ }; using Sig = reg::Sig; @@ -156,20 +152,20 @@ inline constexpr sigtab::Sig __construct = { { 5 /* __construct */, 1, 0, 1, reg inline constexpr sigtab::Sig sequence = { { 54 /* sequence */, 0, 1, 1, 2, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig choice = { { 72 /* choice */, 0, 3, 1, 4, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig arrow = { { 79 /* arrow */, 3, 5, 3, 8, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig read = { { 174 /* read */, 1, 9, 4, 13, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig conditional = { { 197 /* conditional */, 3, 14, 3, 17, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig switch_ = { { 226 /* switch */, 3, 18, 3, 21, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig write = { { 233 /* write */, 1, 22, 2, 24, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig discard = { { 307 /* discard */, 1, 25, 1, 26, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig inputs = { { 323 /* inputs */, 2, 27, 2, 29, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig escape = { { 330 /* escape */, 1, 30, 1, 31, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig mention = { { 337 /* mention */, 1, 32, 1, 33, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig all = { { 345 /* all */, 1, 34, 1, 35, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig exit = { { 357 /* exit */, 1, 36, 3, 39, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig throwing = { { 402 /* throwing */, 2, 40, 3, 43, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig loop = { { 453 /* loop */, 5, 44, 6, 50, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig loopStatement = { { 541 /* loopStatement */, 4, 51, 4, 55, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig tryCatch = { { 571 /* tryCatch */, 3, 56, 3, 59, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig read = { { 163 /* read */, 4, 9, 4, 13, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig conditional = { { 186 /* conditional */, 3, 14, 3, 17, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig switch_ = { { 215 /* switch */, 3, 18, 3, 21, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig write = { { 222 /* write */, 2, 22, 2, 24, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig discard = { { 296 /* discard */, 1, 25, 1, 26, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig inputs = { { 312 /* inputs */, 2, 27, 2, 29, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig escape = { { 319 /* escape */, 1, 30, 1, 31, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig mention = { { 326 /* mention */, 1, 32, 1, 33, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig all = { { 334 /* all */, 1, 34, 1, 35, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig exit = { { 344 /* exit */, 3, 36, 3, 39, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig throwing = { { 389 /* throwing */, 3, 40, 3, 43, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig loop = { { 435 /* loop */, 6, 44, 6, 50, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig loopStatement = { { 523 /* loopStatement */, 4, 51, 4, 55, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig tryCatch = { { 553 /* tryCatch */, 3, 56, 3, 59, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; } // namespace sig } // namespace ptdecl::VariableFlow diff --git a/turbo-ext/src/generated/VariableFlowBuilder.h b/turbo-ext/src/generated/VariableFlowBuilder.h index bf9893742f2..c49ca53a05b 100644 --- a/turbo-ext/src/generated/VariableFlowBuilder.h +++ b/turbo-ext/src/generated/VariableFlowBuilder.h @@ -41,21 +41,20 @@ inline constexpr char strings[] = "target\0" /* 233 */ "read\0" /* 240 */ "targetId\0" /* 245 */ - "null\0" /* 254 */ - "targetRead\0" /* 259 */ - "flow\0" /* 270 */ - "writes\0" /* 275 */ - "kind\0" /* 282 */ - "scope\0" /* 287 */ - "PHPStan\\Analyser\\MutatingScope\0" /* 293 */ - "redundant\0" /* 324 */ - "PHPStan\\Type\\Type\0" /* 334 */ - "targetWrite\0" /* 352 */ - "type\0" /* 364 */ - "holdsDestructibleObject\0" /* 369 */ - "PHPStan\\Node\\Variable\\VariableWrite\0" /* 393 */ - "writeSite\0" /* 429 */ - "escapeRoot"; /* 439 */ + "targetRead\0" /* 254 */ + "flow\0" /* 265 */ + "writes\0" /* 270 */ + "kind\0" /* 277 */ + "scope\0" /* 282 */ + "PHPStan\\Analyser\\MutatingScope\0" /* 288 */ + "redundant\0" /* 319 */ + "PHPStan\\Type\\Type\0" /* 329 */ + "targetWrite\0" /* 347 */ + "type\0" /* 359 */ + "holdsDestructibleObject\0" /* 364 */ + "PHPStan\\Node\\Variable\\VariableWrite\0" /* 388 */ + "writeSite\0" /* 424 */ + "escapeRoot"; /* 434 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 5), /* throws $expr */ reg::packed(25, MAY_BE_ARRAY), /* throws $throwPoints */ @@ -70,23 +69,23 @@ inline constexpr reg::PackedArg args[] = { reg::packed(233, 0, 5), /* targetRead $target */ reg::packed(148, 0, 156), /* targetRead $storage */ reg::packed(240, MAY_BE_BOOL), /* targetRead $read */ - reg::packed(245, MAY_BE_NULL | MAY_BE_LONG, reg::NoString, false, false, 254), /* targetRead $targetId */ + reg::packed(245, MAY_BE_NULL | MAY_BE_LONG), /* targetRead $targetId */ reg::packed(37, MAY_BE_NULL, 38), /* targetRead return */ - reg::packed(270, MAY_BE_NULL, 38), /* writes $flow */ + reg::packed(265, MAY_BE_NULL, 38), /* writes $flow */ reg::packed(37, MAY_BE_ARRAY), /* writes return */ reg::packed(233, 0, 5), /* targetWrite $target */ - reg::packed(282, MAY_BE_LONG), /* targetWrite $kind */ - reg::packed(287, 0, 293), /* targetWrite $scope */ + reg::packed(277, MAY_BE_LONG), /* targetWrite $kind */ + reg::packed(282, 0, 288), /* targetWrite $scope */ reg::packed(148, 0, 156), /* targetWrite $storage */ - reg::packed(324, MAY_BE_NULL, 334, false, false, 254), /* targetWrite $redundant */ + reg::packed(319, MAY_BE_NULL, 329), /* targetWrite $redundant */ reg::packed(37, MAY_BE_NULL, 38), /* targetWrite return */ - reg::packed(364, 0, 334), /* holdsDestructibleObject $type */ + reg::packed(359, 0, 329), /* holdsDestructibleObject $type */ reg::packed(37, MAY_BE_BOOL), /* holdsDestructibleObject return */ reg::packed(233, 0, 5), /* writeSite $target */ - reg::packed(282, MAY_BE_LONG), /* writeSite $kind */ - reg::packed(287, 0, 293), /* writeSite $scope */ + reg::packed(277, MAY_BE_LONG), /* writeSite $kind */ + reg::packed(282, 0, 288), /* writeSite $scope */ reg::packed(148, 0, 156), /* writeSite $storage */ - reg::packed(37, MAY_BE_NULL, 393), /* writeSite return */ + reg::packed(37, MAY_BE_NULL, 388), /* writeSite return */ reg::packed(0, 0, 5), /* escapeRoot $expr */ reg::packed(37, MAY_BE_NULL, 38), /* escapeRoot return */ }; @@ -98,12 +97,12 @@ namespace sig { inline constexpr sigtab::Sig throws = { { 68 /* throws */, 2, 0, 2, 2, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig arguments = { { 197 /* arguments */, 3, 3, 3, 6, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig child = { { 227 /* child */, 2, 7, 2, 9, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig targetRead = { { 259 /* targetRead */, 3, 10, 4, 14, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig writes = { { 275 /* writes */, 1, 15, 1, 16, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig targetWrite = { { 352 /* targetWrite */, 4, 17, 5, 22, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig holdsDestructibleObject = { { 369 /* holdsDestructibleObject */, 1, 23, 1, 24, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig writeSite = { { 429 /* writeSite */, 4, 25, 4, 29, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig escapeRoot = { { 439 /* escapeRoot */, 1, 30, 1, 31, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig targetRead = { { 254 /* targetRead */, 4, 10, 4, 14, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig writes = { { 270 /* writes */, 1, 15, 1, 16, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig targetWrite = { { 347 /* targetWrite */, 5, 17, 5, 22, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig holdsDestructibleObject = { { 364 /* holdsDestructibleObject */, 1, 23, 1, 24, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig writeSite = { { 424 /* writeSite */, 4, 25, 4, 29, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig escapeRoot = { { 434 /* escapeRoot */, 1, 30, 1, 31, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; } // namespace sig } // namespace ptdecl::VariableFlowBuilder diff --git a/turbo-ext/src/generated/VariableHandler.h b/turbo-ext/src/generated/VariableHandler.h index 900580ecf56..c1de53420cd 100644 --- a/turbo-ext/src/generated/VariableHandler.h +++ b/turbo-ext/src/generated/VariableHandler.h @@ -54,20 +54,19 @@ inline constexpr char strings[] = "PHPStan\\Analyser\\MutatingScope\0" /* 449 */ "nameResult\0" /* 480 */ "PHPStan\\Analyser\\ExpressionResult\0" /* 491 */ - "null\0" /* 525 */ - "nameArgResult\0" /* 530 */ - "Closure\0" /* 544 */ - "createTypeCallback\0" /* 552 */ - "stmt\0" /* 571 */ - "PhpParser\\Node\\Stmt\0" /* 576 */ - "scope\0" /* 596 */ - "storage\0" /* 602 */ - "PHPStan\\Analyser\\ExpressionResultStorage\0" /* 610 */ - "nodeCallback\0" /* 651 */ - "context\0" /* 664 */ - "PHPStan\\Analyser\\ExpressionContext\0" /* 672 */ - "processExpr\0" /* 707 */ - "composeResult"; /* 719 */ + "nameArgResult\0" /* 525 */ + "Closure\0" /* 539 */ + "createTypeCallback\0" /* 547 */ + "stmt\0" /* 566 */ + "PhpParser\\Node\\Stmt\0" /* 571 */ + "scope\0" /* 591 */ + "storage\0" /* 597 */ + "PHPStan\\Analyser\\ExpressionResultStorage\0" /* 605 */ + "nodeCallback\0" /* 646 */ + "context\0" /* 659 */ + "PHPStan\\Analyser\\ExpressionContext\0" /* 667 */ + "processExpr\0" /* 702 */ + "composeResult"; /* 714 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 24), /* __construct $expressionResultFactory */ reg::packed(65, 0, 88), /* __construct $defaultNarrowingHelper */ @@ -78,23 +77,23 @@ inline constexpr reg::PackedArg args[] = { reg::packed(320, 0, 355), /* createTypeCallback $expr */ reg::packed(384, 0, 402), /* createTypeCallback $nodeScopeResolver */ reg::packed(437, 0, 449), /* createTypeCallback $beforeScope */ - reg::packed(480, MAY_BE_NULL, 491, false, false, 525), /* createTypeCallback $nameResult */ - reg::packed(530, MAY_BE_NULL, 491, false, false, 525), /* createTypeCallback $nameArgResult */ - reg::packed(345, 0, 544), /* createTypeCallback return */ + reg::packed(480, MAY_BE_NULL, 491), /* createTypeCallback $nameResult */ + reg::packed(525, MAY_BE_NULL, 491), /* createTypeCallback $nameArgResult */ + reg::packed(345, 0, 539), /* createTypeCallback return */ reg::packed(384, 0, 402), /* processExpr $nodeScopeResolver */ - reg::packed(571, 0, 576), /* processExpr $stmt */ + reg::packed(566, 0, 571), /* processExpr $stmt */ reg::packed(320, 0, 325), /* processExpr $expr */ - reg::packed(596, 0, 449), /* processExpr $scope */ - reg::packed(602, 0, 610), /* processExpr $storage */ - reg::packed(651, MAY_BE_CALLABLE), /* processExpr $nodeCallback */ - reg::packed(664, 0, 672), /* processExpr $context */ + reg::packed(591, 0, 449), /* processExpr $scope */ + reg::packed(597, 0, 605), /* processExpr $storage */ + reg::packed(646, MAY_BE_CALLABLE), /* processExpr $nodeCallback */ + reg::packed(659, 0, 667), /* processExpr $context */ reg::packed(345, 0, 491), /* processExpr return */ reg::packed(384, 0, 402), /* composeResult $nodeScopeResolver */ reg::packed(320, 0, 355), /* composeResult $expr */ reg::packed(480, MAY_BE_NULL, 491), /* composeResult $nameResult */ - reg::packed(602, 0, 610), /* composeResult $storage */ + reg::packed(597, 0, 605), /* composeResult $storage */ reg::packed(437, 0, 449), /* composeResult $beforeScope */ - reg::packed(664, MAY_BE_NULL, 672, false, false, 525), /* composeResult $context */ + reg::packed(659, MAY_BE_NULL, 667), /* composeResult $context */ reg::packed(345, 0, 491), /* composeResult return */ }; using Sig = reg::Sig; @@ -104,9 +103,9 @@ using Sig = reg::Sig; namespace sig { inline constexpr sigtab::Sig __construct = { { 308 /* __construct */, 4, 0, 4, reg::NoArg, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig supports = { { 346 /* supports */, 1, 4, 1, 5, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig createTypeCallback = { { 552 /* createTypeCallback */, 3, 6, 5, 11, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig processExpr = { { 707 /* processExpr */, 7, 12, 7, 19, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig composeResult = { { 719 /* composeResult */, 5, 20, 6, 26, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig createTypeCallback = { { 547 /* createTypeCallback */, 5, 6, 5, 11, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processExpr = { { 702 /* processExpr */, 7, 12, 7, 19, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig composeResult = { { 714 /* composeResult */, 6, 20, 6, 26, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::VariableHandler diff --git a/turbo-ext/src/generated/VariableLivenessResolver.h b/turbo-ext/src/generated/VariableLivenessResolver.h index 58688e0ebee..0c0bd11ad38 100644 --- a/turbo-ext/src/generated/VariableLivenessResolver.h +++ b/turbo-ext/src/generated/VariableLivenessResolver.h @@ -101,19 +101,18 @@ inline constexpr char strings[] = "name\0" /* 257 */ "write\0" /* 262 */ "discard\0" /* 268 */ - "false\0" /* 276 */ - "passBindingProbes\0" /* 282 */ - "offset\0" /* 300 */ - "offsetKey\0" /* 307 */ - "compileAccesses\0" /* 317 */ - "accesses\0" /* 333 */ - "compileOverwrites\0" /* 342 */ - "replacedSlot\0" /* 360 */ - "id\0" /* 373 */ - "observeWrite\0" /* 376 */ - "observeOverwrite\0" /* 389 */ - "resolveDependencies\0" /* 406 */ - "resolveCoverage"; /* 426 */ + "passBindingProbes\0" /* 276 */ + "offset\0" /* 294 */ + "offsetKey\0" /* 301 */ + "compileAccesses\0" /* 311 */ + "accesses\0" /* 327 */ + "compileOverwrites\0" /* 336 */ + "replacedSlot\0" /* 354 */ + "id\0" /* 367 */ + "observeWrite\0" /* 370 */ + "observeOverwrite\0" /* 383 */ + "resolveDependencies\0" /* 400 */ + "resolveCoverage"; /* 420 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, 0, 21), /* resolve $function */ reg::packed(49, MAY_BE_NULL, 54), /* resolve $flow */ @@ -130,20 +129,20 @@ inline constexpr reg::PackedArg args[] = { reg::packed(133, MAY_BE_ARRAY), /* passBindingProbes $next */ reg::packed(257, MAY_BE_STRING), /* passBindingProbes $name */ reg::packed(262, MAY_BE_NULL, 202), /* passBindingProbes $write */ - reg::packed(268, MAY_BE_BOOL, reg::NoString, false, false, 276), /* passBindingProbes $discard */ + reg::packed(268, MAY_BE_BOOL), /* passBindingProbes $discard */ reg::packed(84, MAY_BE_ARRAY), /* passBindingProbes return */ - reg::packed(300, 0), /* offsetKey $offset */ + reg::packed(294, 0), /* offsetKey $offset */ reg::packed(84, MAY_BE_STRING), /* offsetKey return */ reg::packed(84, MAY_BE_VOID), /* compileAccesses return */ reg::packed(257, MAY_BE_STRING), /* compileOverwrites $name */ - reg::packed(333, MAY_BE_ARRAY), /* compileOverwrites $accesses */ + reg::packed(327, MAY_BE_ARRAY), /* compileOverwrites $accesses */ reg::packed(84, MAY_BE_VOID), /* compileOverwrites return */ reg::packed(262, 0, 202), /* replacedSlot $write */ reg::packed(84, MAY_BE_NULL | MAY_BE_STRING), /* replacedSlot return */ - reg::packed(373, MAY_BE_LONG), /* observeWrite $id */ + reg::packed(367, MAY_BE_LONG), /* observeWrite $id */ reg::packed(133, MAY_BE_ARRAY), /* observeWrite $next */ reg::packed(84, MAY_BE_VOID), /* observeWrite return */ - reg::packed(373, MAY_BE_LONG), /* observeOverwrite $id */ + reg::packed(367, MAY_BE_LONG), /* observeOverwrite $id */ reg::packed(133, MAY_BE_ARRAY), /* observeOverwrite $next */ reg::packed(84, MAY_BE_VOID), /* observeOverwrite return */ reg::packed(84, MAY_BE_VOID), /* resolveDependencies return */ @@ -159,15 +158,15 @@ inline constexpr sigtab::Sig resolve = { { 117 /* resolve */, 2, 0, 2, 2, ZEND_A inline constexpr sigtab::Sig collect = { { 125 /* collect */, 1, 3, 1, 4, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig liveBefore = { { 183 /* liveBefore */, 3, 5, 3, 8, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig bindingProbe = { { 244 /* bindingProbe */, 2, 9, 2, 11, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig passBindingProbes = { { 282 /* passBindingProbes */, 3, 12, 4, 16, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig offsetKey = { { 307 /* offsetKey */, 1, 17, 1, 18, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig compileAccesses = { { 317 /* compileAccesses */, 0, 19, 0, 19, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig compileOverwrites = { { 342 /* compileOverwrites */, 2, 20, 2, 22, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig replacedSlot = { { 360 /* replacedSlot */, 1, 23, 1, 24, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig observeWrite = { { 376 /* observeWrite */, 2, 25, 2, 27, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig observeOverwrite = { { 389 /* observeOverwrite */, 2, 28, 2, 30, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveDependencies = { { 406 /* resolveDependencies */, 0, 31, 0, 31, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig resolveCoverage = { { 426 /* resolveCoverage */, 0, 32, 0, 32, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig passBindingProbes = { { 276 /* passBindingProbes */, 4, 12, 4, 16, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig offsetKey = { { 301 /* offsetKey */, 1, 17, 1, 18, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig compileAccesses = { { 311 /* compileAccesses */, 0, 19, 0, 19, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig compileOverwrites = { { 336 /* compileOverwrites */, 2, 20, 2, 22, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig replacedSlot = { { 354 /* replacedSlot */, 1, 23, 1, 24, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig observeWrite = { { 370 /* observeWrite */, 2, 25, 2, 27, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig observeOverwrite = { { 383 /* observeOverwrite */, 2, 28, 2, 30, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveDependencies = { { 400 /* resolveDependencies */, 0, 31, 0, 31, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig resolveCoverage = { { 420 /* resolveCoverage */, 0, 32, 0, 32, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::VariableLivenessResolver diff --git a/turbo-ext/src/generated/VolatileExpressionHelper.h b/turbo-ext/src/generated/VolatileExpressionHelper.h index 9a5935e29d6..5c1afa3ac46 100644 --- a/turbo-ext/src/generated/VolatileExpressionHelper.h +++ b/turbo-ext/src/generated/VolatileExpressionHelper.h @@ -30,10 +30,8 @@ inline constexpr char strings[] = "scope\0" /* 94 */ "PHPStan\\Analyser\\Scope\0" /* 100 */ "functionNames\0" /* 123 */ - "self::EXISTENCE_CHECK_FUNCTION_NAMES\0" /* 137 */ - "declaredSymbolName\0" /* 174 */ - "null\0" /* 193 */ - "invalidateNegativeExistenceChecks"; /* 198 */ + "declaredSymbolName\0" /* 137 */ + "invalidateNegativeExistenceChecks"; /* 156 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_ARRAY, reg::NoString, true, false), /* invalidateVolatileFunctionCalls $expressionTypes */ reg::packed(16, MAY_BE_ARRAY, reg::NoString, true, false), /* invalidateVolatileFunctionCalls $nativeExpressionTypes */ @@ -44,8 +42,8 @@ inline constexpr reg::PackedArg args[] = { reg::packed(94, 0, 100), /* invalidateNegativeExistenceChecks $scope */ reg::packed(0, MAY_BE_ARRAY, reg::NoString, true, false), /* invalidateNegativeExistenceChecks $expressionTypes */ reg::packed(16, MAY_BE_ARRAY, reg::NoString, true, false), /* invalidateNegativeExistenceChecks $nativeExpressionTypes */ - reg::packed(123, MAY_BE_ARRAY, reg::NoString, false, false, 137), /* invalidateNegativeExistenceChecks $functionNames */ - reg::packed(174, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 193), /* invalidateNegativeExistenceChecks $declaredSymbolName */ + reg::packed(123, MAY_BE_ARRAY), /* invalidateNegativeExistenceChecks $functionNames */ + reg::packed(137, MAY_BE_NULL | MAY_BE_STRING), /* invalidateNegativeExistenceChecks $declaredSymbolName */ reg::packed(38, MAY_BE_BOOL), /* invalidateNegativeExistenceChecks return */ }; using Sig = reg::Sig; @@ -55,7 +53,7 @@ using Sig = reg::Sig; namespace sig { inline constexpr sigtab::Sig invalidateVolatileFunctionCalls = { { 39 /* invalidateVolatileFunctionCalls */, 2, 0, 2, 2, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig invalidateSuperglobals = { { 71 /* invalidateSuperglobals */, 2, 3, 2, 5, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig invalidateNegativeExistenceChecks = { { 198 /* invalidateNegativeExistenceChecks */, 3, 6, 5, 11, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig invalidateNegativeExistenceChecks = { { 156 /* invalidateNegativeExistenceChecks */, 5, 6, 5, 11, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; } // namespace sig } // namespace ptdecl::VolatileExpressionHelper diff --git a/turbo-ext/tests/analyser-values.php b/turbo-ext/tests/analyser-values.php index 8d50161bb7e..2b26d6ed47a 100644 --- a/turbo-ext/tests/analyser-values.php +++ b/turbo-ext/tests/analyser-values.php @@ -191,7 +191,7 @@ function check(bool $cond, string $msg): void $avException = $types['exception']; $avError = $types['error']; $plain = in_array($side, ['native plain', 'native over PHP collaborators'], true); - $newResult = static fn (\PhpParser\Node\Expr $expr, \PHPStan\Type\Type $type, bool $hasYield = false, bool $isAlwaysTerminating = false, array $throwPoints = [], array $impurePoints = [], ?object $descriptor = null) => new $c['ExpressionResult']($avNoExtensions, $avDefaultNarrowingHelper, $avScope, $avScope, $expr, $hasYield, $isAlwaysTerminating, $throwPoints, $impurePoints, null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $type, nativeType: $type, issetabilityDescriptor: $plain ? null : $descriptor); + $newResult = static fn (\PhpParser\Node\Expr $expr, \PHPStan\Type\Type $type, bool $hasYield = false, bool $isAlwaysTerminating = false, array $throwPoints = [], array $impurePoints = [], ?object $descriptor = null) => new $c['ExpressionResult']($avNoExtensions, $avDefaultNarrowingHelper, $avScope, $avScope, $expr, $hasYield, $isAlwaysTerminating, $throwPoints, $impurePoints, null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $type, nativeType: $type, issetabilityDescriptor: $plain ? null : $descriptor, containsNullsafe: false, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, argsResult: null, variableFlow: null); // ---- ImpurePoint ---- $impure = new $c['ImpurePoint']($avScope, $avN['call'], 'functionCall', 'call to function f', true); @@ -223,7 +223,7 @@ function check(bool $cond, string $msg): void // ---- InternalThrowPoint ---- $itpExplicit = $c['InternalThrowPoint']::createExplicit($avScope, $avException, $avN['call'], false); $itpExplicitAny = $c['InternalThrowPoint']::createExplicit(canContainAnyThrowable: true, node: $avN['stmt'], type: $avThrowable, scope: $avOtherScope); - $itpImplicit = $c['InternalThrowPoint']::createImplicit($avScope, $avN['call']); + $itpImplicit = $c['InternalThrowPoint']::createImplicit($avScope, $avN['call'], null); $itpImplicitTyped = $c['InternalThrowPoint']::createImplicit($avScope, $avN['a'], $avError); foreach (['explicit' => $itpExplicit, 'explicit any' => $itpExplicitAny, 'implicit' => $itpImplicit, 'implicit typed' => $itpImplicitTyped] as $label => $itp) { $public = $itp->toPublic(); @@ -250,7 +250,7 @@ function check(bool $cond, string $msg): void $argCall = $newResult($avN['call'], $avString); $wrapped = $newResult($avN['call'], $avString, true, false, [$itpImplicit], [$impure]); $args = new $c['ArgsResult']($wrapped, null, [spl_object_id($avN['a']) => $argA, spl_object_id($avN['call']) => $argCall], [spl_object_id($avN['a']) => true, spl_object_id($avN['m']) => null]); - $argsDefault = new $c['ArgsResult'](argResults: [], resolvedParametersAcceptor: new \PHPStan\Reflection\TrivialParametersAcceptor('f'), expressionResult: $newResult($avN['one'], $avInt, false, true)); + $argsDefault = new $c['ArgsResult'](argResults: [], resolvedParametersAcceptor: new \PHPStan\Reflection\TrivialParametersAcceptor('f'), expressionResult: $newResult($avN['one'], $avInt, false, true), byRefArguments: []); $acceptor = new \PHPStan\Reflection\TrivialParametersAcceptor(); $withAcceptor = $args->withResolvedParametersAcceptor($acceptor); $r['args result'] = [ @@ -327,22 +327,21 @@ function check(bool $cond, string $msg): void foreach ([[$avScope, false, false], [$avScope, true, false], [$avScope, false, true], [$avOtherScope, true, true], [$avOtherScope->doNotTreatPhpDocTypesAsCertain(), false, true]] as $i => [$scope, $native, $reprocess]) { $row[$i] = $avCatch(static fn () => $descriptor->resolve($scope, $native, $expr, $reprocess)); } - $row['default reprocess'] = $avCatch(static fn () => $descriptor->resolve(expr: $expr, useNativeTypes: false, scope: $avScope)); $row['through the result'] = $avCatch(static fn () => $newResult($expr, $avInt, descriptor: $descriptor)->getIssetabilityResolution($avScope, false, true)); $r['issetability ' . $label] = $row; } $r['issetability resolver calls'] = $resolverCalls; $r['issetability private constructor'] = $avCatch(static fn () => new $c['IssetabilityDescriptor']('variable')); - $r['issetability uninitialized'] = $avCatch(static fn () => (new \ReflectionClass($c['IssetabilityDescriptor']))->newInstanceWithoutConstructor()->resolve($avScope, false, $avN['a'])); + $r['issetability uninitialized'] = $avCatch(static fn () => (new \ReflectionClass($c['IssetabilityDescriptor']))->newInstanceWithoutConstructor()->resolve($avScope, false, $avN['a'], false)); $broken = (new \ReflectionClass($c['IssetabilityDescriptor']))->newInstanceWithoutConstructor(); foreach (['kind' => 'offset', 'variableName' => null, 'varResult' => null, 'dimResult' => null, 'innerResult' => null, 'reflectionResolver' => null, 'propertyFetch' => null] as $property => $value) { (new \ReflectionProperty($c['IssetabilityDescriptor'], $property))->setValue($broken, $value); } - $r['issetability broken offset'] = $avCatch(static fn () => $broken->resolve($avScope, false, $avN['a'])); + $r['issetability broken offset'] = $avCatch(static fn () => $broken->resolve($avScope, false, $avN['a'], false)); (new \ReflectionProperty($c['IssetabilityDescriptor'], 'kind'))->setValue($broken, 'variable'); - $r['issetability broken variable'] = $avCatch(static fn () => $broken->resolve($avScope, false, $avN['a'])); + $r['issetability broken variable'] = $avCatch(static fn () => $broken->resolve($avScope, false, $avN['a'], false)); (new \ReflectionProperty($c['IssetabilityDescriptor'], 'kind'))->setValue($broken, 'something else'); - $r['issetability broken property'] = $avCatch(static fn () => $broken->resolve($avScope, false, $avN['a'])); + $r['issetability broken property'] = $avCatch(static fn () => $broken->resolve($avScope, false, $avN['a'], false)); // deep chains (a fresh tree per side: the read variable names are cached // on the nodes) @@ -350,7 +349,7 @@ function check(bool $cond, string $msg): void for ($i = 1; $i < $avDeepChainDepth; $i++) { $deepConcat = new \PhpParser\Node\Expr\BinaryOp\Concat($deepConcat, new \PhpParser\Node\Expr\Variable('a' . ($i % 3))); } - $r['deep read variable names'] = $avCatch(static fn () => $newResult($deepConcat, $avInt)->askScopeVariableStateMatches($avOtherScope, false)); + $r['deep read variable names'] = $avCatch(static fn () => $newResult($deepConcat, $avInt)->askScopeVariableStateMatches($avOtherScope, false, false)); $deepDescriptor = $c['IssetabilityDescriptor']::variable('arr'); for ($i = 1; $i < $avDeepChainDepth; $i++) { $deepDescriptor = $i % 2 === 0 @@ -358,7 +357,7 @@ function check(bool $cond, string $msg): void : $c['IssetabilityDescriptor']::property($newResult($avN['arr'], $avArray, descriptor: $deepDescriptor), $resolverFor('parent'), $avN['thisParent']); } $r['deep issetability descriptor'] = $avCatch(static function () use ($deepDescriptor, $avScope, $avN, &$avDeepChainsKeptAlive): bool { - $resolution = $deepDescriptor->resolve($avScope, false, $avN['dimA']); + $resolution = $deepDescriptor->resolve($avScope, false, $avN['dimA'], false); $avDeepChainsKeptAlive[] = $resolution; return $resolution->getLink()->isProperty(); }); @@ -386,7 +385,7 @@ function check(bool $cond, string $msg): void // Exit points leaving the loop at every depth, scopes carrying inference // facts (the constructor joins them into the result's scope), end // statements, and keyed throw points (toPublic() preserves the keys). -$avFacts = \Closure::bind(static fn (string $name) => new \PHPStan\Analyser\Generics\TemplateArgumentConstraints(null, null, [$name, null, null, true]), null, \PHPStan\Analyser\Generics\TemplateArgumentConstraints::class); +$avFacts = \Closure::bind(static fn (string $name) => new \PHPStan\Analyser\Generics\TemplateArgumentConstraints(null, null, [$name, null, null, true], null), null, \PHPStan\Analyser\Generics\TemplateArgumentConstraints::class); $avFactScopes = [ 'f1' => $avScope->withTemplateArgumentConstraints($avFacts('f1')), 'f2' => $avOtherScope->withTemplateArgumentConstraints($avFacts('f2')), @@ -418,7 +417,7 @@ function check(bool $cond, string $msg): void foreach ($avStatementSides as $side => $c) { $r = []; $types = $avThrowTypes[$side === 'php' ? 'php' : 'native']; - $flow = \PHPStan\Analyser\VariableFlow::read('a'); + $flow = \PHPStan\Analyser\VariableFlow::read('a', null, false, null); $exit = static fn (string $stmt, string $scope) => new $c['InternalStatementExitPoint']($avStmt[$stmt], $avKnownScopes[$scope]); $exitPoint = $exit('return', 'f1'); $r['exit point'] = [$exitPoint->getStatement() === $avStmt['return'], $exitPoint->getScope() === $avFactScopes['f1'], $avDescribe($exitPoint->toPublic()), $avDescribe($exitPoint)]; @@ -429,7 +428,7 @@ function check(bool $cond, string $msg): void $r['end statement'] = [$endStatement->getStatement() === $avStmt['return'], $endStatement->getResult() === $inner, $avDescribe($endStatement->toPublic()), $avDescribe($endStatement)]; $r['end statement uninitialized'] = $avCatch(static fn () => (new \ReflectionClass($c['InternalEndStatementResult']))->newInstanceWithoutConstructor()->toPublic()); - $throwPoints = ['x' => $c['InternalThrowPoint']::createImplicit($avScope, $avN['call']), 5 => $c['InternalThrowPoint']::createExplicit($avScope, $types['exception'], $avN['call'], false)]; + $throwPoints = ['x' => $c['InternalThrowPoint']::createImplicit($avScope, $avN['call'], null), 5 => $c['InternalThrowPoint']::createExplicit($avScope, $types['exception'], $avN['call'], false)]; $impurePoints = [new $c['ImpurePoint']($avScope, $avN['call'], 'functionCall', 'f', true)]; $exitSets = [ 'none' => [], @@ -609,15 +608,15 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type foreach ($avSites as $label => $site) { $site->setAttribute('label', $label); } -$avFramedScope = $avScope->withTemplateArgumentFrame(new \PHPStan\Analyser\Generics\TemplateArgumentFrame(null, [])); +$avFramedScope = $avScope->withTemplateArgumentFrame(new \PHPStan\Analyser\Generics\TemplateArgumentFrame(null, [], [], null, [], [], false, [], [], [])); $avFrameResults = []; foreach (['php' => [\PHPStan\Analyser\Generics\TemplateArgumentFrame::class, \PHPStan\Analyser\AssignTargetWalkMode::class, \PHPStan\Analyser\PreparedAssignTarget::class], 'native' => [\PHPStanTurbo\TemplateArgumentFrame::class, \PHPStanTurbo\AssignTargetWalkMode::class, \PHPStanTurbo\PreparedAssignTarget::class]] as $side => [$frameClass, $modeClass, $targetClass]) { $r = []; $id = static fn (string $site): int => spl_object_id($avSites[$site]); - $root = new $frameClass(null, [$id('site') . '#U' => $avString, $id('other site') . '#T' => $avInt, $id('site') . '#N' => null], [3 => true, 1 => true, 7 => true]); - $observing = new $frameClass($root); - $observingTop = new $frameClass(null); - $leaf = new $frameClass(siteStatementIndexes: [5 => true, 'x' => true, 2 => true], resolutions: [$id('site') . '#V' => $avArray], parent: $observing); + $root = new $frameClass(null, [$id('site') . '#U' => $avString, $id('other site') . '#T' => $avInt, $id('site') . '#N' => null], [3 => true, 1 => true, 7 => true], null, [], [], false, [], [], []); + $observing = new $frameClass($root, null, [], null, [], [], false, [], [], []); + $observingTop = new $frameClass(null, null, [], null, [], [], false, [], [], []); + $leaf = new $frameClass(siteStatementIndexes: [5 => true, 'x' => true, 2 => true], resolutions: [$id('site') . '#V' => $avArray], parent: $observing, closureSignatureBody: null, closureSignatureStmts: [], settledClosureSites: [], observingClosures: false, byRefSites: [], staticVariableTypes: [], staticVariableConditionalExpressions: []); $frames = ['root' => $root, 'observing' => $observing, 'observing top' => $observingTop, 'leaf' => $leaf]; $frameLabel = static function (string $suffix) use ($frames): string { foreach ($frames as $label => $frame) { @@ -662,10 +661,10 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type } } // the by-ref closure sites: found by the node's id holding that very node, then in the parents - $byRefRoot = new $frameClass(null, [], byRefSites: [$id('site') => [$avSites['site'], 4, true], $id('other site') => [$avSites['other site'], 2, false], 12345678 => [$avSites['with original'], 9, true]]); - $byRefLeaf = new $frameClass($byRefRoot, [], byRefSites: [$id('other site') => [$avSites['other site'], 1, true]]); + $byRefRoot = new $frameClass(null, [], byRefSites: [$id('site') => [$avSites['site'], 4, true], $id('other site') => [$avSites['other site'], 2, false], 12345678 => [$avSites['with original'], 9, true]], siteStatementIndexes: [], closureSignatureBody: null, closureSignatureStmts: [], settledClosureSites: [], observingClosures: false, staticVariableTypes: [], staticVariableConditionalExpressions: []); + $byRefLeaf = new $frameClass($byRefRoot, [], byRefSites: [$id('other site') => [$avSites['other site'], 1, true]], siteStatementIndexes: [], closureSignatureBody: null, closureSignatureStmts: [], settledClosureSites: [], observingClosures: false, staticVariableTypes: [], staticVariableConditionalExpressions: []); $byRefObserved = $byRefLeaf->withObservedClosures([], [], [], [$id('site') => [$avSites['site'], 7, false]]); - $byRefUnobserved = $byRefLeaf->withObservedClosures([], [], []); + $byRefUnobserved = $byRefLeaf->withObservedClosures([], [], [], []); foreach (['root' => $byRefRoot, 'leaf' => $byRefLeaf, 'observed' => $byRefObserved, 'unobserved' => $byRefUnobserved, 'none' => $observing] as $label => $frame) { $row = []; foreach ($avSites as $siteLabel => $site) { @@ -681,8 +680,8 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type $avCatch(static fn () => (new \ReflectionClass($frameClass))->newInstanceWithoutConstructor()->resolve($avSites['site'], 'U')), $avCatch(static fn () => (new \ReflectionClass($frameClass))->newInstanceWithoutConstructor()->getResolutionCacheKeySuffix()), $avCatch(static function () use ($frameClass) { - $frame = new $frameClass(null); - $frame->__construct(null); + $frame = new $frameClass(null, null, [], null, [], [], false, [], [], []); + $frame->__construct(null, null, [], null, [], [], false, [], [], []); return $frame; }), ]; @@ -696,14 +695,15 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type // PreparedAssignTarget: the required arguments only, then every one $getters = ['getKind', 'getVar', 'getAssignedExpr', 'getBeforeScope', 'getScope', 'enterExpressionAssign', 'isAssignOp', 'hasYield', 'getThrowPoints', 'getImpurePoints', 'isAlwaysTerminating', 'getRootVar', 'getVarResult', 'getDimFetchStack', 'getAssignedPropertyExpr', 'getOffsetTypes', 'getOffsetNativeTypes', 'getExistingOffsetTypes', 'getExistingOffsetNativeTypes', 'getOffsetSetTargetResult', 'getObjectResult', 'getPropertyName', 'getPropertyHolderType', 'getTargetReadResult', 'getTargetChainResults', 'getVariableNameResult']; - $minimal = new $targetClass($targetClass::KIND_VARIABLE, $avN['a'], $avN['call'], $avScope, $avOtherScope, true, false, true, ['t'], ['i'], false); + $minimal = new $targetClass($targetClass::KIND_VARIABLE, $avN['a'], $avN['call'], $avScope, $avOtherScope, true, false, true, ['t'], ['i'], false, null, null, null, null, null, null, null, null, null, null, null, null, null, [], null, null); $someResult = $newResult($avN['a'], $avInt); $full = new $targetClass( $targetClass::KIND_ARRAY_DIM_FETCH, $avN['dim'], $avN['one'], $avOtherScope, $avScope, false, true, false, [], [], true, $avN['arr'], $someResult, [$avN['dim']], $avN['a'], [[null, $avN['dim']]], [[$avInt, $avN['dim']]], [[$avString, $avN['dim']]], [[$avArray, $avN['dim']]], $someResult, $someResult, 'prop', $avString, $someResult, [$someResult], $someResult, + null, ); - $named = new $targetClass(kind: $targetClass::KIND_PROPERTY_FETCH, var: $avN['thisParent'], assignedExpr: $avN['a'], beforeScope: $avScope, scope: $avScope, enterExpressionAssign: false, isAssignOp: false, hasYield: false, throwPoints: [], impurePoints: [], isAlwaysTerminating: false, propertyName: null, objectResult: $someResult, targetChainResults: [$someResult]); + $named = new $targetClass(kind: $targetClass::KIND_PROPERTY_FETCH, var: $avN['thisParent'], assignedExpr: $avN['a'], beforeScope: $avScope, scope: $avScope, enterExpressionAssign: false, isAssignOp: false, hasYield: false, throwPoints: [], impurePoints: [], isAlwaysTerminating: false, propertyName: null, objectResult: $someResult, targetChainResults: [$someResult], rootVar: null, varResult: null, dimFetchStack: null, assignedPropertyExpr: null, offsetTypes: null, offsetNativeTypes: null, existingOffsetTypes: null, existingOffsetNativeTypes: null, offsetSetTargetResult: null, propertyHolderType: null, targetReadResult: null, variableNameResult: null, dependencies: null); foreach (['minimal' => $minimal, 'full' => $full, 'named' => $named] as $label => $target) { $row = []; foreach ($getters as $getter) { @@ -776,15 +776,15 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type foreach (['php' => $avSides['php'], 'native' => $avSides['native']] as $side => $c) { $throwPoints = [ $c['InternalThrowPoint']::createExplicit($avScope, $avThrowTypes[$side]['exception'], $avFlowCall, false), - $c['InternalThrowPoint']::createImplicit($avScope, $avFlowCall), - $c['InternalThrowPoint']::createImplicit($avScope, $avN['a']), + $c['InternalThrowPoint']::createImplicit($avScope, $avFlowCall, null), + $c['InternalThrowPoint']::createImplicit($avScope, $avN['a'], null), ]; $storage = new \PHPStanTurbo\ExpressionResultStorage(); - $newResult = static fn (\PhpParser\Node\Expr $expr, \PHPStan\Type\Type $type, ?object $flow = null) => new $c['ExpressionResult']($avNoExtensions, $avDefaultNarrowingHelper, $avScope, $avScope, $expr, false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $type, nativeType: $type, variableFlow: $flow); + $newResult = static fn (\PhpParser\Node\Expr $expr, \PHPStan\Type\Type $type, ?object $flow = null) => new $c['ExpressionResult']($avNoExtensions, $avDefaultNarrowingHelper, $avScope, $avScope, $expr, false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $type, nativeType: $type, variableFlow: $flow, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, argsResult: null); // each side's flow class: a PHP ExpressionResult holds only the PHP one // under the prefix $flowClass = $side === 'php' ? \PHPStan\Analyser\VariableFlow::class : \PHPStanTurbo\VariableFlow::class; - $argsResult = new $c['ArgsResult']($newResult($avFlowCall, $avInt), null, [spl_object_id($avN['a']) => $newResult($avN['a'], $avInt, $flowClass::read('a'))], [spl_object_id($avN['arr']) => true]); + $argsResult = new $c['ArgsResult']($newResult($avFlowCall, $avInt), null, [spl_object_id($avN['a']) => $newResult($avN['a'], $avInt, $flowClass::read('a', null, false, null))], [spl_object_id($avN['arr']) => true]); $avFlowThrowPoints[$side] = [ $avFlowDescribe(\PHPStanTurbo\VariableFlowBuilder::throws($avFlowCall, $throwPoints)), $avFlowDescribe(\PHPStanTurbo\VariableFlowBuilder::throws($avN['a'], $throwPoints)), @@ -802,7 +802,7 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type foreach (['php' => [\PHPStan\Analyser\ProcessClosureResult::class, \PHPStan\Analyser\ProcessArrowFunctionResult::class, $avSides['php']], 'native' => [\PHPStanTurbo\ProcessClosureResult::class, \PHPStanTurbo\ProcessArrowFunctionResult::class, $avSides['native']]] as $side => [$closureResultClass, $arrowResultClass, $c]) { $r = []; $impure = new $c['ImpurePoint']($avScope, $avN['call'], 'functionCall', 'call to function f', true); - $throwPoint = $c['InternalThrowPoint']::createImplicit($avScope, $avN['call']); + $throwPoint = $c['InternalThrowPoint']::createImplicit($avScope, $avN['call'], null); $plain = new $closureResultClass($avScope, [$throwPoint], [$impure], [], [[$avN['stmt'], $avScope]], [], [], [$impure, $impure]); $byRef = new $closureResultClass(scope: $avOtherScope, throwPoints: [], impurePoints: [], invalidateExpressions: [], gatheredReturnStatements: [], gatheredYieldStatements: [[$avN['call'], $avOtherScope]], executionEnds: [], closureTypeImpurePoints: [], byRefClosureResultScope: $avOtherScope, byRefUses: [$avByRefUse]); foreach (['plain' => $plain, 'by ref' => $byRef] as $label => $result) { @@ -824,7 +824,7 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type $avCatch(static fn () => (new \ReflectionClass($closureResultClass))->newInstanceWithoutConstructor()->getScope()), $avCatch(static fn () => (new \ReflectionClass($closureResultClass))->newInstanceWithoutConstructor()->applyByRefUseScope($avScope)), ]; - $exprResult = new $c['ExpressionResult']($avNoExtensions, $avDefaultNarrowingHelper, $avScope, $avScope, $avN['a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $avInt, nativeType: $avInt); + $exprResult = new $c['ExpressionResult']($avNoExtensions, $avDefaultNarrowingHelper, $avScope, $avScope, $avN['a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $avInt, nativeType: $avInt, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, argsResult: null, variableFlow: null); $arrow = new $arrowResultClass($exprResult, $avOtherScope, [$throwPoint->toPublic()], [$impure], []); $arrowNamed = new $arrowResultClass(invalidateExpressions: [], closureTypeImpurePoints: [], closureTypeThrowPoints: [], arrowFunctionScope: $avScope, expressionResult: $exprResult); foreach (['positional' => $arrow, 'named' => $arrowNamed] as $label => $result) { @@ -901,7 +901,7 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type } $r['link ' . $label] = $row; } - $r['link private constructor'] = $avCatch(static fn () => new $L('variable')); + $r['link private constructor'] = $avCatch(static fn () => new $L('variable', null, null, null, null, false, null, null, null, null, null, false, false, null, null, false, false, false, false, false, false, false, null, false)); $r['link uninitialized'] = $avCatch(static fn () => (new \ReflectionClass($L))->newInstanceWithoutConstructor()->isVariable()); $r['link uninitialized getter'] = $avCatch(static fn () => (new \ReflectionClass($L))->newInstanceWithoutConstructor()->getValueType()); $r['link named'] = $avDescribe($L::offset(valueType: $avString, dimType: $avInt, varType: $avArray, hasExpressionTypeOfExpr: true, hasOffsetValue: $avMaybe, isOffsetAccessible: $avYes)); @@ -940,7 +940,7 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type 'not empty' => $avCatch(static fn () => $resolution->notEmpty()), ]; foreach ($callbacks as $callbackLabel => $callback) { - $row[$callbackLabel] = $avCatch(static fn () => $resolution->isSet($callback)); + $row[$callbackLabel] = $avCatch(static fn () => $resolution->isSet($callback, null)); $row[$callbackLabel . ' true'] = $avCatch(static fn () => $resolution->isSet($callback, true)); $row[$callbackLabel . ' false'] = $avCatch(static fn () => $resolution->isSet(result: false, typeCallback: $callback)); } @@ -951,16 +951,16 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type $chains['offset / offset / variable']->isSet(static function (\PHPStan\Type\Type $type) use (&$calls): bool { $calls[] = $type->describe(\PHPStan\Type\VerbosityLevel::precise()); return true; - }); + }, null); return $calls; })(); - $r['resolution callback returns int'] = $avCatch(static fn () => $chains['variable yes']->isSet(static fn () => 1)); + $r['resolution callback returns int'] = $avCatch(static fn () => $chains['variable yes']->isSet(static fn () => 1, null)); $r['resolution callback throws'] = $avCatch(static fn () => $chains['offset accessible yes / variable yes']->isSet(static function (): bool { throw new \RuntimeException('callback failed'); - })); - $r['resolution not callable'] = $avCatch(static fn () => $chains['variable yes']->isSet('no such function')); + }, null)); + $r['resolution not callable'] = $avCatch(static fn () => $chains['variable yes']->isSet('no such function', null)); $r['resolution bad result'] = $avCatch(static fn () => $chains['variable yes']->isSet(static fn () => true, 1)); - $r['resolution uninitialized'] = $avCatch(static fn () => (new \ReflectionClass($R))->newInstanceWithoutConstructor()->isSet(static fn () => true)); + $r['resolution uninitialized'] = $avCatch(static fn () => (new \ReflectionClass($R))->newInstanceWithoutConstructor()->isSet(static fn () => true, null)); $r['resolution uninitialized not empty'] = $avCatch(static fn () => (new \ReflectionClass($R))->newInstanceWithoutConstructor()->notEmpty()); $r['resolution uninitialized link'] = $avCatch(static fn () => (new \ReflectionClass($R))->newInstanceWithoutConstructor()->getLink()); $r['resolution named'] = $avDescribe(new $R(inner: null, link: $links['leaf'])); @@ -973,8 +973,8 @@ public function resolveConditionalTypes(\PHPStan\Type\Type $type): \PHPStan\Type $deepUndefinedResolution = new $R($links['offset not accessible'], $deepUndefinedResolution); } $r['deep resolution'] = [ - $avCatch(static fn () => $deepResolution->isSet(static fn (): bool => true)), - $avCatch(static fn () => $deepUndefinedResolution->isSet(static fn (): bool => true)), + $avCatch(static fn () => $deepResolution->isSet(static fn (): bool => true, null)), + $avCatch(static fn () => $deepUndefinedResolution->isSet(static fn (): bool => true, null)), ]; $avDeepChainsKeptAlive[] = [$deepResolution, $deepUndefinedResolution]; diff --git a/turbo-ext/tests/initializer-escape.php b/turbo-ext/tests/initializer-escape.php index 9e48cfd9499..38334d5143b 100644 --- a/turbo-ext/tests/initializer-escape.php +++ b/turbo-ext/tests/initializer-escape.php @@ -81,19 +81,19 @@ public function getPlusType($left, $right, callable $cb) { $this->keep(__FUNCTIO public function getMinusType($left, $right, callable $cb) { $this->keep(__FUNCTION__, $cb, $left); return $this->inner->getMinusType($left, $right, $cb); } public function getMulType($left, $right, callable $cb) { $this->keep(__FUNCTION__, $cb, $right); return $this->inner->getMulType($left, $right, $cb); } public function getArrayType($expr, callable $cb) { $this->keep(__FUNCTION__, $cb, $expr->items[0]->value); return $this->inner->getArrayType($expr, $cb); } - public function getClassConstFetchTypeByReflection($class, $constantName, $classReflection, callable $cb) { $this->keep(__FUNCTION__, $cb, $class); return $this->inner->getClassConstFetchTypeByReflection($class, $constantName, $classReflection, $cb); } + public function getClassConstFetchTypeByReflection($class, $constantName, $classReflection, callable $cb, $nativeTypesPromoted) { $this->keep(__FUNCTION__, $cb, $class); return $this->inner->getClassConstFetchTypeByReflection($class, $constantName, $classReflection, $cb, $nativeTypesPromoted); } public function resolveEqualType($left, $right) { return $this->inner->resolveEqualType($left, $right); } public function resolveIdenticalType($left, $right) { return $this->inner->resolveIdenticalType($left, $right); } public function resolveConcatType($left, $right) { return $this->inner->resolveConcatType($left, $right); } }; $ieCalls = [ - 'UnaryMinusHandler' => static fn ($storage) => (new \PHPStanTurbo\UnaryMinusHandler($ieKeeping, $ieFactory, $ieDefault))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\UnaryMinus(new \PhpParser\Node\Expr\Variable('a')), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep()), - 'UnaryPlusHandler' => static fn ($storage) => (new \PHPStanTurbo\UnaryPlusHandler($ieKeeping, $ieFactory, $ieDefault))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\UnaryPlus(new \PhpParser\Node\Expr\Variable('n')), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep()), - 'BitwiseNotHandler' => static fn ($storage) => (new \PHPStanTurbo\BitwiseNotHandler($ieKeeping, $ieFactory, $ieDefault))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\BitwiseNot(new \PhpParser\Node\Expr\Variable('a')), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep()), - 'ArrayHandler' => static fn ($storage) => (new \PHPStanTurbo\ArrayHandler($ieKeeping, $ieFactory, $ieContainer->getByType(\PHPStan\Analyser\ExprHandler\Helper\ClosureTypeResolver::class)))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\Array_([new \PhpParser\Node\ArrayItem(new \PhpParser\Node\Expr\Variable('n')), new \PhpParser\Node\ArrayItem(new \PhpParser\Node\Scalar\Int_(5))]), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep()), - 'ClassConstFetchHandler' => static fn ($storage) => (new \PHPStanTurbo\ClassConstFetchHandler($ieKeeping, $ieFactory, $ieDefault, $ieContainer->getByType(\PHPStan\Reflection\ReflectionProvider::class)))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\ClassConstFetch(new \PhpParser\Node\Expr\Variable('n'), 'FOO'), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep()), - 'BinaryOpHandler' => static fn ($storage) => (new \PHPStanTurbo\BinaryOpHandler($ieKeeping, $ieContainer->getByType(\PHPStan\Analyser\RicherScopeGetTypeHelper::class), $ieContainer->getByType(\PHPStan\Php\PhpVersion::class), $ieContainer->getByType(\PHPStan\Analyser\ExprHandler\Helper\ImplicitToStringCallHelper::class), $ieContainer->getByType(\PHPStan\Node\Printer\ExprPrinter::class), $ieIdentical, $ieContainer->getByType(\PHPStan\Analyser\ExprHandler\Helper\CountNarrowingHelper::class), $ieFactory, $ieDefault))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\BinaryOp\Minus(new \PhpParser\Node\Expr\Variable('a'), new \PhpParser\Node\Scalar\Int_(3)), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep()), + 'UnaryMinusHandler' => static fn ($storage) => (new \PHPStanTurbo\UnaryMinusHandler($ieKeeping, $ieFactory, $ieDefault))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\UnaryMinus(new \PhpParser\Node\Expr\Variable('a')), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep(true)), + 'UnaryPlusHandler' => static fn ($storage) => (new \PHPStanTurbo\UnaryPlusHandler($ieKeeping, $ieFactory, $ieDefault))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\UnaryPlus(new \PhpParser\Node\Expr\Variable('n')), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep(true)), + 'BitwiseNotHandler' => static fn ($storage) => (new \PHPStanTurbo\BitwiseNotHandler($ieKeeping, $ieFactory, $ieDefault))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\BitwiseNot(new \PhpParser\Node\Expr\Variable('a')), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep(true)), + 'ArrayHandler' => static fn ($storage) => (new \PHPStanTurbo\ArrayHandler($ieKeeping, $ieFactory, $ieContainer->getByType(\PHPStan\Analyser\ExprHandler\Helper\ClosureTypeResolver::class)))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\Array_([new \PhpParser\Node\ArrayItem(new \PhpParser\Node\Expr\Variable('n')), new \PhpParser\Node\ArrayItem(new \PhpParser\Node\Scalar\Int_(5))]), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep(true)), + 'ClassConstFetchHandler' => static fn ($storage) => (new \PHPStanTurbo\ClassConstFetchHandler($ieKeeping, $ieFactory, $ieDefault, $ieContainer->getByType(\PHPStan\Reflection\ReflectionProvider::class)))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\ClassConstFetch(new \PhpParser\Node\Expr\Variable('n'), 'FOO'), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep(true)), + 'BinaryOpHandler' => static fn ($storage) => (new \PHPStanTurbo\BinaryOpHandler($ieKeeping, $ieContainer->getByType(\PHPStan\Analyser\RicherScopeGetTypeHelper::class), $ieContainer->getByType(\PHPStan\Php\PhpVersion::class), $ieContainer->getByType(\PHPStan\Analyser\ExprHandler\Helper\ImplicitToStringCallHelper::class), $ieContainer->getByType(\PHPStan\Node\Printer\ExprPrinter::class), $ieIdentical, $ieContainer->getByType(\PHPStan\Analyser\ExprHandler\Helper\CountNarrowingHelper::class), $ieFactory, $ieDefault))->processExpr($ieNodeScopeResolver, $ieStmt, new \PhpParser\Node\Expr\BinaryOp\Minus(new \PhpParser\Node\Expr\Variable('a'), new \PhpParser\Node\Scalar\Int_(3)), $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep(true)), ]; foreach ($ieCalls as $label => $call) { $storage = new \PHPStan\Analyser\ExpressionResultStorage(); @@ -127,7 +127,7 @@ public function resolveConcatType($left, $right) { return $this->inner->resolveC $ieScope->pushExpressionResultStorage($storage); try { $ieVarExpr = new \PhpParser\Node\Expr\Variable('a'); - $ieVarResult = $ieNodeScopeResolver->processExprNode($ieStmt, $ieVarExpr, $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep()); + $ieVarResult = $ieNodeScopeResolver->processExprNode($ieStmt, $ieVarExpr, $ieScope, $storage, new \PHPStan\Analyser\NoopNodeCallback(), \PHPStan\Analyser\ExpressionContext::createDeep(true)); foreach ([true, false] as $increment) { $ieTypeCallback = (new \PHPStanTurbo\IncDecTypeHelper($ieKeeping))->getTypeCallback($ieVarExpr, $ieVarResult, $increment); check(is_string($ieDescribe($ieTypeCallback(false))) && is_string($ieDescribe($ieTypeCallback(true))), 'escaping getTypeCallback (IncDecTypeHelper): the callback resolves'); diff --git a/turbo-ext/tests/scope-family.php b/turbo-ext/tests/scope-family.php index b60fc4cf039..904212e0d1f 100644 --- a/turbo-ext/tests/scope-family.php +++ b/turbo-ext/tests/scope-family.php @@ -766,7 +766,7 @@ public function exprRef(Node\Expr $expr): mixed ->enterNamespace('ScopeFamilyFixture') ->assignVariable('this', new \PHPStan\Type\ObjectType(\ScopeFamilyFixture\Holder::class), new \PHPStan\Type\ObjectType(\ScopeFamilyFixture\Holder::class), \PHPStan\TrinaryLogic::createYes()) ->assignVariable('items', new \PHPStan\Type\ArrayType(new \PHPStan\Type\IntegerType(), new \PHPStan\Type\StringType()), new \PHPStan\Type\ArrayType(new \PHPStan\Type\IntegerType(), new \PHPStan\Type\StringType()), \PHPStan\TrinaryLogic::createYes()) - ->enterExpressionAssign($sfAssignedPropertyFetch) + ->enterExpressionAssign($sfAssignedPropertyFetch, true) ->enterExpressionAssign($sfAssignedDimFetch, false) ->setAllowedUndefinedExpression($sfAssignedDimFetch); $sfScopes[spl_object_id($sfAssignScope)] = [$sfAssignScope, [$sfAssignedPropertyFetch, $sfAssignedDimFetch], null]; @@ -1457,7 +1457,7 @@ public function exprRef(Node\Expr $expr): mixed // the closure cache key $definedRoots = array_map(static fn (string $v): string => '$' . $v, array_slice($scope->getDefinedVariables(), 0, 2)); - $observe('getClosureScopeCacheKey()', static fn () => $scope->getClosureScopeCacheKey()); + $observe('getClosureScopeCacheKey()', static fn () => $scope->getClosureScopeCacheKey(null)); $observe('getClosureScopeCacheKey([])', static fn () => $scope->getClosureScopeCacheKey([])); $observe('getClosureScopeCacheKey([$this])', static fn () => $scope->getClosureScopeCacheKey(['$this'])); $observe('getClosureScopeCacheKey(defined)', static fn () => $scope->getClosureScopeCacheKey($definedRoots)); @@ -1705,7 +1705,7 @@ public function exprRef(Node\Expr $expr): mixed 'intersectButNotNever(int, string)' => static fn () => ($scopeClass . '::intersectButNotNever')($int, $string), 'intersectButNotNever(int, int)' => static fn () => ($scopeClass . '::intersectButNotNever')($int, $int), 'intersectButNotNever(?int, int)' => static fn () => ($scopeClass . '::intersectButNotNever')((($side === 'native' ? 'PHPStanTurbo\\TypeCombinator' : \PHPStan\Type\TypeCombinator::class) . '::addNull')($int), $int), - 'enterExpressionAssign' => static fn () => $scope->enterExpressionAssign($propFetch), + 'enterExpressionAssign' => static fn () => $scope->enterExpressionAssign($propFetch, true), 'enterExpressionAssign(not plain)' => static fn () => $scope->enterExpressionAssign($propFetch, false), 'exitExpressionAssign' => static fn () => $scope->exitExpressionAssign($propFetch), 'setAllowedUndefinedExpression' => static fn () => $scope->setAllowedUndefinedExpression($dimFetch), @@ -2023,15 +2023,15 @@ public function exprRef(Node\Expr $expr): mixed 'processClosureScope(other, this)' => static fn () => $scope->processClosureScope($other, $scope, $byRefUses), 'processAlwaysIterableForeachScopeWithoutPollute(this)' => static fn () => $scope->processAlwaysIterableForeachScopeWithoutPollute($scope), 'processAlwaysIterableForeachScopeWithoutPollute(other)' => static fn () => $scope->processAlwaysIterableForeachScopeWithoutPollute($other), - 'generalizeWith(this)' => static fn () => $scope->generalizeWith($scope), - 'generalizeWith(other)' => static fn () => $scope->generalizeWith($other), + 'generalizeWith(this)' => static fn () => $scope->generalizeWith($scope, null), + 'generalizeWith(other)' => static fn () => $scope->generalizeWith($other, null), 'generalizeWith(other, nothing writable)' => static fn () => $scope->generalizeWith($other, []), 'generalizeWith(other, writable)' => static fn () => $scope->generalizeWith($other, ['g' => true, 'a' => true, 'out' => true]), - 'generalizeWith(other, reversed)' => static fn () => $other->generalizeWith($scope), + 'generalizeWith(other, reversed)' => static fn () => $other->generalizeWith($scope, null), // addTemplateArgumentConstraints() answers with $this for an // empty (or null) set, so only a non-empty one makes // generalizeWith()'s second half observable - 'generalizeWith(other with constraints)' => static fn () => $scope->generalizeWith($other->withTemplateArgumentConstraints($sfNonEmptyConstraints)), + 'generalizeWith(other with constraints)' => static fn () => $scope->generalizeWith($other->withTemplateArgumentConstraints($sfNonEmptyConstraints), null), 'equals(this)' => static fn () => $scope->equals($scope), 'equals(other)' => static fn () => $scope->equals($other), 'equals(other, reversed)' => static fn () => $other->equals($scope), diff --git a/turbo-ext/tests/smoke.php b/turbo-ext/tests/smoke.php index db61783b772..70465e7e60e 100644 --- a/turbo-ext/tests/smoke.php +++ b/turbo-ext/tests/smoke.php @@ -234,7 +234,6 @@ function check(bool $cond, string $msg): void $nMerged = \PHPStanTurbo\ScopeOps::mergeVariableHolders($mergeNOurs, $mergeNTheirs, $nDiffering); check($pDiffering === $nDiffering, 'ScopeOps mergeVariableHolders differingKeys parity: ' . json_encode($pDiffering) . ' vs ' . json_encode($nDiffering)); check(array_keys($pMerged) === array_keys($nMerged), 'ScopeOps mergeVariableHolders merged keys parity'); -check(array_keys(\PHPStanTurbo\ScopeOps::mergeVariableHolders($mergeNOurs, $mergeNTheirs)) === array_keys($nMerged), 'ScopeOps mergeVariableHolders without differingKeys'); // ---- ConditionalExpressionHolder ---- $covered[\PHPStan\Analyser\ConditionalExpressionHolder::class] = true; @@ -734,7 +733,8 @@ public function enterNode(\PhpParser\Node $node) $mergeResults = []; foreach ($scopeOpsClasses as $side => $scopeOpsClass) { [$ours, $theirs] = $mergeInputs($side); - $merged = $scopeOpsClass::mergeVariableHolders($ours, $theirs); + $differingKeys = []; + $merged = $scopeOpsClass::mergeVariableHolders($ours, $theirs, $differingKeys); $described = []; foreach ($merged as $exprString => $mergedHolder) { $described[$exprString] = [ @@ -2553,7 +2553,7 @@ enum SmokeTurboBacked: string $lruResults = []; foreach (['php' => \PHPStan\Internal\LruCache::class, 'native' => \PHPStanTurbo\LruCache::class] as $side => $lruClass) { $r = []; - $unbounded = new $lruClass(); + $unbounded = new $lruClass(0, 0, 0); $r[] = [$unbounded instanceof $lruClass, $unbounded->count(), $unbounded->all(), $unbounded->get('a')]; foreach ([['a', 'A', 1], ['10', 'ten', 2], ['b', ['B'], 3], ['0', 0.5, 4], ['a', 'A2', 5], ['01', null, 6], ['-3', true, 0]] as [$k, $v, $w]) { $r[] = [$k, $unbounded->set($k, $v, $w), $unbounded->count(), $unbounded->all()]; @@ -2569,14 +2569,14 @@ enum SmokeTurboBacked: string $r[] = [get_class($e), $e->getMessage()]; } - $byCount = new $lruClass(3); + $byCount = new $lruClass(3, 0, 0); foreach (['a', 'b', 'c', 'd', 'b', 'e', 'f'] as $i => $k) { $r[] = [$k, $byCount->set($k, $i, 0), $byCount->all()]; } $r[] = [$byCount->get('b'), $byCount->all()]; $r[] = [$byCount->set('g', 7, 0), $byCount->all(), $byCount->count()]; - $byWeight = new $lruClass(maxWeight: 10, weightEvictionFloorCount: 1); + $byWeight = new $lruClass(maxWeight: 10, weightEvictionFloorCount: 1, maxCount: 0); foreach ([['a', 4], ['b', 4], ['c', 4], ['huge', 100], ['d', 1], ['huge', 0], ['e', 9], ['f', 1]] as $i => [$k, $w]) { $r[] = [$k, $byWeight->set($k, $i, $w), $byWeight->all()]; } @@ -2667,15 +2667,15 @@ enum SmokeTurboBacked: string unset($e['$_GET'], $n['$_GET']); $r[] = [$vehClass::invalidateSuperglobals($e, $n), array_keys($e), array_keys($n)]; [$e, $n] = $vehInputs($side); - $r[] = [$vehClass::invalidateNegativeExistenceChecks($vehScope, $e, $n), array_keys($e), array_keys($n)]; + $r[] = [$vehClass::invalidateNegativeExistenceChecks($vehScope, $e, $n, \PHPStan\Analyser\VolatileExpressionHelper::EXISTENCE_CHECK_FUNCTION_NAMES, null), array_keys($e), array_keys($n)]; [$e, $n] = $vehInputs($side); - $r[] = [$vehClass::invalidateNegativeExistenceChecks($vehScope, $e, $n, ['function_exists']), array_keys($e), array_keys($n)]; + $r[] = [$vehClass::invalidateNegativeExistenceChecks($vehScope, $e, $n, ['function_exists'], null), array_keys($e), array_keys($n)]; [$e, $n] = $vehInputs($side); $r[] = [$vehClass::invalidateNegativeExistenceChecks($vehScope, $e, $n, ['class_exists', 'enum_exists'], '\FOO'), array_keys($e), array_keys($n)]; [$e, $n] = $vehInputs($side); $r[] = [$vehClass::invalidateNegativeExistenceChecks($vehScope, $e, $n, ['class_exists'], 'Other'), array_keys($e), array_keys($n)]; [$e, $n] = $vehInputs($side); - $r[] = [$vehClass::invalidateNegativeExistenceChecks($vehScope, $e, $n, ['strlen']), array_keys($e), array_keys($n)]; + $r[] = [$vehClass::invalidateNegativeExistenceChecks($vehScope, $e, $n, ['strlen'], null), array_keys($e), array_keys($n)]; // the by-reference contract: the caller's copies change, the originals stay [$e, $n] = $vehInputs($side); $copyE = $e; @@ -2812,28 +2812,28 @@ public function again(string $kind): void $vfNodeB = new \PhpParser\Node\Expr\Variable('b'); $vfArrow = new \PhpParser\Node\Expr\ArrowFunction(['expr' => $vfNodeA]); $vfForeach = new \PhpParser\Node\Stmt\Foreach_($vfNodeA, $vfNodeB); -$vfWriteA = new \PHPStan\Node\Variable\VariableWrite('a', $vfNodeA, 11, \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN); -$vfWriteItem = new \PHPStan\Node\Variable\VariableWrite('b', $vfNodeB, 12, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_LITERAL_ITEM, false, null, 11); +$vfWriteA = new \PHPStan\Node\Variable\VariableWrite('a', $vfNodeA, 11, \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN, false, null, null, true); +$vfWriteItem = new \PHPStan\Node\Variable\VariableWrite('b', $vfNodeB, 12, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_LITERAL_ITEM, false, null, 11, true); $vfWriteOffset = new \PHPStan\Node\Variable\VariableWrite('a', $vfNodeA, 13, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k', null, false); $vfInt = new \PHPStanTurbo\IntegerType(); $vfString = new \PHPStanTurbo\StringType(); $vfResults = []; foreach (['php' => \PHPStan\Analyser\VariableFlow::class, 'native' => \PHPStanTurbo\VariableFlow::class] as $side => $vf) { $r = []; - $readA = $vf::read('a'); + $readA = $vf::read('a', null, false, null); $readB = $vf::read('b', 7, true, 'k'); - $r[] = [$vfDescribe($readA), $vfDescribe($readB), $vfDescribe($vf::read('b', null, false, 3)), $vf::read('this'), $vf::read('_GET'), $vf::read('GLOBALS', 1)]; + $r[] = [$vfDescribe($readA), $vfDescribe($readB), $vfDescribe($vf::read('b', null, false, 3)), $vf::read('this', null, false, null), $vf::read('_GET', null, false, null), $vf::read('GLOBALS', 1, false, null)]; $r[] = [$vf::sequence(), $vf::sequence(null, null), $vf::sequence(null, $readA) === $readA, $vfDescribe($vf::sequence($readA, null, $readB)), $vfDescribe($vf::sequence(...[$readA, $readB, $readA]))]; $r[] = [$vf::choice(), $vf::choice($readA) === $readA, $vf::choice($readA, $readA) === $readA, $vf::choice(null, null), $vfDescribe($vf::choice($readA, null)), $vfDescribe($vf::choice($readA, $readB, null))]; $r[] = [$vfDescribe($vf::arrow($vfArrow, $readA, null)), $vfDescribe($vf::arrow($vfArrow, null, $readB))]; $r[] = [$vfDescribe($vf::conditional($readA, $readB, null)), $vfDescribe($vf::conditional($readA, $readB, $readA)), $vfDescribe($vf::conditional(null, $readB, $readA)), $vf::conditional(null, null, null), $vfDescribe($vf::conditional($readA, null, null))]; $r[] = [$vfDescribe($vf::switch($readA, [[$readB, $readA, false], [null, null, true]], true)), $vfDescribe($vf::switch(null, [], false))]; - $r[] = [$vfDescribe($vf::write($vfWriteA)), $vfDescribe($vf::write($vfWriteItem, $vfInt)), $vfDescribe($vf::write($vfWriteOffset, null)), $vfDescribe($vf::discard($vfWriteA)), $vfDescribe($vf::discard($vfWriteItem))]; + $r[] = [$vfDescribe($vf::write($vfWriteA, null)), $vfDescribe($vf::write($vfWriteItem, $vfInt)), $vfDescribe($vf::write($vfWriteOffset, null)), $vfDescribe($vf::discard($vfWriteA)), $vfDescribe($vf::discard($vfWriteItem))]; $r[] = [$vfDescribe($vf::inputs(11, null)), $vfDescribe($vf::inputs(12, 7))]; $r[] = [$vfDescribe($vf::escape('a')), $vfDescribe($vf::escape('this')), $vfDescribe($vf::mention('b')), $vfDescribe($vf::all($vf::READ_ALL)), $vfDescribe($vf::all($vf::MENTION_ALL)), $vfDescribe($vf::all($vf::OPAQUE))]; - $r[] = [$vfDescribe($vf::exit($vf::RETURN)), $vfDescribe($vf::exit($vf::BREAK, 2)), $vfDescribe($vf::exit($vf::CONTINUE, 1, 'x')), $vfDescribe($vf::exit($vf::STOP, 3, null))]; - $r[] = [$vfDescribe($vf::throwing($vfInt, true)), $vfDescribe($vf::throwing($vfString, false, true))]; - $r[] = [$vfDescribe($vf::loop($readA, $readB, null, true, false)), $vfDescribe($vf::loop(null, null, $readA, false, true, false))]; + $r[] = [$vfDescribe($vf::exit($vf::RETURN, 1, null)), $vfDescribe($vf::exit($vf::BREAK, 2, null)), $vfDescribe($vf::exit($vf::CONTINUE, 1, 'x')), $vfDescribe($vf::exit($vf::STOP, 3, null))]; + $r[] = [$vfDescribe($vf::throwing($vfInt, true, false)), $vfDescribe($vf::throwing($vfString, false, true))]; + $r[] = [$vfDescribe($vf::loop($readA, $readB, null, true, false, true)), $vfDescribe($vf::loop(null, null, $readA, false, true, false))]; $r[] = [$vf::loopStatement($vfForeach, $readA, [], [$vfWriteA]) === $readA, $vf::loopStatement($vfForeach, null, [], []), $vfDescribe($vf::loopStatement($vfForeach, $readA, [$vfWriteA], [$vfWriteA, $vfWriteOffset]))]; $r[] = [$vfDescribe($vf::tryCatch($readA, [[$vfInt, $readB], [$vfString, null]], null)), $vfDescribe($vf::tryCatch(null, [], $readB))]; $vfResults[$side] = $r; @@ -2844,7 +2844,7 @@ public function again(string $kind): void $vfRawResults = []; foreach (['php' => \PHPStan\Analyser\VariableFlow::class, 'native' => \PHPStanTurbo\VariableFlow::class] as $side => $vf) { try { - $vf::write($vfRawWrite); + $vf::write($vfRawWrite, null); $vfRawResults[$side] = 'no error'; } catch (\Error $e) { $vfRawResults[$side] = [get_class($e), $e->getMessage()]; @@ -2868,28 +2868,28 @@ public function again(string $kind): void $sequence = $ns . 'VariableSequenceFlow'; $input = $ns . 'VariableInputFlow'; $control = $ns . 'VariableControlFlow'; - $r[] = $capture(static fn () => new $access('read', 'a')); + $r[] = $capture(static fn () => new $access('read', 'a', null, null, null, false, null)); $r[] = $capture(static fn () => new $access('write', 'b', $vfWriteA, $vfInt, 3, true, 'k')); - $r[] = $capture(static fn () => new $access('read', 'c', offset: 5, container: true)); - $r[] = $capture(static fn () => new $sequence('choice', [null, new $access('read', 'a')])); + $r[] = $capture(static fn () => new $access('read', 'c', offset: 5, container: true, write: null, type: null, targetId: null)); + $r[] = $capture(static fn () => new $sequence('choice', [null, new $access('read', 'a', null, null, null, false, null)])); $r[] = $capture(static fn () => new $input(4, null)); $r[] = $capture(static fn () => new $input(4, 9)); - $r[] = $capture(static fn () => new $control('return')); + $r[] = $capture(static fn () => new $control('return', [], null, null, 1, false, true, [], null, [], true, false, null, [], [])); $r[] = $capture(static fn () => new $control('loopStatement', [new $input(1, 2)], 'n', $vfString, 2, true, false, [[$vfInt, null]], $vfArrow, [[null, null, true]], false, true, $vfForeach, [$vfWriteA], [$vfWriteItem])); - $r[] = $capture(static fn () => new $control('throw', type: $vfInt, canExit: false, canContainAnyThrowable: true)); - $r[] = $capture(static fn () => new $control('stop', 'x')); + $r[] = $capture(static fn () => new $control('throw', type: $vfInt, canExit: false, canContainAnyThrowable: true, children: [], name: null, level: 1, atLeastOnce: false, catches: [], arrow: null, cases: [], canRepeat: true, stmt: null, bindings: [], ownWrites: [])); + $r[] = $capture(static fn () => new $control('stop', 'x', null, null, 1, false, true, [], null, [], true, false, null, [], [])); // constructor arguments of the right types for a second construction $againArgs = [ - 'access' => ['stop', 'x'], + 'access' => ['stop', 'x', null, null, null, false, null], 'sequence' => ['choice', []], 'input' => [2, 3], - 'control' => ['stop', []], + 'control' => ['stop', [], null, null, 1, false, true, [], null, [], true, false, null, [], []], ]; foreach ([ - 'access' => static fn () => new $access('read', 'a'), + 'access' => static fn () => new $access('read', 'a', null, null, null, false, null), 'sequence' => static fn () => new $sequence('sequence', []), 'input' => static fn () => new $input(1, null), - 'control' => static fn () => new $control('return'), + 'control' => static fn () => new $control('return', [], null, null, 1, false, true, [], null, [], true, false, null, [], []), ] as $label => $make) { $flow = $make(); $args = $againArgs[$label]; @@ -2929,13 +2929,13 @@ public function again(string $kind): void return $values; }; $r = []; - $a = $deps::create('a.php', [$depsInt, null], ['Foo']); - $b = $deps::create('b.php', [], [], [], ['inc.php']); - $r[] = [$deps::create('x.php'), $deps::create('x.php', [null, null]), $deps::create('x.php', [], [], [], [], [])]; + $a = $deps::create('a.php', [$depsInt, null], ['Foo'], [], [], []); + $b = $deps::create('b.php', [], [], [], ['inc.php'], []); + $r[] = [$deps::create('x.php', [], [], [], [], []), $deps::create('x.php', [null, null], [], [], [], []), $deps::create('x.php', [], [], [], [], [])]; $r[] = [$deps::merge(), $deps::merge(null, null), $deps::merge(null, $a) === $a, $deps::merge($a) === $a, $deps::merge(...[$a, null]) === $a]; $ab = $deps::merge($a, null, $b); $r[] = [$walk($a), $walk($ab), $walk($deps::merge($ab, $a, $deps::merge($b, $ab)))]; - $r[] = $walk($deps::create('c.php', [1 => $depsString, 3 => null, 4 => $depsInt])); + $r[] = $walk($deps::create('c.php', [1 => $depsString, 3 => null, 4 => $depsInt], [], [], [], [])); try { $deps::merge($a, 'x'); $r[] = 'merge() of a string'; @@ -3063,7 +3063,7 @@ public function isFirstClassCallable(): bool \PHPStan\Analyser\InternalThrowPoint::createExplicit($vfbScope, $vfInt, $vfbN['samePos'], true), \PHPStan\Analyser\InternalThrowPoint::createExplicit($vfbScope, $vfString, $vfbN['otherPos'], false), \PHPStan\Analyser\InternalThrowPoint::createExplicit($vfbScope, $vfInt, $vfbN['noPos'], false), - \PHPStan\Analyser\InternalThrowPoint::createImplicit($vfbScope, $vfbN['a']), + \PHPStan\Analyser\InternalThrowPoint::createImplicit($vfbScope, $vfbN['a'], null), ]; $vfbSides = [ 'php' => [\PHPStan\Analyser\VariableFlowBuilder::class, \PHPStan\Analyser\VariableFlow::class, \PHPStan\Analyser\ExpressionResultStorage::class], @@ -3076,7 +3076,7 @@ public function isFirstClassCallable(): bool // hold the PHP flow classes on every side $storedVf = \PHPStan\Analyser\VariableFlow::class; $storage = new $storageClass(); - $flowA = $storedVf::read('a'); + $flowA = $storedVf::read('a', null, false, null); $flowB = $storedVf::escape('b'); $flowK = $storedVf::mention('k'); $storage->storeExpressionResult($vfbN['a'], $vfbMakeResult($flowA, $vfInt)); @@ -3091,7 +3091,7 @@ public function isFirstClassCallable(): bool $argsResult = new \PHPStan\Analyser\ArgsResult( $vfbMakeResult(null), null, - [spl_object_id($vfbN['a']) => $vfbMakeResult($storedVf::read('a', 99)), spl_object_id($vfbN['closure']) => $vfbMakeResult(null)], + [spl_object_id($vfbN['a']) => $vfbMakeResult($storedVf::read('a', 99, false, null)), spl_object_id($vfbN['closure']) => $vfbMakeResult(null)], [spl_object_id($vfbN['call']) => true], ); @@ -3118,13 +3118,13 @@ public function isFirstClassCallable(): bool $r[] = [$vfDescribe($builder::arguments($vfbN['overridingCall'], $argsResult, $storage)), $vfDescribe($builder::throws($vfbN['overridingCall'], $vfbThrowPoints)), $vfDescribe($builder::throws($vfbN['overridingFcc'], $vfbThrowPoints))]; $r[] = [$vfDescribe($builder::child($vfbN['a'], $storage)), $builder::child($vfbN['unknown'], $storage), $builder::child($vfbN['name'], $storage), $builder::child(null, $storage), $builder::child($vfbN['one'], $storage)]; foreach (['a', 'this', 'get', 'varVar', 'list', 'array', 'dimArrK', 'dimArrNested', 'dimArrNull', 'dimCall', 'dimVarVar', 'dimProp', 'prop', 'propExpr', 'nullsafeProp', 'staticProp', 'staticPropExpr', 'call', 'k'] as $key) { - $r[] = [$key, $vfDescribe($builder::targetRead($vfbN[$key], $storage, true)), $vfDescribe($builder::targetRead($vfbN[$key], $storage, false)), $vfDescribe($builder::targetRead($vfbN[$key], $storage, true, 5))]; + $r[] = [$key, $vfDescribe($builder::targetRead($vfbN[$key], $storage, true, null)), $vfDescribe($builder::targetRead($vfbN[$key], $storage, false, null)), $vfDescribe($builder::targetRead($vfbN[$key], $storage, true, 5))]; } foreach (['a', 'this', 'get', 'varVar', 'list', 'array', 'emptyList', 'dimArrK', 'dimArrNested', 'dimArrNull', 'dimStr', 'dimInt', 'dimMaybe', 'dimUnknown', 'dimThis', 'dimGet', 'dimCall', 'dimVarVar', 'dimProp', 'prop', 'call'] as $key) { - $write = $builder::targetWrite($vfbN[$key], \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN, $vfbScope, $storage); + $write = $builder::targetWrite($vfbN[$key], \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN, $vfbScope, $storage, null); $r[] = [$key, $vfDescribe($write), $vfDescribe($builder::targetWrite($vfbN[$key], \PHPStan\Node\Variable\VariableWrite::KIND_PRE_INC, $vfbScope, $storage, $vfInt)), $vfDescribeWrite($builder::writeSite($vfbN[$key], \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN, $vfbScope, $storage)), array_map($vfDescribeWrite, $builder::writes($write))]; } - $r[] = [$builder::writes(null), array_map($vfDescribeWrite, $builder::writes($vf::sequence($vf::write($vfWriteA), $vf::sequence($vf::escape('x'), $vf::write($vfWriteItem)), $vf::choice($vf::write($vfWriteOffset), null)))), $builder::writes($vf::all($vf::OPAQUE))]; + $r[] = [$builder::writes(null), array_map($vfDescribeWrite, $builder::writes($vf::sequence($vf::write($vfWriteA, null), $vf::sequence($vf::escape('x'), $vf::write($vfWriteItem, null)), $vf::choice($vf::write($vfWriteOffset, null), null)))), $builder::writes($vf::all($vf::OPAQUE))]; foreach (['a', 'this', 'varVar', 'dimArrNested', 'dimCall', 'dimVarVar', 'prop', 'call'] as $key) { $r[] = [$key, $vfDescribe($builder::escapeRoot($vfbN[$key]))]; } @@ -3176,117 +3176,117 @@ public function isFirstClassCallable(): bool $vlrFlows = [ 'empty' => null, 'plain' => $vlrF::sequence( - $vlrF::write($vlrWrite('a', 1)), - $vlrF::read('a'), + $vlrF::write($vlrWrite('a', 1), null), + $vlrF::read('a', null, false, null), $vlrF::write($vlrWrite('b', 2), $vlrInt), - $vlrF::write($vlrWrite('c', 3)), + $vlrF::write($vlrWrite('c', 3), null), $vlrF::inputs(3, null), - $vlrF::write($vlrWrite('d', 4)), + $vlrF::write($vlrWrite('d', 4), null), $vlrF::inputs(4, 5), - $vlrF::write($vlrWrite('e', 5)), - $vlrF::read('e'), - $vlrF::write($vlrWrite('f', 6)), - $vlrF::write($vlrWrite('f', 7)), - $vlrF::read('f'), + $vlrF::write($vlrWrite('e', 5), null), + $vlrF::read('e', null, false, null), + $vlrF::write($vlrWrite('f', 6), null), + $vlrF::write($vlrWrite('f', 7), null), + $vlrF::read('f', null, false, null), $vlrF::discard($vlrWrite('g', 8)), $vlrF::mention('m'), $vlrF::escape('h'), - $vlrF::write($vlrWrite('h', 9)), - $vlrF::write($vlrWrite('this', 10)), - $vlrF::write($vlrWrite('_GET', 11)), - $vlrF::read('unknown'), + $vlrF::write($vlrWrite('h', 9), null), + $vlrF::write($vlrWrite('this', 10), null), + $vlrF::write($vlrWrite('_GET', 11), null), + $vlrF::read('unknown', null, false, null), ), 'branches' => $vlrF::sequence( - $vlrF::write($vlrWrite('a', 1)), - $vlrF::conditional($vlrF::read('a'), $vlrF::write($vlrWrite('d', 2)), $vlrF::write($vlrWrite('d', 3))), - $vlrF::read('d'), - $vlrF::conditional(null, $vlrF::write($vlrWrite('x', 4)), $vlrF::write($vlrWrite('x', 5))), - $vlrF::conditional(null, $vlrF::write($vlrWrite('y', 6)), $vlrF::write($vlrWrite('y', 7))), - $vlrF::choice($vlrF::read('x'), $vlrF::read('y'), null), - $vlrF::switch($vlrF::read('s'), [[$vlrF::read('c1'), $vlrF::sequence($vlrF::write($vlrWrite('sw', 8)), $vlrF::exit($vlrF::BREAK)), false], [null, $vlrF::sequence($vlrF::read('sw'), $vlrF::write($vlrWrite('sw', 9))), true]], false), - $vlrF::switch($vlrF::read('s'), [[$vlrF::read('c2'), $vlrF::write($vlrWrite('ex', 10)), false]], true), - $vlrF::read('ex'), - $vlrF::sequence($vlrF::write($vlrWrite('seq', 11)), $vlrF::read('seq')), + $vlrF::write($vlrWrite('a', 1), null), + $vlrF::conditional($vlrF::read('a', null, false, null), $vlrF::write($vlrWrite('d', 2), null), $vlrF::write($vlrWrite('d', 3), null)), + $vlrF::read('d', null, false, null), + $vlrF::conditional(null, $vlrF::write($vlrWrite('x', 4), null), $vlrF::write($vlrWrite('x', 5), null)), + $vlrF::conditional(null, $vlrF::write($vlrWrite('y', 6), null), $vlrF::write($vlrWrite('y', 7), null)), + $vlrF::choice($vlrF::read('x', null, false, null), $vlrF::read('y', null, false, null), null), + $vlrF::switch($vlrF::read('s', null, false, null), [[$vlrF::read('c1', null, false, null), $vlrF::sequence($vlrF::write($vlrWrite('sw', 8), null), $vlrF::exit($vlrF::BREAK, 1, null)), false], [null, $vlrF::sequence($vlrF::read('sw', null, false, null), $vlrF::write($vlrWrite('sw', 9), null)), true]], false), + $vlrF::switch($vlrF::read('s', null, false, null), [[$vlrF::read('c2', null, false, null), $vlrF::write($vlrWrite('ex', 10), null), false]], true), + $vlrF::read('ex', null, false, null), + $vlrF::sequence($vlrF::write($vlrWrite('seq', 11), null), $vlrF::read('seq', null, false, null)), $vlrF::exit($vlrF::RETURN, 1, 'a'), - $vlrF::write($vlrWrite('after', 12)), + $vlrF::write($vlrWrite('after', 12), null), ), 'loops' => $vlrF::sequence( - $vlrF::write($vlrWrite('i', 1)), - $vlrF::write($vlrWrite('acc', 2)), - $vlrF::loop($vlrF::read('i'), $vlrF::sequence($vlrF::read('acc'), $vlrF::write($vlrWrite('acc', 3)), $vlrF::conditional($vlrF::read('stop'), $vlrF::exit($vlrF::BREAK), $vlrF::exit($vlrF::CONTINUE, 1)), $vlrF::write($vlrWrite('unreached', 4))), $vlrF::write($vlrWrite('i', 5)), false, true), - $vlrF::read('acc'), - $vlrF::loop(null, $vlrF::sequence($vlrF::write($vlrWrite('w', 6)), $vlrF::exit($vlrF::STOP)), null, true, false, false), - $vlrF::write($vlrWrite('k', 7)), - $vlrF::loopStatement($vlrForeach, $vlrF::loop(null, $vlrF::sequence($vlrF::write($vlrWrite('k', 8, \PHPStan\Node\Variable\VariableWrite::KIND_FOREACH_KEY)), $vlrF::read('k')), null, false, true), [$vlrWrite('k', 8, \PHPStan\Node\Variable\VariableWrite::KIND_FOREACH_KEY)], [$vlrWrite('k', 8, \PHPStan\Node\Variable\VariableWrite::KIND_FOREACH_KEY)]), - $vlrF::read('k'), - $vlrF::write($vlrWrite('j', 9)), - $vlrF::loopStatement($vlrFor, $vlrF::loop($vlrF::read('j'), $vlrF::read('body'), $vlrF::write($vlrWrite('j', 11)), false, true), [$vlrWrite('j', 10)], [$vlrWrite('j', 10), $vlrWrite('j', 11)]), + $vlrF::write($vlrWrite('i', 1), null), + $vlrF::write($vlrWrite('acc', 2), null), + $vlrF::loop($vlrF::read('i', null, false, null), $vlrF::sequence($vlrF::read('acc', null, false, null), $vlrF::write($vlrWrite('acc', 3), null), $vlrF::conditional($vlrF::read('stop', null, false, null), $vlrF::exit($vlrF::BREAK, 1, null), $vlrF::exit($vlrF::CONTINUE, 1, null)), $vlrF::write($vlrWrite('unreached', 4), null)), $vlrF::write($vlrWrite('i', 5), null), false, true, true), + $vlrF::read('acc', null, false, null), + $vlrF::loop(null, $vlrF::sequence($vlrF::write($vlrWrite('w', 6), null), $vlrF::exit($vlrF::STOP, 1, null)), null, true, false, false), + $vlrF::write($vlrWrite('k', 7), null), + $vlrF::loopStatement($vlrForeach, $vlrF::loop(null, $vlrF::sequence($vlrF::write($vlrWrite('k', 8, \PHPStan\Node\Variable\VariableWrite::KIND_FOREACH_KEY), null), $vlrF::read('k', null, false, null)), null, false, true, true), [$vlrWrite('k', 8, \PHPStan\Node\Variable\VariableWrite::KIND_FOREACH_KEY)], [$vlrWrite('k', 8, \PHPStan\Node\Variable\VariableWrite::KIND_FOREACH_KEY)]), + $vlrF::read('k', null, false, null), + $vlrF::write($vlrWrite('j', 9), null), + $vlrF::loopStatement($vlrFor, $vlrF::loop($vlrF::read('j', null, false, null), $vlrF::read('body', null, false, null), $vlrF::write($vlrWrite('j', 11), null), false, true, true), [$vlrWrite('j', 10)], [$vlrWrite('j', 10), $vlrWrite('j', 11)]), $vlrF::escape('j'), $vlrF::loopStatement($vlrForeach, null, [], []), ), 'exceptions' => $vlrF::sequence( - $vlrF::write($vlrWrite('t', 1)), + $vlrF::write($vlrWrite('t', 1), null), $vlrF::tryCatch( - $vlrF::sequence($vlrF::write($vlrWrite('t', 2)), $vlrF::throwing($vlrRuntime, true), $vlrF::write($vlrWrite('t', 3)), $vlrF::throwing($vlrString, false), $vlrF::write($vlrWrite('never', 4))), - [[$vlrException, $vlrF::sequence($vlrF::read('t'), $vlrF::write($vlrWrite('t', 5)))], [$vlrThrowable, $vlrF::read('caught')]], - $vlrF::sequence($vlrF::read('fin'), $vlrF::write($vlrWrite('fin', 6))), + $vlrF::sequence($vlrF::write($vlrWrite('t', 2), null), $vlrF::throwing($vlrRuntime, true, false), $vlrF::write($vlrWrite('t', 3), null), $vlrF::throwing($vlrString, false, false), $vlrF::write($vlrWrite('never', 4), null)), + [[$vlrException, $vlrF::sequence($vlrF::read('t', null, false, null), $vlrF::write($vlrWrite('t', 5), null))], [$vlrThrowable, $vlrF::read('caught', null, false, null)]], + $vlrF::sequence($vlrF::read('fin', null, false, null), $vlrF::write($vlrWrite('fin', 6), null)), ), - $vlrF::read('t'), - $vlrF::tryCatch($vlrF::sequence($vlrF::write($vlrWrite('u', 7)), $vlrF::throwing($vlrInt, false)), [[$vlrInt, $vlrF::read('u')]], null), - $vlrF::loop(null, $vlrF::tryCatch($vlrF::sequence($vlrF::write($vlrWrite('l', 8)), $vlrF::exit($vlrF::BREAK, 1), $vlrF::exit($vlrF::CONTINUE, 2)), [], $vlrF::read('l')), null, true, true), + $vlrF::read('t', null, false, null), + $vlrF::tryCatch($vlrF::sequence($vlrF::write($vlrWrite('u', 7), null), $vlrF::throwing($vlrInt, false, false)), [[$vlrInt, $vlrF::read('u', null, false, null)]], null), + $vlrF::loop(null, $vlrF::tryCatch($vlrF::sequence($vlrF::write($vlrWrite('l', 8), null), $vlrF::exit($vlrF::BREAK, 1, null), $vlrF::exit($vlrF::CONTINUE, 2, null)), [], $vlrF::read('l', null, false, null)), null, true, true, true), $vlrF::throwing($vlrString, false, true), - $vlrF::write($vlrWrite('unreachable', 9)), + $vlrF::write($vlrWrite('unreachable', 9), null), ), 'arrow and literals' => $vlrF::sequence( - $vlrF::write($vlrWrite('outer', 1)), - $vlrF::write($vlrWrite('p', 2)), - $vlrF::arrow($vlrArrow, $vlrF::sequence($vlrF::read('p'), $vlrF::read('outer'), $vlrF::write($vlrWrite('inner', 3))), $vlrF::read('res')), - $vlrF::read('p'), - $vlrF::write($vlrWrite('list', 4)), - $vlrF::write($vlrWrite('x', 5, \PHPStan\Node\Variable\VariableWrite::KIND_LIST_ITEM, false, null, 4)), - $vlrF::write($vlrWrite('y', 6, \PHPStan\Node\Variable\VariableWrite::KIND_LIST_ITEM, false, null, 4)), - $vlrF::read('x'), + $vlrF::write($vlrWrite('outer', 1), null), + $vlrF::write($vlrWrite('p', 2), null), + $vlrF::arrow($vlrArrow, $vlrF::sequence($vlrF::read('p', null, false, null), $vlrF::read('outer', null, false, null), $vlrF::write($vlrWrite('inner', 3), null)), $vlrF::read('res', null, false, null)), + $vlrF::read('p', null, false, null), + $vlrF::write($vlrWrite('list', 4), null), + $vlrF::write($vlrWrite('x', 5, \PHPStan\Node\Variable\VariableWrite::KIND_LIST_ITEM, false, null, 4), null), + $vlrF::write($vlrWrite('y', 6, \PHPStan\Node\Variable\VariableWrite::KIND_LIST_ITEM, false, null, 4), null), + $vlrF::read('x', null, false, null), $vlrF::inputs(4, null), - $vlrF::write($vlrWrite('o', 7, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k')), - $vlrF::write($vlrWrite('o', 8, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 1, null, false)), - $vlrF::write($vlrWrite('o', 9, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, null)), + $vlrF::write($vlrWrite('o', 7, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k'), null), + $vlrF::write($vlrWrite('o', 8, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 1, null, false), null), + $vlrF::write($vlrWrite('o', 9, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, null), null), $vlrF::read('o', null, false, 'k'), - $vlrF::read('o', 12, true), - $vlrF::read('o', 12), - $vlrF::write($vlrWrite('o', 10, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k')), + $vlrF::read('o', 12, true, null), + $vlrF::read('o', 12, false, null), + $vlrF::write($vlrWrite('o', 10, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k'), null), $vlrF::escape('o'), ), 'overwrites' => $vlrF::sequence( - $vlrF::write($vlrWrite('a', 1)), - $vlrF::write($vlrWrite('a', 2)), - $vlrF::read('a'), - $vlrF::write($vlrWrite('o', 3, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k')), - $vlrF::write($vlrWrite('o', 4, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'j')), - $vlrF::write($vlrWrite('o', 5, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k')), - $vlrF::write($vlrWrite('o', 6, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, null)), - $vlrF::write($vlrWrite('o', 7, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 1, null, false)), - $vlrF::write($vlrWrite('o', 8)), - $vlrF::read('o'), - $vlrF::write($vlrWrite('d', 9)), + $vlrF::write($vlrWrite('a', 1), null), + $vlrF::write($vlrWrite('a', 2), null), + $vlrF::read('a', null, false, null), + $vlrF::write($vlrWrite('o', 3, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k'), null), + $vlrF::write($vlrWrite('o', 4, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'j'), null), + $vlrF::write($vlrWrite('o', 5, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k'), null), + $vlrF::write($vlrWrite('o', 6, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, null), null), + $vlrF::write($vlrWrite('o', 7, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 1, null, false), null), + $vlrF::write($vlrWrite('o', 8), null), + $vlrF::read('o', null, false, null), + $vlrF::write($vlrWrite('d', 9), null), $vlrF::discard($vlrWrite('d', 10)), - $vlrF::write($vlrWrite('d', 11)), - $vlrF::read('d'), - $vlrF::loop(null, $vlrF::write($vlrWrite('l', 12)), null, false, true), - $vlrF::write($vlrWrite('c', 13)), - $vlrF::conditional(null, $vlrF::write($vlrWrite('c', 16)), null), - $vlrF::read('c'), - $vlrF::write($vlrWrite('r', 14)), - $vlrF::arrow($vlrArrow, $vlrF::write($vlrWrite('r', 15)), null), - $vlrF::write($vlrWrite('lit', 17)), - $vlrF::write($vlrWrite('lit', 18, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_LITERAL_ITEM, true, 'k', 17)), - $vlrF::write($vlrWrite('lit', 19, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k')), - $vlrF::read('lit'), - $vlrF::loop(null, $vlrF::sequence($vlrF::write($vlrWrite('lp', 20)), $vlrF::write($vlrWrite('lp', 21, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_LITERAL_ITEM, true, 'k', 20))), null, false, true), + $vlrF::write($vlrWrite('d', 11), null), + $vlrF::read('d', null, false, null), + $vlrF::loop(null, $vlrF::write($vlrWrite('l', 12), null), null, false, true, true), + $vlrF::write($vlrWrite('c', 13), null), + $vlrF::conditional(null, $vlrF::write($vlrWrite('c', 16), null), null), + $vlrF::read('c', null, false, null), + $vlrF::write($vlrWrite('r', 14), null), + $vlrF::arrow($vlrArrow, $vlrF::write($vlrWrite('r', 15), null), null), + $vlrF::write($vlrWrite('lit', 17), null), + $vlrF::write($vlrWrite('lit', 18, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_LITERAL_ITEM, true, 'k', 17), null), + $vlrF::write($vlrWrite('lit', 19, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k'), null), + $vlrF::read('lit', null, false, null), + $vlrF::loop(null, $vlrF::sequence($vlrF::write($vlrWrite('lp', 20), null), $vlrF::write($vlrWrite('lp', 21, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_LITERAL_ITEM, true, 'k', 20), null)), null, false, true, true), $vlrF::read('lp', null, false, 'j'), ), - 'read all' => $vlrF::sequence($vlrF::write($vlrWrite('a', 1)), $vlrF::write($vlrWrite('o', 2, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k')), $vlrF::all($vlrF::READ_ALL), $vlrF::write($vlrWrite('b', 3)), $vlrF::mention('c')), - 'mention all' => $vlrF::sequence($vlrF::write($vlrWrite('a', 1)), $vlrF::all($vlrF::MENTION_ALL)), - 'opaque' => $vlrF::sequence($vlrF::write($vlrWrite('a', 1)), $vlrF::all($vlrF::OPAQUE), $vlrF::read('a')), + 'read all' => $vlrF::sequence($vlrF::write($vlrWrite('a', 1), null), $vlrF::write($vlrWrite('o', 2, \PHPStan\Node\Variable\VariableWrite::KIND_ARRAY_DIM_WRITE, true, 'k'), null), $vlrF::all($vlrF::READ_ALL), $vlrF::write($vlrWrite('b', 3), null), $vlrF::mention('c')), + 'mention all' => $vlrF::sequence($vlrF::write($vlrWrite('a', 1), null), $vlrF::all($vlrF::MENTION_ALL)), + 'opaque' => $vlrF::sequence($vlrF::write($vlrWrite('a', 1), null), $vlrF::all($vlrF::OPAQUE), $vlrF::read('a', null, false, null)), ]; // the native side resolves native copies of the trees, over the same writes, // nodes and types (built through the native constructors) @@ -3482,7 +3482,7 @@ public function getType(\PhpParser\Node\Expr $expr, \PHPStan\Analyser\Scope $sco $r = []; $erContext = $side === 'php' ? \PHPStan\Analyser\TypeSpecifierContext::class : \PHPStanTurbo\TypeSpecifierContext::class; $erExtensionCalls = 0; - $flowA = \PHPStan\Analyser\VariableFlow::read('a'); + $flowA = \PHPStan\Analyser\VariableFlow::read('a', null, false, null); foreach ($erN as $exprLabel => $expr) { foreach ($erTypes as $typeLabel => [$type, $nativeType]) { $calls = 0; @@ -3498,8 +3498,8 @@ public function getType(\PhpParser\Node\Expr $expr, \PHPStan\Analyser\Scope $sco return new \PHPStan\Analyser\SpecifiedTypes(); }; $extensions = $exprLabel === 'variable ext' ? $erHitExtensions : $erNoExtensions; - $lazy = new $erClass($extensions, $erDefaultNarrowingHelper, $erScope, $erScope, $expr, false, true, [], [], $typeCallback, $specifyCallback, variableFlow: $flowA); - $eager = new $erClass($extensions, $erDefaultNarrowingHelper, $erScope, $erScope, $expr, true, false, [], [], null, $specifyCallback, type: $type, nativeType: $nativeType, containsNullsafe: true); + $lazy = new $erClass($extensions, $erDefaultNarrowingHelper, $erScope, $erScope, $expr, false, true, [], [], $typeCallback, $specifyCallback, variableFlow: $flowA, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, type: null, nativeType: null, argsResult: null); + $eager = new $erClass($extensions, $erDefaultNarrowingHelper, $erScope, $erScope, $expr, true, false, [], [], null, $specifyCallback, type: $type, nativeType: $nativeType, containsNullsafe: true, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, argsResult: null, variableFlow: null); $row = []; foreach (['lazy' => $lazy, 'eager' => $eager] as $kind => $result) { $row[$kind] = [ @@ -3527,21 +3527,21 @@ public function getType(\PhpParser\Node\Expr $expr, \PHPStan\Analyser\Scope $sco 'answersOther' => $result->answersOnScope($erOtherScope, false), 'answersOtherNative' => $result->answersOnScope($erOtherScope, true), 'answersWider' => $result->answersOnScope($erWiderScope, false), - 'askSame' => $result->askScopeVariableStateMatches($erScope, false), - 'askOther' => $result->askScopeVariableStateMatches($erOtherScope, false), - 'askOtherNative' => $result->askScopeVariableStateMatches($erOtherScope, true), + 'askSame' => $result->askScopeVariableStateMatches($erScope, false, false), + 'askOther' => $result->askScopeVariableStateMatches($erOtherScope, false, false), + 'askOtherNative' => $result->askScopeVariableStateMatches($erOtherScope, true, false), 'askOtherRule' => $result->askScopeVariableStateMatches($erOtherScope, false, true), 'askWiderRule' => $result->askScopeVariableStateMatches($erWiderScope, false, true), - 'askWider' => $result->askScopeVariableStateMatches($erWiderScope, false), + 'askWider' => $result->askScopeVariableStateMatches($erWiderScope, false, false), 'askEmpty' => $result->askScopeVariableStateMatches($vehScope, false, true), - 'specified' => get_class($result->getSpecifiedTypes($erContext::createTruthy())), - 'specified memo' => $result->getSpecifiedTypes($erContext::createTruthy()) === $result->getSpecifiedTypes($erContext::createTruthy()), + 'specified' => get_class($result->getSpecifiedTypes($erContext::createTruthy(), false)), + 'specified memo' => $result->getSpecifiedTypes($erContext::createTruthy(), false) === $result->getSpecifiedTypes($erContext::createTruthy(), false), 'specified for scope' => get_class($result->getSpecifiedTypesForScope($erScope, $erContext::createFalsey())), - 'created' => $result->getCreatedTypes($vfInt, \PHPStan\Analyser\TypeSpecifierContext::createTruthy()), + 'created' => $result->getCreatedTypes($vfInt, \PHPStan\Analyser\TypeSpecifierContext::createTruthy(), false), 'created for scope' => $result->getCreatedTypesForScope($erScope, $vfInt, \PHPStan\Analyser\TypeSpecifierContext::createTruthy()), 'truthy' => get_class($result->getTruthyScope()) . ($result->getTruthyScope() === $result->getTruthyScope() ? ' memo' : ''), 'falsey' => get_class($result->getFalseyScope()) . ($result->getFalseyScope() === $result->getFalseyScope() ? ' memo' : ''), - 'issetability' => $erDescribeResult($result->getIssetabilityResolution($erScope, false)->getLink()), + 'issetability' => $erDescribeResult($result->getIssetabilityResolution($erScope, false, false)->getLink()), 'issetability native' => $erDescribeResult($result->getIssetabilityResolution($erScope, true, true)->getLink()), 'withScope same' => $result->withScope($erScope) === $result, 'withScope other' => $erDescribeResult($result->withScope($erOtherScope)), @@ -3560,12 +3560,12 @@ public function getType(\PhpParser\Node\Expr $expr, \PHPStan\Analyser\Scope $sco $r['extension calls'] = $erExtensionCalls; // the constructor's invariants foreach ([ - 'callback and type' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], static fn (bool $n) => $vfInt, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $vfInt, nativeType: $vfInt), - 'nothing' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes()), - 'only resolved type' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), resolvedType: $vfInt), - 'type without native' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $vfInt), - 'both resolved' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), resolvedType: $vfInt, resolvedNativeType: $vfString), - 'not callable' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], 'no-such-function', static fn () => new \PHPStan\Analyser\SpecifiedTypes()), + 'callback and type' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], static fn (bool $n) => $vfInt, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $vfInt, nativeType: $vfInt, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, argsResult: null, variableFlow: null), + 'nothing' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), false, null, null, null, null, null, null, null, null), + 'only resolved type' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), resolvedType: $vfInt, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, type: null, nativeType: null, argsResult: null, variableFlow: null), + 'type without native' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $vfInt, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, nativeType: null, argsResult: null, variableFlow: null), + 'both resolved' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), resolvedType: $vfInt, resolvedNativeType: $vfString, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, type: null, nativeType: null, argsResult: null, variableFlow: null), + 'not callable' => static fn () => new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], 'no-such-function', static fn () => new \PHPStan\Analyser\SpecifiedTypes(), false, null, null, null, null, null, null, null, null), ] as $label => $construct) { try { $result = $construct(); @@ -3580,11 +3580,11 @@ public function getType(\PhpParser\Node\Expr $expr, \PHPStan\Analyser\Scope $sco $released = new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['func call'], false, false, [], [], static function (bool $native) use (&$releaseCalls): \PHPStan\Type\Type { $releaseCalls++; return $native ? new \PHPStanTurbo\VoidType() : new \PHPStanTurbo\UnionType([new \PHPStanTurbo\VoidType(), new \PHPStanTurbo\IntegerType()]); - }, static fn () => new \PHPStan\Analyser\SpecifiedTypes()); + }, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), false, null, null, null, null, null, null, null, null); $r['release'] = [$released->getType()->describe(\PHPStan\Type\VerbosityLevel::precise()), $released->getKeepVoidType(false)->describe(\PHPStan\Type\VerbosityLevel::precise()), $released->getNativeType()->describe(\PHPStan\Type\VerbosityLevel::precise()), $released->getKeepVoidType(true)->describe(\PHPStan\Type\VerbosityLevel::precise()), $releaseCalls, $erDescribeResult($released)]; // the override results derive the branch scopes lazily - $override = new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $vfInt, nativeType: $vfInt); - $overridden = new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erOtherScope, $erOtherScope, $erN['func call'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), truthyScopeOverrideResult: $override, falseyScopeOverrideResult: $override, type: $vfInt, nativeType: $vfInt, createTypesCallback: static fn (\PHPStan\Type\Type $type, \PHPStan\Analyser\TypeSpecifierContext $context, bool $native) => new \PHPStan\Analyser\SpecifiedTypes([spl_object_id($type) => $native])); + $override = new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $erN['variable a'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), type: $vfInt, nativeType: $vfInt, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, argsResult: null, variableFlow: null); + $overridden = new $erClass($erNoExtensions, $erDefaultNarrowingHelper, $erOtherScope, $erOtherScope, $erN['func call'], false, false, [], [], null, static fn () => new \PHPStan\Analyser\SpecifiedTypes(), truthyScopeOverrideResult: $override, falseyScopeOverrideResult: $override, type: $vfInt, nativeType: $vfInt, createTypesCallback: static fn (\PHPStan\Type\Type $type, \PHPStan\Analyser\TypeSpecifierContext $context, bool $native) => new \PHPStan\Analyser\SpecifiedTypes([spl_object_id($type) => $native]), containsNullsafe: false, issetabilityDescriptor: null, argsResult: null, variableFlow: null); $r['override'] = [$overridden->getTruthyScope() === $override->getTruthyScope(), $overridden->getFalseyScope() === $override->getFalseyScope(), $erDescribeResult($overridden->getCreatedTypes($vfInt, \PHPStan\Analyser\TypeSpecifierContext::createTruthy(), true)), $erDescribeResult($overridden->getCreatedTypesForScope($erScope, $vfString, \PHPStan\Analyser\TypeSpecifierContext::createTruthy())), $erDescribeResult($overridden->finalize($erScope, false, false, [], [], null, null))]; $erResults[$side] = $r; } @@ -3858,9 +3858,9 @@ public function evaluate(\PHPStan\Analyser\MutatingScope $scope): ?\PHPStan\Anal $first = $callback($stContextClass::createTruthy(), false); $second = $callback(); $o['emptySpecifyCallback call'] = [$describe($first), $first !== $second, $describe($second)]; - $emptyResult = new $stResultClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $stA, false, false, [], [], null, $callback, type: $vfInt, nativeType: $vfInt); - $fromResult = $emptyResult->getSpecifiedTypes($stContextClass::createTruthy()); - $o['emptySpecifyCallback via ExpressionResult'] = [$describe($fromResult), $fromResult === $emptyResult->getSpecifiedTypes($stContextClass::createTruthy()), $fromResult !== $emptyResult->getSpecifiedTypes($stContextClass::createFalsey())]; + $emptyResult = new $stResultClass($erNoExtensions, $erDefaultNarrowingHelper, $erScope, $erScope, $stA, false, false, [], [], null, $callback, type: $vfInt, nativeType: $vfInt, containsNullsafe: false, issetabilityDescriptor: null, truthyScopeOverrideResult: null, falseyScopeOverrideResult: null, createTypesCallback: null, argsResult: null, variableFlow: null); + $fromResult = $emptyResult->getSpecifiedTypes($stContextClass::createTruthy(), false); + $o['emptySpecifyCallback via ExpressionResult'] = [$describe($fromResult), $fromResult === $emptyResult->getSpecifiedTypes($stContextClass::createTruthy(), false), $fromResult !== $emptyResult->getSpecifiedTypes($stContextClass::createFalsey(), false)]; $stObservations[$side] = $o; } @@ -3887,7 +3887,7 @@ public function evaluate(\PHPStan\Analyser\MutatingScope $scope): ?\PHPStan\Anal $ecInt = new \PHPStanTurbo\IntegerType(); $ecString = new \PHPStanTurbo\StringType(); $ecExpr = new \PhpParser\Node\Expr\Variable('x'); -$ecWrite = new \PHPStan\Node\Variable\VariableWrite('x', $ecExpr, 7, \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN); +$ecWrite = new \PHPStan\Node\Variable\VariableWrite('x', $ecExpr, 7, \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN, false, null, null, true); $ecTemplateAcceptor = new \PHPStan\Reflection\TrivialParametersAcceptor(); $ecExtendedAcceptor = new \PHPStan\Reflection\ExtendedFunctionVariant( \PHPStan\Type\Generic\TemplateTypeMap::createEmpty(), @@ -3952,10 +3952,10 @@ public function evaluate(\PHPStan\Analyser\MutatingScope $scope): ?\PHPStan\Anal 'enterUnsetTarget' => static fn ($c) => $c->enterUnsetTarget(), ]; foreach ([ - 'topLevel' => $ecClass::createTopLevel(), + 'topLevel' => $ecClass::createTopLevel(true), 'topLevel false' => $ecClass::createTopLevel(false), 'topLevel named' => $ecClass::createTopLevel(resolveTemplateArguments: false), - 'deep' => $ecClass::createDeep(), + 'deep' => $ecClass::createDeep(true), 'deep false' => $ecClass::createDeep(false), ] as $startLabel => $start) { $r[$startLabel] = $describe($start); @@ -4138,11 +4138,11 @@ public function getSubNodeNames(): array 'float' => new \PhpParser\Node\Scalar\Float_(1.5), ]; $hhContexts = [ - 'top' => \PHPStan\Analyser\ExpressionContext::createTopLevel(), - 'deep' => \PHPStan\Analyser\ExpressionContext::createDeep(), - 'unset' => \PHPStan\Analyser\ExpressionContext::createDeep()->enterUnsetTarget(), - 'dim root' => \PHPStan\Analyser\ExpressionContext::createDeep()->enterArrayDimFetchRoot(), - 'value flow' => \PHPStan\Analyser\ExpressionContext::createDeep()->enterValueFlow(new \PHPStan\Node\Variable\VariableWrite('t', $hhName, 42, \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN), true), + 'top' => \PHPStan\Analyser\ExpressionContext::createTopLevel(true), + 'deep' => \PHPStan\Analyser\ExpressionContext::createDeep(true), + 'unset' => \PHPStan\Analyser\ExpressionContext::createDeep(true)->enterUnsetTarget(), + 'dim root' => \PHPStan\Analyser\ExpressionContext::createDeep(true)->enterArrayDimFetchRoot(), + 'value flow' => \PHPStan\Analyser\ExpressionContext::createDeep(true)->enterValueFlow(new \PHPStan\Node\Variable\VariableWrite('t', $hhName, 42, \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN, false, null, null, true), true), ]; // The native VariableHandler creates the native IssetabilityDescriptor, which // a native Dependencies as its PHP twin, for the PHP side of a differential @@ -4262,7 +4262,7 @@ public function create( if ($handler === $variable) { // no name result for a dynamic name: the twin's typeCallback throws $calls[' / composed'] = static fn ($storage) => $variable->composeResult($hhNodeScopeResolver, $expr, null, $storage, $hhScope, $context); - $calls[' / composed without context'] = static fn ($storage) => $variable->composeResult($hhNodeScopeResolver, $expr, null, $storage, $hhScope); + $calls[' / composed without context'] = static fn ($storage) => $variable->composeResult($hhNodeScopeResolver, $expr, null, $storage, $hhScope, null); } foreach ($calls as $callLabel => $call) { $storage = new \PHPStan\Analyser\ExpressionResultStorage(); @@ -4362,25 +4362,23 @@ public function getComments(): array foreach ($vapStmts as $stmtLabel => $stmt) { foreach ($vapNames as $namesLabel => $names) { $label = $scopeLabel . ' / ' . $stmtLabel . ' / ' . $namesLabel; - foreach (['by ref' => true, 'without' => false] as $refLabel => $byRef) { - $warnings = []; - set_error_handler(static function (int $level, string $message) use (&$warnings): bool { - $warnings[] = [$level, $message]; - return true; - }); - $scope->assigned = []; - try { - $changed = false; - $result = $byRef ? $processor->processVarAnnotation($scope, $names, $stmt, $changed) : $processor->processVarAnnotation($scope, $names, $stmt); - $r[$label . ' / ' . $refLabel] = [$result === $scope, $changed, $scope->assigned]; - } catch (\Throwable $e) { - $r[$label . ' / ' . $refLabel] = [get_class($e), preg_replace('~, called in .*$~', '', $e->getMessage()), $changed, $scope->assigned]; - } finally { - restore_error_handler(); - } - if ($warnings !== []) { - $r[$label . ' / ' . $refLabel][] = $warnings; - } + $warnings = []; + set_error_handler(static function (int $level, string $message) use (&$warnings): bool { + $warnings[] = [$level, $message]; + return true; + }); + $scope->assigned = []; + try { + $changed = false; + $result = $processor->processVarAnnotation($scope, $names, $stmt, $changed); + $r[$label] = [$result === $scope, $changed, $scope->assigned]; + } catch (\Throwable $e) { + $r[$label] = [get_class($e), preg_replace('~, called in .*$~', '', $e->getMessage()), $changed, $scope->assigned]; + } finally { + restore_error_handler(); + } + if ($warnings !== []) { + $r[$label][] = $warnings; } } } @@ -4391,15 +4389,15 @@ public function getComments(): array check($described === ($vapResults['native'][$label] ?? null), "VarAnnotationProcessor parity ($label): " . json_encode($described) . ' vs ' . json_encode($vapResults['native'][$label] ?? null)); } check( - count($vapResults['php']['class / two docs / a b / by ref'][2] ?? []) === 2 - && ($vapResults['php']['file / string comments / a / by ref'][0] ?? null) === \TypeError::class - && ($vapResults['php']['file / overriding node / a / without'][2][0][1] ?? null) === 'float' - && ($vapResults['php']['file / plain comment / a / by ref'] ?? null) === [true, false, []] - && ($vapResults['php']['file / positional / a b / by ref'][2] ?? null) === [] - && ($vapResults['php']['file / positional / keyed / by ref'][0] ?? null) === \TypeError::class, - 'VarAnnotationProcessor: the fixture exercises every arm: ' . json_encode(array_intersect_key($vapResults['php'], array_flip(['class / two docs / a b / by ref', 'file / string comments / a / by ref', 'file / overriding node / a / without', 'file / plain comment / a / by ref', 'file / positional / a b / by ref', 'file / positional / keyed / by ref']))), + count($vapResults['php']['class / two docs / a b'][2] ?? []) === 2 + && ($vapResults['php']['file / string comments / a'][0] ?? null) === \TypeError::class + && ($vapResults['php']['file / overriding node / a'][2][0][1] ?? null) === 'float' + && ($vapResults['php']['file / plain comment / a'] ?? null) === [true, false, []] + && ($vapResults['php']['file / positional / a b'][2] ?? null) === [] + && ($vapResults['php']['file / positional / keyed'][0] ?? null) === \TypeError::class, + 'VarAnnotationProcessor: the fixture exercises every arm: ' . json_encode(array_intersect_key($vapResults['php'], array_flip(['class / two docs / a b', 'file / string comments / a', 'file / overriding node / a', 'file / plain comment / a', 'file / positional / a b', 'file / positional / keyed']))), ); -check(($vapResults['php']['file / named / a / by ref'][1] ?? null) === true && ($vapResults['php']['class / positional / b / by ref'][2][0][1] ?? null) === 'string', 'VarAnnotationProcessor: the fixture assigns through named and positional tags: ' . json_encode([$vapResults['php']['file / named / a / by ref'] ?? null, $vapResults['php']['class / positional / b / by ref'] ?? null])); +check(($vapResults['php']['file / named / a'][1] ?? null) === true && ($vapResults['php']['class / positional / b'][2][0][1] ?? null) === 'string', 'VarAnnotationProcessor: the fixture assigns through named and positional tags: ' . json_encode([$vapResults['php']['file / named / a'] ?? null, $vapResults['php']['class / positional / b'] ?? null])); // ---- the analyser value classes ---- // analyser-values.php builds the value objects on both sides from the same diff --git a/turbo-ext/tests/type-family.php b/turbo-ext/tests/type-family.php index 04bf5951fa4..36607cd53f6 100644 --- a/turbo-ext/tests/type-family.php +++ b/turbo-ext/tests/type-family.php @@ -4995,14 +4995,14 @@ public function getKeyType(): \PHPStan\Type\Type 'offsetShapeTKey' => new \PHPStan\Type\OffsetAccessType($lateShape, $lateTKey), 'offsetStringInt' => new \PHPStan\Type\OffsetAccessType(new \PHPStan\Type\StringType(), new \PHPStan\Type\IntegerType()), 'offsetMixedInt' => new \PHPStan\Type\OffsetAccessType(new \PHPStan\Type\MixedType(), new \PHPStan\Type\IntegerType()), - 'constantStaticKindList' => new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeStatic, 'KIND_LIST'), - 'constantObjectKindArray' => new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeObject, 'KIND_ARRAY'), - 'constantMissing' => new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeObject, 'KIND_NONEXISTENT'), + 'constantStaticKindList' => new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeStatic, 'KIND_LIST', null), + 'constantObjectKindArray' => new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeObject, 'KIND_ARRAY', null), + 'constantMissing' => new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeObject, 'KIND_NONEXISTENT', null), 'constantStaticKindListNative' => new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeStatic, 'KIND_LIST', new \PHPStan\Type\StringType()), - 'constantObjectKindArrayNative' => (new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeObject, 'KIND_ARRAY'))->withNativeType(new \PHPStan\Type\IntegerType()), + 'constantObjectKindArrayNative' => (new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeObject, 'KIND_ARRAY', null))->withNativeType(new \PHPStan\Type\IntegerType()), 'constantObjectWildcardNative' => new \PHPStan\Type\ClassConstantAccessType($lateShapeNodeObject, 'KIND_*', new \PHPStan\Type\StringType()), - 'constantTShapeNode' => new \PHPStan\Type\ClassConstantAccessType($lateTShapeNode, 'KIND_LIST'), - 'constantOnInt' => new \PHPStan\Type\ClassConstantAccessType(new \PHPStan\Type\IntegerType(), 'KIND_LIST'), + 'constantTShapeNode' => new \PHPStan\Type\ClassConstantAccessType($lateTShapeNode, 'KIND_LIST', null), + 'constantOnInt' => new \PHPStan\Type\ClassConstantAccessType(new \PHPStan\Type\IntegerType(), 'KIND_LIST', null), 'newException' => new \PHPStan\Type\NewObjectType(new \PHPStan\Type\ObjectType(\Exception::class)), 'newClassString' => new \PHPStan\Type\NewObjectType(new \PHPStan\Type\Generic\GenericClassStringType(new \PHPStan\Type\ObjectType(\Exception::class))), 'newTObject' => new \PHPStan\Type\NewObjectType($lateTObject), @@ -7447,9 +7447,9 @@ public function getResolvedPhpDoc(): ?\PHPStan\PhpDoc\ResolvedPhpDocBlock { retu $genericSignatureFixture = $signatureFixture->withTypes([$string]); $site = new \PhpParser\Node\Expr\FuncCall(new \PhpParser\Node\Name('f')); $otherSite = new \PhpParser\Node\Expr\FuncCall(new \PhpParser\Node\Name('g')); - $observingFrame = new \PHPStan\Analyser\Generics\TemplateArgumentFrame(null); - $resolvedFrame = new \PHPStan\Analyser\Generics\TemplateArgumentFrame(null, [spl_object_id($site) . '#T' => new \PHPStan\Type\Constant\ConstantStringType('resolved')]); - $emptyResolvedFrame = new \PHPStan\Analyser\Generics\TemplateArgumentFrame($observingFrame, []); + $observingFrame = new \PHPStan\Analyser\Generics\TemplateArgumentFrame(null, null, [], null, [], [], false, [], [], []); + $resolvedFrame = new \PHPStan\Analyser\Generics\TemplateArgumentFrame(null, [spl_object_id($site) . '#T' => new \PHPStan\Type\Constant\ConstantStringType('resolved')], [], null, [], [], false, [], [], []); + $emptyResolvedFrame = new \PHPStan\Analyser\Generics\TemplateArgumentFrame($observingFrame, [], [], null, [], [], false, [], [], []); $argTypeSets = [ 'int' => [new \PHPStan\Type\Constant\ConstantIntegerType(1), new \PHPStan\Type\ObjectType(\stdClass::class)], 'string' => [new \PHPStan\Type\Constant\ConstantStringType('s'), new \PHPStan\Type\ObjectType(\ArrayObject::class), new \PHPStan\Type\ClosureType([], $int, false)], @@ -7977,7 +7977,7 @@ public function getResolvedPhpDoc(): ?\PHPStan\PhpDoc\ResolvedPhpDocBlock { retu foreach ($classReflections as $reflectionName => $classReflection) { foreach ($classNodes as $classNodeName => $classNode) { foreach (['class', 'CLASS', 'UNTYPED', 'TYPED', 'DOCUMENTED', 'FINAL_CONST', 'SELF_REF', 'PARENT_CONST', 'One', 'ALIAS', 'NOPE'] as $constantName) { - $r["getClassConstFetchTypeByReflection $reflectionName $classNodeName $constantName"] = $catching(static fn () => $resolver->getClassConstFetchTypeByReflection($classNode, $constantName, $classReflection, $getType)); + $r["getClassConstFetchTypeByReflection $reflectionName $classNodeName $constantName"] = $catching(static fn () => $resolver->getClassConstFetchTypeByReflection($classNode, $constantName, $classReflection, $getType, false)); } } } @@ -8126,7 +8126,7 @@ public function getResolvedPhpDoc(): ?\PHPStan\PhpDoc\ResolvedPhpDocBlock { retu ]; $r['constraints private constructor'] = $tacCatching(static fn () => new $C()); $r['constraints reconstructed'] = $tacCatching(static fn () => (static fn () => $this->__construct())->call($trees['send'])); - $r['constraints private constructor bound'] = $tacCatching(static fn () => $viewConstraints((static fn () => new self(null, null, [$markers['m1T'], null, null, false]))->bindTo(null, $C)())); + $r['constraints private constructor bound'] = $tacCatching(static fn () => $viewConstraints((static fn () => new self(null, null, [$markers['m1T'], null, null, false], null))->bindTo(null, $C)())); $raw = (new \ReflectionClass($C))->newInstanceWithoutConstructor(); foreach (['isEmpty' => static fn () => $raw->isEmpty(), 'merge' => static fn () => $raw->merge($trees['send']), 'merged into' => static fn () => $trees['send']->merge($raw), 'getFacts' => static fn () => $viewConstraints($raw), 'withSite' => static fn () => $viewConstraints($raw->withSite($markers['m1T']))] as $name => $callback) { $r["constraints uninitialized $name"] = $tacCatching($callback); @@ -8182,7 +8182,7 @@ public function getResolvedPhpDoc(): ?\PHPStan\PhpDoc\ResolvedPhpDocBlock { retu foreach ($declareds as $declaredName => $declared) { foreach ($actuals as $actualName => $actual) { $r["observer send $declaredName <- $actualName"] = $tacCatching(static fn () => $viewConstraints($observer->collectSend($declared, $actual))); - $r["observer argument $declaredName <- $actualName"] = $tacCatching(static fn () => $viewConstraints($observer->collectArgument($declared, $actual))); + $r["observer argument $declaredName <- $actualName"] = $tacCatching(static fn () => $viewConstraints($observer->collectArgument($declared, $actual, false))); $r["observer pure argument $declaredName <- $actualName"] = $tacCatching(static fn () => $viewConstraints($observer->collectArgument($declared, $actual, true))); } } @@ -8213,11 +8213,11 @@ public function getResolvedPhpDoc(): ?\PHPStan\PhpDoc\ResolvedPhpDocBlock { retu } } $r['observer wrong type'] = $tacCatching(static fn () => $observer->collectSites($sites['s1'])); - $r['observer wrong acceptor'] = $tacCatching(static fn () => $observer->collectCall($sites['s1'], $int, [])); + $r['observer wrong acceptor'] = $tacCatching(static fn () => $observer->collectCall($sites['s1'], $int, [], null)); // the resolver $resolver = new \PHPStan\Analyser\Generics\TemplateArgumentResolver(); - $parent = new \PHPStan\Analyser\Generics\TemplateArgumentFrame(null, [spl_object_id($sites['s3']) . '#W' => $int]); + $parent = new \PHPStan\Analyser\Generics\TemplateArgumentFrame(null, [spl_object_id($sites['s3']) . '#W' => $int], [], null, [], [], false, [], [], []); $viewFrame = static function (mixed $frame) use ($sites, $precise): mixed { if (!$frame instanceof \PHPStan\Analyser\Generics\TemplateArgumentFrame) { return $frame; @@ -8233,19 +8233,19 @@ public function getResolvedPhpDoc(): ?\PHPStan\PhpDoc\ResolvedPhpDocBlock { retu }; $collected = [ 'send' => $observer->collectSend($declareds['ao'], $actuals['ao']), - 'argument' => $observer->collectArgument($declareds['traversable'], $actuals['ai']), - 'call' => $observer->collectCall($sites['s2'], $acceptors['plain'], $argumentSets['positional']), + 'argument' => $observer->collectArgument($declareds['traversable'], $actuals['ai'], false), + 'call' => $observer->collectCall($sites['s2'], $acceptors['plain'], $argumentSets['positional'], null), 'sites' => $observer->collectSites($actuals['ao>']), ]; foreach ($trees + $collected as $name => $constraints) { foreach (['no parent' => null, 'parent' => $parent] as $parentName => $parentFrame) { foreach (['positions' => [0, 5, 12, 20], 'one position' => [0], 'no positions' => [], 'gapped positions' => [0 => 0, 2 => 12]] as $positionsName => $positions) { - $r["resolver $name $parentName $positionsName"] = $tacCatching(static fn () => $viewFrame($resolver->resolve($constraints, $parentFrame, $positions))); + $r["resolver $name $parentName $positionsName"] = $tacCatching(static fn () => $viewFrame($resolver->resolve($constraints, $parentFrame, $positions, null, []))); } } } - $r['resolver wrong constraints'] = $tacCatching(static fn () => $resolver->resolve($int, null, [])); - $r['resolver wrong parent'] = $tacCatching(static fn () => $resolver->resolve($empty, $int, [])); + $r['resolver wrong constraints'] = $tacCatching(static fn () => $resolver->resolve($int, null, [], null, [])); + $r['resolver wrong parent'] = $tacCatching(static fn () => $resolver->resolve($empty, $int, [], null, [])); foreach ($r as $key => $value) { $observations["template arguments $key"] = $value; @@ -8297,15 +8297,15 @@ public function getResolvedPhpDoc(): ?\PHPStan\PhpDoc\ResolvedPhpDocBlock { retu foreach (['$a === $a', '$a === $b', '$a === 1', '$n === null', '$s === $a', '$o === null', '$o->p === null', 'null === $o->p', '$e->message === null', 'null === $e->message', '$e->message === $a', '\Exception::$nope === null', '$x === $x', '$$a === $$a', '1 === 1', '$f->unknown === null'] as $code) { $identical = $exprOf($code); $notIdentical = new \PhpParser\Node\Expr\BinaryOp\NotIdentical($identical->left, $identical->right); - $r["richer $code"] = $helperCatching(static fn () => $viewResult($helper->getIdenticalResult($helperScope, $identical))); - $r["richer not $code"] = $helperCatching(static fn () => $viewResult($helper->getNotIdenticalResult($helperScope, $notIdentical))); + $r["richer $code"] = $helperCatching(static fn () => $viewResult($helper->getIdenticalResult($helperScope, $identical, null, null, null))); + $r["richer not $code"] = $helperCatching(static fn () => $viewResult($helper->getNotIdenticalResult($helperScope, $notIdentical, null, null, null))); $r["richer typed $code"] = $helperCatching(static fn () => $viewResult($helper->getIdenticalResult($helperScope, $identical, null, new \PHPStan\Type\Constant\ConstantIntegerType(1), new \PHPStan\Type\Constant\ConstantIntegerType(1)))); $r["richer typed null $code"] = $helperCatching(static fn () => $viewResult($helper->getIdenticalResult($helperScope, $identical, null, new \PHPStan\Type\NullType(), null))); $r["richer typed not $code"] = $helperCatching(static fn () => $viewResult($helper->getNotIdenticalResult($helperScope, $notIdentical, null, new \PHPStan\Type\IntegerType(), new \PHPStan\Type\NullType()))); } $someIdentical = $exprOf('$a === $b'); - $r['richer wrong expr'] = $helperCatching(static fn () => $helper->getIdenticalResult($helperScope, new \PhpParser\Node\Expr\BinaryOp\NotIdentical($someIdentical->left, $someIdentical->right))); - $r['richer wrong type'] = $helperCatching(static fn () => $helper->getNotIdenticalResult($helperScope, new \PhpParser\Node\Expr\BinaryOp\NotIdentical($someIdentical->left, $someIdentical->right), null, $precise)); + $r['richer wrong expr'] = $helperCatching(static fn () => $helper->getIdenticalResult($helperScope, new \PhpParser\Node\Expr\BinaryOp\NotIdentical($someIdentical->left, $someIdentical->right), null, null, null)); + $r['richer wrong type'] = $helperCatching(static fn () => $helper->getNotIdenticalResult($helperScope, new \PhpParser\Node\Expr\BinaryOp\NotIdentical($someIdentical->left, $someIdentical->right), null, $precise, null)); // NullsafeOperatorHelper $levels = static function (\PhpParser\Node\Expr $expr): array { @@ -8337,19 +8337,19 @@ public function getResolvedPhpDoc(): ?\PHPStan\PhpDoc\ResolvedPhpDocBlock { retu $r['nullsafe wrong'] = $helperCatching(static fn () => \PHPStan\Analyser\NullsafeOperatorHelper::getNullsafeShortcircuitedExpr(new \PhpParser\Node\Name('x'))); // LoopWrittenVariableNames - $write = static fn (string $name, int $id, ?int $parentId = null): \PHPStan\Node\Variable\VariableWrite => new \PHPStan\Node\Variable\VariableWrite($name, new \PhpParser\Node\Expr\Variable($name), $id, \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN, false, null, $parentId); + $write = static fn (string $name, int $id, ?int $parentId = null): \PHPStan\Node\Variable\VariableWrite => new \PHPStan\Node\Variable\VariableWrite($name, new \PhpParser\Node\Expr\Variable($name), $id, \PHPStan\Node\Variable\VariableWrite::KIND_ASSIGN, false, null, $parentId, true); $foreachStmt = $parser->parse(' null, - 'read' => \PHPStan\Analyser\VariableFlow::read('r1'), - 'write' => \PHPStan\Analyser\VariableFlow::write($write('w1', 1)), - 'define' => \PHPStan\Analyser\VariableFlow::write($write('d1', 2, 1)), + 'read' => \PHPStan\Analyser\VariableFlow::read('r1', null, false, null), + 'write' => \PHPStan\Analyser\VariableFlow::write($write('w1', 1), null), + 'define' => \PHPStan\Analyser\VariableFlow::write($write('d1', 2, 1), null), 'escape' => \PHPStan\Analyser\VariableFlow::escape('e1'), 'mention' => \PHPStan\Analyser\VariableFlow::mention('m1'), 'discard' => \PHPStan\Analyser\VariableFlow::discard($write('x1', 3)), - 'sequence' => \PHPStan\Analyser\VariableFlow::sequence(\PHPStan\Analyser\VariableFlow::write($write('s1', 4)), \PHPStan\Analyser\VariableFlow::read('s2'), \PHPStan\Analyser\VariableFlow::escape('s3')), - 'nested' => \PHPStan\Analyser\VariableFlow::loop(\PHPStan\Analyser\VariableFlow::choice(\PHPStan\Analyser\VariableFlow::write($write('c1', 5)), \PHPStan\Analyser\VariableFlow::escape('c2')), \PHPStan\Analyser\VariableFlow::tryCatch(\PHPStan\Analyser\VariableFlow::write($write('t1', 6)), [[new \PHPStan\Type\ObjectType(\Exception::class), \PHPStan\Analyser\VariableFlow::write($write('t2', 7))], [new \PHPStan\Type\ObjectType(\Error::class), null]], \PHPStan\Analyser\VariableFlow::escape('t3')), \PHPStan\Analyser\VariableFlow::switch(\PHPStan\Analyser\VariableFlow::write($write('sw0', 8)), [[\PHPStan\Analyser\VariableFlow::write($write('sw1', 9)), \PHPStan\Analyser\VariableFlow::write($write('sw2', 10)), false], [null, \PHPStan\Analyser\VariableFlow::escape('sw3'), true]], false), false, true), - 'loop statement' => \PHPStan\Analyser\VariableFlow::loopStatement($foreachStmt, \PHPStan\Analyser\VariableFlow::write($write('ls1', 11)), [$write('b1', 12), $write('b2', 13)], [$write('o1', 14), $write('b1', 15)]), + 'sequence' => \PHPStan\Analyser\VariableFlow::sequence(\PHPStan\Analyser\VariableFlow::write($write('s1', 4), null), \PHPStan\Analyser\VariableFlow::read('s2', null, false, null), \PHPStan\Analyser\VariableFlow::escape('s3')), + 'nested' => \PHPStan\Analyser\VariableFlow::loop(\PHPStan\Analyser\VariableFlow::choice(\PHPStan\Analyser\VariableFlow::write($write('c1', 5), null), \PHPStan\Analyser\VariableFlow::escape('c2')), \PHPStan\Analyser\VariableFlow::tryCatch(\PHPStan\Analyser\VariableFlow::write($write('t1', 6), null), [[new \PHPStan\Type\ObjectType(\Exception::class), \PHPStan\Analyser\VariableFlow::write($write('t2', 7), null)], [new \PHPStan\Type\ObjectType(\Error::class), null]], \PHPStan\Analyser\VariableFlow::escape('t3')), \PHPStan\Analyser\VariableFlow::switch(\PHPStan\Analyser\VariableFlow::write($write('sw0', 8), null), [[\PHPStan\Analyser\VariableFlow::write($write('sw1', 9), null), \PHPStan\Analyser\VariableFlow::write($write('sw2', 10), null), false], [null, \PHPStan\Analyser\VariableFlow::escape('sw3'), true]], false), false, true, true), + 'loop statement' => \PHPStan\Analyser\VariableFlow::loopStatement($foreachStmt, \PHPStan\Analyser\VariableFlow::write($write('ls1', 11), null), [$write('b1', 12), $write('b2', 13)], [$write('o1', 14), $write('b1', 15)]), 'inputs' => \PHPStan\Analyser\VariableFlow::inputs(1, 2), ]; foreach ([ @@ -8605,7 +8605,7 @@ public function getTypes(): array 'NewObjectType' => static fn () => new \PHPStan\Type\NewObjectType($nonType), 'OffsetAccessType type' => static fn () => new \PHPStan\Type\OffsetAccessType($nonType, new \PHPStan\Type\IntegerType()), 'OffsetAccessType offset' => static fn () => new \PHPStan\Type\OffsetAccessType(new \PHPStan\Type\ArrayType(new \PHPStan\Type\IntegerType(), new \PHPStan\Type\StringType()), $nonType), - 'ClassConstantAccessType' => static fn () => new \PHPStan\Type\ClassConstantAccessType($nonType, 'FOO'), + 'ClassConstantAccessType' => static fn () => new \PHPStan\Type\ClassConstantAccessType($nonType, 'FOO', null), 'GetTemplateTypeType' => static fn () => new \PHPStan\Type\Helper\GetTemplateTypeType($nonType, \ArrayAccess::class, 'TKey'), 'GenericClassStringType' => static fn () => new \PHPStan\Type\Generic\GenericClassStringType($nonType), 'ConditionalType subject' => static fn () => new \PHPStan\Type\ConditionalType($nonType, new \PHPStan\Type\IntegerType(), new \PHPStan\Type\StringType(), new \PHPStan\Type\NullType(), false),