diff --git a/src/Type/Accessory/AccessoryArrayListType.php b/src/Type/Accessory/AccessoryArrayListType.php index 026784c7ace..ccde7e7cab6 100644 --- a/src/Type/Accessory/AccessoryArrayListType.php +++ b/src/Type/Accessory/AccessoryArrayListType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -19,6 +20,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\Traits\MaybeCallableTypeTrait; use PHPStan\Type\Traits\NonGeneralizableTypeTrait; use PHPStan\Type\Traits\NonGenericTypeTrait; @@ -579,6 +581,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('list'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isArrayAllowed() ? new Identifier('array') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/AccessoryDecimalIntegerStringType.php b/src/Type/Accessory/AccessoryDecimalIntegerStringType.php index 23a6e68819d..2ea08328093 100644 --- a/src/Type/Accessory/AccessoryDecimalIntegerStringType.php +++ b/src/Type/Accessory/AccessoryDecimalIntegerStringType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -24,6 +25,7 @@ use PHPStan\Type\IntegerType; use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\StringType; use PHPStan\Type\Traits\NonArrayTypeTrait; use PHPStan\Type\Traits\NonGenericTypeTrait; @@ -480,6 +482,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode($this->inverse ? 'non-decimal-int-string' : 'decimal-int-string'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('string') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/AccessoryLiteralStringType.php b/src/Type/Accessory/AccessoryLiteralStringType.php index 38a7cb318de..128fbcdd51d 100644 --- a/src/Type/Accessory/AccessoryLiteralStringType.php +++ b/src/Type/Accessory/AccessoryLiteralStringType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -21,6 +22,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\StringType; use PHPStan\Type\Traits\MaybeCallableTypeTrait; @@ -401,6 +403,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('literal-string'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('string') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/AccessoryLowercaseStringType.php b/src/Type/Accessory/AccessoryLowercaseStringType.php index 984c7a6d200..4f2eb475c38 100644 --- a/src/Type/Accessory/AccessoryLowercaseStringType.php +++ b/src/Type/Accessory/AccessoryLowercaseStringType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -21,6 +22,7 @@ use PHPStan\Type\IntegerType; use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\StringType; use PHPStan\Type\Traits\MaybeCallableTypeTrait; @@ -406,6 +408,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('lowercase-string'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('string') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/AccessoryNonEmptyStringType.php b/src/Type/Accessory/AccessoryNonEmptyStringType.php index a1761329aac..40d848ca05f 100644 --- a/src/Type/Accessory/AccessoryNonEmptyStringType.php +++ b/src/Type/Accessory/AccessoryNonEmptyStringType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -22,6 +23,7 @@ use PHPStan\Type\IntegerType; use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\StringType; use PHPStan\Type\Traits\MaybeCallableTypeTrait; @@ -410,6 +412,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('non-empty-string'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('string') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/AccessoryNonFalsyStringType.php b/src/Type/Accessory/AccessoryNonFalsyStringType.php index f95b1177a6f..fc0d10e6eae 100644 --- a/src/Type/Accessory/AccessoryNonFalsyStringType.php +++ b/src/Type/Accessory/AccessoryNonFalsyStringType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -22,6 +23,7 @@ use PHPStan\Type\IntegerType; use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\NullType; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\StringType; @@ -407,6 +409,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('non-falsy-string'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('string') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/AccessoryNumericStringType.php b/src/Type/Accessory/AccessoryNumericStringType.php index 6cf9995168e..92b180b2718 100644 --- a/src/Type/Accessory/AccessoryNumericStringType.php +++ b/src/Type/Accessory/AccessoryNumericStringType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\DependencyInjection\ReportUnsafeArrayStringKeyCastingToggle; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; @@ -23,6 +24,7 @@ use PHPStan\Type\IntegerType; use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\StringType; use PHPStan\Type\Traits\NonArrayTypeTrait; use PHPStan\Type\Traits\NonCallableTypeTrait; @@ -419,6 +421,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('numeric-string'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('string') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/AccessoryUppercaseStringType.php b/src/Type/Accessory/AccessoryUppercaseStringType.php index ec915f2ac11..ebc45570e84 100644 --- a/src/Type/Accessory/AccessoryUppercaseStringType.php +++ b/src/Type/Accessory/AccessoryUppercaseStringType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -21,6 +22,7 @@ use PHPStan\Type\IntegerType; use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\StringType; use PHPStan\Type\Traits\MaybeCallableTypeTrait; @@ -406,6 +408,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('uppercase-string'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('string') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/HasMethodType.php b/src/Type/Accessory/HasMethodType.php index 889c523622a..4c92ac1a5e3 100644 --- a/src/Type/Accessory/HasMethodType.php +++ b/src/Type/Accessory/HasMethodType.php @@ -23,6 +23,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\ObjectType; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\StringType; @@ -345,6 +346,12 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode(''); // no PHPDoc representation } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + // not certainly an object on its own, object&hasMethod(foo) maps to object through the intersection + return null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/HasOffsetType.php b/src/Type/Accessory/HasOffsetType.php index 0d300a83d20..50606d8f1a1 100644 --- a/src/Type/Accessory/HasOffsetType.php +++ b/src/Type/Accessory/HasOffsetType.php @@ -3,6 +3,7 @@ namespace PHPStan\Type\Accessory; use ArrayAccess; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -21,6 +22,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\ObjectType; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\Traits\MaybeArrayTypeTrait; @@ -474,6 +476,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode(''); // no PHPDoc representation } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isArrayAllowed() ? new Identifier('array') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return $this->offsetType->hasTemplateOrLateResolvableType(); diff --git a/src/Type/Accessory/HasOffsetValueType.php b/src/Type/Accessory/HasOffsetValueType.php index 3581f8f95af..da2e0570d94 100644 --- a/src/Type/Accessory/HasOffsetValueType.php +++ b/src/Type/Accessory/HasOffsetValueType.php @@ -3,6 +3,7 @@ namespace PHPStan\Type\Accessory; use ArrayAccess; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -23,6 +24,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\ObjectType; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\StaticTypeFactory; @@ -576,6 +578,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode(''); // no PHPDoc representation } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isArrayAllowed() ? new Identifier('array') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return $this->offsetType->hasTemplateOrLateResolvableType() || $this->valueType->hasTemplateOrLateResolvableType(); diff --git a/src/Type/Accessory/HasPropertyType.php b/src/Type/Accessory/HasPropertyType.php index c15bc7cd506..7a21158fa20 100644 --- a/src/Type/Accessory/HasPropertyType.php +++ b/src/Type/Accessory/HasPropertyType.php @@ -17,6 +17,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\Traits\MaybeCallableTypeTrait; use PHPStan\Type\Traits\MaybeIterableTypeTrait; @@ -321,6 +322,12 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode(''); // no PHPDoc representation } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + // not certainly an object on its own, object&hasMethod(foo) maps to object through the intersection + return null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/NonEmptyArrayType.php b/src/Type/Accessory/NonEmptyArrayType.php index 5fbddc82040..7f105918f78 100644 --- a/src/Type/Accessory/NonEmptyArrayType.php +++ b/src/Type/Accessory/NonEmptyArrayType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -20,6 +21,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\Traits\MaybeCallableTypeTrait; use PHPStan\Type\Traits\NonGeneralizableTypeTrait; use PHPStan\Type\Traits\NonGenericTypeTrait; @@ -558,6 +560,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('non-empty-array'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isArrayAllowed() ? new Identifier('array') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Accessory/OversizedArrayType.php b/src/Type/Accessory/OversizedArrayType.php index 857ee75b186..10f6d5b552b 100644 --- a/src/Type/Accessory/OversizedArrayType.php +++ b/src/Type/Accessory/OversizedArrayType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Accessory; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -19,6 +20,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\Traits\MaybeCallableTypeTrait; use PHPStan\Type\Traits\NonGeneralizableTypeTrait; use PHPStan\Type\Traits\NonGenericTypeTrait; @@ -528,6 +530,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode(''); // no PHPDoc representation } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isArrayAllowed() ? new Identifier('array') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/ArrayType.php b/src/Type/ArrayType.php index 904f51e6396..43b25b5eb45 100644 --- a/src/Type/ArrayType.php +++ b/src/Type/ArrayType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; @@ -975,6 +976,11 @@ public function toPhpDocNode(): TypeNode ); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isArrayAllowed() ? new Identifier('array') : null; + } + public function traverseSimultaneously(Type $right, callable $cb): Type { $keyType = $cb($this->keyType, $right->getIterableKeyType()); diff --git a/src/Type/BooleanType.php b/src/Type/BooleanType.php index f7062440278..974b89640e3 100644 --- a/src/Type/BooleanType.php +++ b/src/Type/BooleanType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -189,6 +190,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('bool'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('bool') : null; + } + public function toTrinaryLogic(): TrinaryLogic { if ($this->isTrue()->yes()) { diff --git a/src/Type/CallableType.php b/src/Type/CallableType.php index bc03b1ddb41..ac7ef2bc0da 100644 --- a/src/Type/CallableType.php +++ b/src/Type/CallableType.php @@ -3,6 +3,7 @@ namespace PHPStan\Type; use Closure; +use PhpParser\Node\Identifier; use PHPStan\Analyser\OutOfClassScope; use PHPStan\Php\PhpVersion; use PHPStan\PhpDoc\Tag\TemplateTag; @@ -848,6 +849,11 @@ public function toPhpDocNode(): TypeNode ); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isCallableAllowed() ? new Identifier('callable') : null; + } + public function hasTemplateOrLateResolvableType(): bool { foreach ($this->parameters as $parameter) { diff --git a/src/Type/ClosureType.php b/src/Type/ClosureType.php index e2001460804..77b77365c43 100644 --- a/src/Type/ClosureType.php +++ b/src/Type/ClosureType.php @@ -3,6 +3,7 @@ namespace PHPStan\Type; use Closure; +use PhpParser\Node\Name\FullyQualified; use PHPStan\Analyser\OutOfClassScope; use PHPStan\Node\InvalidateExprNode; use PHPStan\Php\PhpVersion; @@ -1031,6 +1032,11 @@ public function toPhpDocNode(): TypeNode ); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isClassNameAllowed() ? new FullyQualified('Closure') : null; + } + public function hasTemplateOrLateResolvableType(): bool { foreach ($this->parameters as $parameter) { diff --git a/src/Type/Constant/ConstantArrayType.php b/src/Type/Constant/ConstantArrayType.php index a198e2161a7..0d0fa29b07e 100644 --- a/src/Type/Constant/ConstantArrayType.php +++ b/src/Type/Constant/ConstantArrayType.php @@ -3,6 +3,7 @@ namespace PHPStan\Type\Constant; use Nette\Utils\Strings; +use PhpParser\Node\Identifier; use PHPStan\Analyser\OutOfClassScope; use PHPStan\DependencyInjection\BleedingEdgeToggle; use PHPStan\Php\PhpVersion; @@ -53,6 +54,7 @@ use PHPStan\Type\IntersectionType; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\NeverType; use PHPStan\Type\NonAcceptingNeverType; use PHPStan\Type\NullType; @@ -3639,6 +3641,11 @@ public function toPhpDocNode(): TypeNode ); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isArrayAllowed() ? new Identifier('array') : null; + } + public static function isValidIdentifier(string $value): bool { $result = Strings::match($value, '~^(?:[\\\\]?+[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF-]*+)++$~si'); diff --git a/src/Type/Constant/ConstantBooleanType.php b/src/Type/Constant/ConstantBooleanType.php index 4c71f00b2d1..844d0a070d9 100644 --- a/src/Type/Constant/ConstantBooleanType.php +++ b/src/Type/Constant/ConstantBooleanType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type\Constant; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -13,6 +14,7 @@ use PHPStan\Type\GeneralizePrecision; use PHPStan\Type\InstanceofDeprecated; use PHPStan\Type\MixedType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\NeverType; use PHPStan\Type\StaticTypeFactory; use PHPStan\Type\Traits\ConstantScalarTypeTrait; @@ -147,6 +149,15 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode($this->value ? 'true' : 'false'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + if ($this->value ? $position->isTrueAllowed() : $position->isFalseAllowed()) { + return new Identifier($this->value ? 'true' : 'false'); + } + + return parent::toNativePhpTypeNode($position); + } + public function looseCompare(Type $type, PhpVersion $phpVersion): BooleanType { if ($type->isObject()->yes()) { diff --git a/src/Type/ErrorType.php b/src/Type/ErrorType.php index 0d3599a0b66..1fafe7c34df 100644 --- a/src/Type/ErrorType.php +++ b/src/Type/ErrorType.php @@ -49,4 +49,9 @@ public function equals(Type $type): bool return $type instanceof self; } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return null; + } + } diff --git a/src/Type/FloatType.php b/src/Type/FloatType.php index 6d625d96ee8..b3b5bcbee22 100644 --- a/src/Type/FloatType.php +++ b/src/Type/FloatType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -304,6 +305,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('float'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('float') : null; + } + public function getFiniteTypes(): array { return []; diff --git a/src/Type/Generic/UnresolvedTemplateArgumentType.php b/src/Type/Generic/UnresolvedTemplateArgumentType.php index 7cefc79a52a..ff3d0180cae 100644 --- a/src/Type/Generic/UnresolvedTemplateArgumentType.php +++ b/src/Type/Generic/UnresolvedTemplateArgumentType.php @@ -22,6 +22,7 @@ use PHPStan\Type\Enum\EnumCaseObjectType; use PHPStan\Type\GeneralizePrecision; use PHPStan\Type\IsSuperTypeOfResult; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\Type; use PHPStan\Type\TypeTraverser; use PHPStan\Type\UnionType; @@ -292,6 +293,11 @@ public function toPhpDocNode(): TypeNode return $this->getDelegate()->toPhpDocNode(); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $this->getDelegate()->toNativePhpTypeNode($position); + } + public function getReferencedClasses(): array { return $this->getDelegate()->getReferencedClasses(); diff --git a/src/Type/IntegerType.php b/src/Type/IntegerType.php index cd0dfc77b11..953d7c29b2b 100644 --- a/src/Type/IntegerType.php +++ b/src/Type/IntegerType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -203,6 +204,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('int'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('int') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/IntersectionType.php b/src/Type/IntersectionType.php index af13bc1ee3a..758350e1b70 100644 --- a/src/Type/IntersectionType.php +++ b/src/Type/IntersectionType.php @@ -2111,6 +2111,11 @@ public function toPhpDocNode(): TypeNode return new IntersectionTypeNode($describedTypes); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return NativePhpTypeNodeHelper::intersection($this, $position); + } + public function hasTemplateOrLateResolvableType(): bool { foreach ($this->types as $type) { diff --git a/src/Type/IterableType.php b/src/Type/IterableType.php index 6242ba64b15..aee7aeb5224 100644 --- a/src/Type/IterableType.php +++ b/src/Type/IterableType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; @@ -553,6 +554,11 @@ public function toPhpDocNode(): TypeNode ); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isIterableAllowed() ? new Identifier('iterable') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return $this->keyType->hasTemplateOrLateResolvableType() || $this->itemType->hasTemplateOrLateResolvableType(); diff --git a/src/Type/MixedType.php b/src/Type/MixedType.php index 6f7eedeb51e..4fb45184fb7 100644 --- a/src/Type/MixedType.php +++ b/src/Type/MixedType.php @@ -3,6 +3,7 @@ namespace PHPStan\Type; use ArrayAccess; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -1238,6 +1239,15 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('mixed'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + if (!$this->isExplicitMixed || !$position->isMixedAllowed()) { + return null; + } + + return new Identifier('mixed'); + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/NativePhpTypeNodeHelper.php b/src/Type/NativePhpTypeNodeHelper.php new file mode 100644 index 00000000000..e319ffac58e --- /dev/null +++ b/src/Type/NativePhpTypeNodeHelper.php @@ -0,0 +1,166 @@ +getTypes() as $member) { + if ($member->isNull()->yes()) { + $hasNull = true; + continue; + } + + $nonNullTypes[] = $member; + } + + // prefer ?Foo over Foo|null + if ($hasNull && count($nonNullTypes) === 1 && $position->isNullableAllowed()) { + $innerNode = $nonNullTypes[0]->toNativePhpTypeNode($position->toNullableInner()); + if ($innerNode instanceof Identifier || $innerNode instanceof Name) { + return new NullableType($innerNode); + } + } + + $memberPosition = $position->toUnionMember(); + $nodes = []; + foreach ($nonNullTypes as $type) { + $node = $type->toNativePhpTypeNode($memberPosition); + if ($node === null) { + return null; + } + + foreach ($node instanceof Node\UnionType ? $node->types : [$node] as $memberNode) { + if ($memberNode instanceof Node\IntersectionType) { + $names = array_map(static fn (Node $name): string => strtolower($name->toString()), $memberNode->types); + sort($names); + $nodes[implode('&', $names)] = $memberNode; + continue; + } + + if (!$memberNode instanceof Identifier && !$memberNode instanceof Name) { + return null; + } + + $nodes[strtolower($memberNode->toString())] = $memberNode; + } + } + + // PHP rejects redundant members, e.g. Foo|object, static|object, array|iterable, or A|(A&B) + foreach ($nodes as $key => $node) { + if (isset($nodes['object']) && ($node instanceof Name || $node instanceof Node\IntersectionType)) { + unset($nodes[$key]); + continue; + } + + if ($key === 'array' && isset($nodes['iterable'])) { + unset($nodes[$key]); + continue; + } + + if (!$node instanceof Node\IntersectionType) { + continue; + } + + foreach (explode('&', $key) as $part) { + if (isset($nodes[$part])) { + unset($nodes[$key]); + continue 2; + } + } + } + + $nodes = array_values($nodes); + if (count($nodes) === 1 && ($nodes[0] instanceof Identifier || $nodes[0] instanceof Name)) { + if (!$hasNull) { + return $nodes[0]; + } + + if ($position->isNullableAllowed() && !in_array($nodes[0]->toLowerString(), ['false', 'true'], true)) { + return new NullableType($nodes[0]); + } + } + + if (!$position->isUnionAllowed()) { + return null; + } + + if ($hasNull) { + if (!$memberPosition->isNullAllowed()) { + return null; + } + + $nodes[] = new Identifier('null'); + } + + return new Node\UnionType($nodes); + } + + /** @return Identifier|Name|ComplexType|null */ + public static function intersection(IntersectionType $intersectionType, NativeTypePosition $position) + { + if ($intersectionType->isString()->yes()) { + return (new StringType())->toNativePhpTypeNode($position); + } + + if ($intersectionType->isArray()->yes()) { + return (new ArrayType(new MixedType(), new MixedType()))->toNativePhpTypeNode($position); + } + + // only class names can be intersected, other members like HasMethodType are dropped + $memberPosition = $position->toIntersectionMember(); + $names = []; + foreach ($intersectionType->getTypes() as $member) { + $node = $member->toNativePhpTypeNode($memberPosition); + if (!$node instanceof Name) { + continue; + } + + $names[$node->toLowerString()] = $node; + } + + if ($names === []) { + if ($intersectionType->isObject()->yes()) { + return (new ObjectWithoutClassType())->toNativePhpTypeNode($position); + } + + return null; + } + + if (count($names) === 1) { + return array_values($names)[0]; + } + + if (!$position->isIntersectionAllowed()) { + return null; + } + + return new Node\IntersectionType(array_values($names)); + } + +} diff --git a/src/Type/NativeTypePosition.php b/src/Type/NativeTypePosition.php new file mode 100644 index 00000000000..1008f33a247 --- /dev/null +++ b/src/Type/NativeTypePosition.php @@ -0,0 +1,246 @@ +toNativePhpTypeNode(NativeTypePosition::returnType(new PhpVersion(80100))); + * ``` + * + * @api + */ +final class NativeTypePosition +{ + + private const PARAMETER = 1; + private const RETURN = 2; + private const PROPERTY = 3; + private const CLASS_CONSTANT = 4; + + private const STANDALONE = 1; + private const UNION_MEMBER = 2; + private const NULLABLE_INNER = 3; + private const INTERSECTION_MEMBER = 4; + + /** + * @param self::PARAMETER|self::RETURN|self::PROPERTY|self::CLASS_CONSTANT $declaration + * @param self::STANDALONE|self::UNION_MEMBER|self::NULLABLE_INNER|self::INTERSECTION_MEMBER $context + */ + private function __construct( + private int $declaration, + private int $context, + private PhpVersion $phpVersion, + ) + { + } + + /** @api */ + public static function parameter(PhpVersion $phpVersion): self + { + return new self(self::PARAMETER, self::STANDALONE, $phpVersion); + } + + /** @api */ + public static function returnType(PhpVersion $phpVersion): self + { + return new self(self::RETURN, self::STANDALONE, $phpVersion); + } + + /** @api */ + public static function property(PhpVersion $phpVersion): self + { + return new self(self::PROPERTY, self::STANDALONE, $phpVersion); + } + + /** @api */ + public static function classConstant(PhpVersion $phpVersion): self + { + return new self(self::CLASS_CONSTANT, self::STANDALONE, $phpVersion); + } + + /** A member of a union type, e.g. `A` in `A|B`. */ + public function toUnionMember(): self + { + return new self($this->declaration, self::UNION_MEMBER, $this->phpVersion); + } + + /** The inner type of a nullable type, e.g. `A` in `?A`. */ + public function toNullableInner(): self + { + return new self($this->declaration, self::NULLABLE_INNER, $this->phpVersion); + } + + /** A member of an intersection type, e.g. `A` in `A&B`. */ + public function toIntersectionMember(): self + { + return new self($this->declaration, self::INTERSECTION_MEMBER, $this->phpVersion); + } + + /** Class names, also `self`, `parent`, and `Closure`. */ + public function isClassNameAllowed(): bool + { + return $this->isTypeDeclarationAllowed(); + } + + /** `int`, `float`, `string` and `bool`. */ + public function isScalarAllowed(): bool + { + return $this->isKeywordAllowed() && $this->isAtLeast(70000); + } + + public function isArrayAllowed(): bool + { + return $this->isKeywordAllowed(); + } + + public function isIterableAllowed(): bool + { + return $this->isKeywordAllowed() && $this->isAtLeast(70100); + } + + public function isCallableAllowed(): bool + { + return $this->isKeywordAllowed() + && ($this->declaration === self::PARAMETER || $this->declaration === self::RETURN); + } + + public function isObjectAllowed(): bool + { + return $this->isKeywordAllowed() && $this->isAtLeast(70200); + } + + public function isStaticAllowed(): bool + { + return $this->isKeywordAllowed() + && $this->declaration === self::RETURN + && $this->isAtLeast(80000); + } + + public function isVoidAllowed(): bool + { + return $this->isTypeDeclarationAllowed() + && $this->context === self::STANDALONE + && $this->declaration === self::RETURN + && $this->isAtLeast(70100); + } + + public function isNeverAllowed(): bool + { + return $this->isTypeDeclarationAllowed() + && $this->context === self::STANDALONE + && $this->declaration === self::RETURN + && $this->isAtLeast(80100); + } + + public function isMixedAllowed(): bool + { + return $this->isTypeDeclarationAllowed() + && $this->context === self::STANDALONE + && $this->phpVersion->supportsNativeMixed(); + } + + public function isNullAllowed(): bool + { + if (!$this->isTypeDeclarationAllowed()) { + return false; + } + + if ($this->context === self::UNION_MEMBER) { + return $this->phpVersion->supportsNativeUnionTypes(); + } + + return $this->context === self::STANDALONE && $this->phpVersion->supportsTrueFalseNullStandaloneType(); + } + + /** `false` in a union with another non-null type since PHP 8.0, otherwise since PHP 8.2. */ + public function isFalseAllowed(): bool + { + if (!$this->isKeywordAllowed()) { + return false; + } + + if ($this->context === self::UNION_MEMBER) { + return $this->phpVersion->supportsNativeUnionTypes(); + } + + return $this->phpVersion->supportsTrueFalseNullStandaloneType(); + } + + public function isTrueAllowed(): bool + { + return $this->isKeywordAllowed() && $this->phpVersion->supportsTrueFalseNullStandaloneType(); + } + + /** `?A` */ + public function isNullableAllowed(): bool + { + return $this->isTypeDeclarationAllowed() + && $this->context === self::STANDALONE + && $this->isAtLeast(70100); + } + + /** `A|B` */ + public function isUnionAllowed(): bool + { + return $this->isTypeDeclarationAllowed() + && $this->context === self::STANDALONE + && $this->phpVersion->supportsNativeUnionTypes(); + } + + /** `A&B`, also as a member of a union, `(A&B)|C`, since PHP 8.2 */ + public function isIntersectionAllowed(): bool + { + if (!$this->isTypeDeclarationAllowed()) { + return false; + } + + if ($this->context === self::UNION_MEMBER) { + return $this->phpVersion->supportsDisjunctiveNormalForm(); + } + + return $this->context === self::STANDALONE && $this->phpVersion->supportsPureIntersectionTypes(); + } + + private function isTypeDeclarationAllowed(): bool + { + if ($this->declaration === self::RETURN) { + return $this->isAtLeast(70000); + } + + if ($this->declaration === self::PROPERTY) { + return $this->isAtLeast(70400); + } + + if ($this->declaration === self::CLASS_CONSTANT) { + return $this->phpVersion->supportsNativeTypesInClassConstants(); + } + + return true; + } + + /** members of an intersection can only be class names */ + private function isKeywordAllowed(): bool + { + return $this->isTypeDeclarationAllowed() && $this->context !== self::INTERSECTION_MEMBER; + } + + private function isAtLeast(int $versionId): bool + { + return $this->phpVersion->getVersionId() >= $versionId; + } + +} diff --git a/src/Type/NeverType.php b/src/Type/NeverType.php index aef029b8fe6..7d57aa389e3 100644 --- a/src/Type/NeverType.php +++ b/src/Type/NeverType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -662,6 +663,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('never'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isNeverAllowed() ? new Identifier('never') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/NonexistentParentClassType.php b/src/Type/NonexistentParentClassType.php index 974f51004c6..d5624b25858 100644 --- a/src/Type/NonexistentParentClassType.php +++ b/src/Type/NonexistentParentClassType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Name; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -274,6 +275,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('parent'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isClassNameAllowed() ? new Name('parent') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/NullType.php b/src/Type/NullType.php index 881b8bb6a60..e8d6848fac9 100644 --- a/src/Type/NullType.php +++ b/src/Type/NullType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -430,6 +431,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('null'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isNullAllowed() ? new Identifier('null') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/ObjectShapeType.php b/src/Type/ObjectShapeType.php index fec23e94c59..d3f3821bac9 100644 --- a/src/Type/ObjectShapeType.php +++ b/src/Type/ObjectShapeType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Analyser\OutOfClassScope; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprStringNode; use PHPStan\PhpDocParser\Ast\Type\ConstTypeNode; @@ -587,6 +588,11 @@ public function toPhpDocNode(): TypeNode return new ObjectShapeNode($items); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isObjectAllowed() ? new Identifier('object') : null; + } + public function hasTemplateOrLateResolvableType(): bool { foreach ($this->properties as $property) { diff --git a/src/Type/ObjectType.php b/src/Type/ObjectType.php index 139315d1c4c..ec9bbbd1e25 100644 --- a/src/Type/ObjectType.php +++ b/src/Type/ObjectType.php @@ -9,6 +9,7 @@ use DateTimeInterface; use Iterator; use IteratorAggregate; +use PhpParser\Node\Name\FullyQualified; use PHPStan\Analyser\OutOfClassScope; use PHPStan\Broker\ClassNotFoundException; use PHPStan\Internal\LruCache; @@ -2133,6 +2134,16 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode($this->getClassName()); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + $className = $this->getClassName(); + if ($className === '' || !$position->isClassNameAllowed()) { + return null; + } + + return new FullyQualified($className); + } + public function hasTemplateOrLateResolvableType(): bool { if ($this->subtractedType === null) { diff --git a/src/Type/ObjectWithoutClassType.php b/src/Type/ObjectWithoutClassType.php index d22e9842b68..5a3f5fadd88 100644 --- a/src/Type/ObjectWithoutClassType.php +++ b/src/Type/ObjectWithoutClassType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\Turbo\ShadowedByTurboExtension; @@ -225,6 +226,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('object'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isObjectAllowed() ? new Identifier('object') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/ResourceType.php b/src/Type/ResourceType.php index 2d5fe121b6e..514fec24d39 100644 --- a/src/Type/ResourceType.php +++ b/src/Type/ResourceType.php @@ -132,6 +132,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('resource'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/StaticType.php b/src/Type/StaticType.php index bc5e080668c..5692b9aa483 100644 --- a/src/Type/StaticType.php +++ b/src/Type/StaticType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Name; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -933,6 +934,15 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('static'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + if ($position->isStaticAllowed()) { + return new Name('static'); + } + + return $position->isClassNameAllowed() ? new Name('self') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return $this->getStaticObjectType()->hasTemplateOrLateResolvableType(); diff --git a/src/Type/StrictMixedType.php b/src/Type/StrictMixedType.php index 69f0adabbd0..686dcadb917 100644 --- a/src/Type/StrictMixedType.php +++ b/src/Type/StrictMixedType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -522,6 +523,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('mixed'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isMixedAllowed() ? new Identifier('mixed') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/StringType.php b/src/Type/StringType.php index bf82d31e726..d040a563c5a 100644 --- a/src/Type/StringType.php +++ b/src/Type/StringType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\DependencyInjection\ReportUnsafeArrayStringKeyCastingToggle; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; @@ -352,6 +353,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('string'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isScalarAllowed() ? new Identifier('string') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/src/Type/Traits/LateResolvableTypeTrait.php b/src/Type/Traits/LateResolvableTypeTrait.php index f3b3abb3ebe..55ebcedc73b 100644 --- a/src/Type/Traits/LateResolvableTypeTrait.php +++ b/src/Type/Traits/LateResolvableTypeTrait.php @@ -19,6 +19,7 @@ use PHPStan\Type\Generic\TemplateTypeMap; use PHPStan\Type\IsSuperTypeOfResult; use PHPStan\Type\LateResolvableType; +use PHPStan\Type\NativeTypePosition; use PHPStan\Type\NeverType; use PHPStan\Type\Type; @@ -708,6 +709,11 @@ public function resolve(): Type abstract protected function getResult(): Type; + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $this->resolve()->toNativePhpTypeNode($position); + } + public function hasTemplateOrLateResolvableType(): bool { return true; diff --git a/src/Type/Type.php b/src/Type/Type.php index d46008babbd..3abdfca8a85 100644 --- a/src/Type/Type.php +++ b/src/Type/Type.php @@ -2,6 +2,9 @@ namespace PHPStan\Type; +use PhpParser\Node\ComplexType; +use PhpParser\Node\Identifier; +use PhpParser\Node\Name; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\Reflection\Callables\CallableParametersAcceptor; @@ -628,6 +631,15 @@ public function traverseSimultaneously(Type $right, callable $cb): Type; public function toPhpDocNode(): TypeNode; + /** + * The native PHP type declaration for this type at the given position, + * widened to what the position allows, e.g. non-empty-string to string. + * Returns null when the type cannot be declared natively there. + * + * @return Identifier|Name|ComplexType|null + */ + public function toNativePhpTypeNode(NativeTypePosition $position); + /** @see TypeCombinator::remove() */ public function tryRemove(Type $typeToRemove): ?Type; diff --git a/src/Type/UnionType.php b/src/Type/UnionType.php index 4edc065cd63..b992e150034 100644 --- a/src/Type/UnionType.php +++ b/src/Type/UnionType.php @@ -1750,6 +1750,11 @@ public function toPhpDocNode(): TypeNode return new UnionTypeNode(array_map(static fn (Type $type) => $type->toPhpDocNode(), $this->getSortedTypes())); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return NativePhpTypeNodeHelper::union($this, $position); + } + /** * @template T * @param callable(Type $type): list $getValues diff --git a/src/Type/VoidType.php b/src/Type/VoidType.php index 03fd322bf8b..e38dcf218d1 100644 --- a/src/Type/VoidType.php +++ b/src/Type/VoidType.php @@ -2,6 +2,7 @@ namespace PHPStan\Type; +use PhpParser\Node\Identifier; use PHPStan\Php\PhpVersion; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -282,6 +283,11 @@ public function toPhpDocNode(): TypeNode return new IdentifierTypeNode('void'); } + public function toNativePhpTypeNode(NativeTypePosition $position) + { + return $position->isVoidAllowed() ? new Identifier('void') : null; + } + public function hasTemplateOrLateResolvableType(): bool { return false; diff --git a/tests/PHPStan/Type/TypeToNativePhpTypeNodeTest.php b/tests/PHPStan/Type/TypeToNativePhpTypeNodeTest.php new file mode 100644 index 00000000000..ac5729a9a91 --- /dev/null +++ b/tests/PHPStan/Type/TypeToNativePhpTypeNodeTest.php @@ -0,0 +1,189 @@ + + */ + public static function dataToNativePhpTypeNode(): iterable + { + $php70 = new PhpVersion(70000); + $php74 = new PhpVersion(70400); + $php80 = new PhpVersion(80000); + $php81 = new PhpVersion(80100); + $php82 = new PhpVersion(80200); + $php83 = new PhpVersion(80300); + + // scalars are widened, the round trip gives the widened type + yield [new IntegerType(), NativeTypePosition::parameter($php80), 'int', 'int']; + yield [IntegerRangeType::fromInterval(1, 5), NativeTypePosition::parameter($php80), 'int', 'int']; + yield [new ConstantStringType('foo'), NativeTypePosition::returnType($php80), 'string', 'string']; + yield [new IntersectionType([new StringType(), new AccessoryNonEmptyStringType()]), NativeTypePosition::parameter($php80), 'string', 'string']; + yield [TypeCombinator::union(new ConstantStringType('a'), new ConstantStringType('b')), NativeTypePosition::parameter($php74), 'string', 'string']; + yield [TypeCombinator::union(new ConstantIntegerType(1), new ConstantIntegerType(2), new NullType()), NativeTypePosition::parameter($php74), '?int', 'int|null']; + + // arrays and iterables + yield [new ConstantArrayType([new ConstantStringType('foo')], [new IntegerType()]), NativeTypePosition::parameter($php80), 'array', 'array']; + yield [new IntersectionType([new ArrayType(new IntegerType(), new StringType()), new AccessoryArrayListType()]), NativeTypePosition::returnType($php80), 'array', 'array']; + yield [new IterableType(new MixedType(), new MixedType()), NativeTypePosition::parameter($php80), 'iterable', 'iterable']; + + // mixed + yield [new MixedType(true), NativeTypePosition::parameter($php80), 'mixed', 'mixed']; + yield [new MixedType(true), NativeTypePosition::parameter($php74), null, null]; + yield [new MixedType(), NativeTypePosition::parameter($php80), null, null]; + + // objects + yield [new ObjectType(stdClass::class), NativeTypePosition::parameter($php70), '\stdClass', 'stdClass']; + yield [new ObjectWithoutClassType(), NativeTypePosition::parameter($php74), 'object', 'object']; + yield [new HasMethodType('foo'), NativeTypePosition::parameter($php74), null, null]; + yield [new IntersectionType([new ObjectWithoutClassType(), new HasMethodType('foo')]), NativeTypePosition::parameter($php74), 'object', 'object']; + yield [new IntersectionType([new ObjectType(stdClass::class), new HasMethodType('foo')]), NativeTypePosition::parameter($php80), '\stdClass', 'stdClass']; + yield [new ClosureType(), NativeTypePosition::property($php74), '\Closure', Closure::class]; + + // nullable is preferred over a union with null + yield [TypeCombinator::addNull(new ObjectType(stdClass::class)), NativeTypePosition::parameter($php80), '?\stdClass', 'stdClass|null']; + yield [TypeCombinator::addNull(new ObjectType(stdClass::class)), NativeTypePosition::parameter($php70), null, null]; + yield [TypeCombinator::addNull(new BooleanType()), NativeTypePosition::property($php80), '?bool', 'bool|null']; + yield [TypeCombinator::union(new IntegerType(), new StringType(), new NullType()), NativeTypePosition::parameter($php80), 'int|string|null', 'int|string|null']; + + // unions + yield [TypeCombinator::union(new IntegerType(), new StringType()), NativeTypePosition::parameter($php74), null, null]; + yield [TypeCombinator::union(new IntegerType(), new StringType()), NativeTypePosition::parameter($php80), 'int|string', 'int|string']; + yield [TypeCombinator::union(new StringType(), new ConstantBooleanType(false)), NativeTypePosition::returnType($php80), 'string|false', 'string|false']; + + // true, false and null + yield [new ConstantBooleanType(false), NativeTypePosition::returnType($php81), 'bool', 'bool']; + yield [new ConstantBooleanType(false), NativeTypePosition::returnType($php82), 'false', 'false']; + yield [TypeCombinator::addNull(new ConstantBooleanType(false)), NativeTypePosition::returnType($php81), '?bool', 'bool|null']; + yield [TypeCombinator::addNull(new ConstantBooleanType(false)), NativeTypePosition::returnType($php82), '?false', 'false|null']; + yield [new NullType(), NativeTypePosition::returnType($php81), null, null]; + yield [new NullType(), NativeTypePosition::returnType($php82), 'null', 'null']; + + // callable is not allowed in properties + yield [new CallableType(), NativeTypePosition::parameter($php80), 'callable', 'callable(): mixed']; + yield [new CallableType(), NativeTypePosition::property($php80), null, null]; + yield [TypeCombinator::addNull(new CallableType()), NativeTypePosition::property($php80), null, null]; + yield [TypeCombinator::addNull(new CallableType()), NativeTypePosition::returnType($php80), '?callable', '(callable(): mixed)|null']; + + // return-only types + yield [new VoidType(), NativeTypePosition::returnType($php74), 'void', 'void']; + yield [new VoidType(), NativeTypePosition::parameter($php80), null, null]; + yield [new NeverType(true), NativeTypePosition::returnType($php80), null, null]; + yield [new NonAcceptingNeverType(), NativeTypePosition::returnType($php81), 'never', 'never']; + + // declaration positions + yield [new IntegerType(), NativeTypePosition::property(new PhpVersion(70300)), null, null]; + yield [new IntegerType(), NativeTypePosition::property($php74), 'int', 'int']; + yield [new IntegerType(), NativeTypePosition::classConstant($php82), null, null]; + yield [new IntegerType(), NativeTypePosition::classConstant($php83), 'int', 'int']; + + // intersections, and DNF since PHP 8.2 + $countableTraversable = new IntersectionType([new ObjectType(Countable::class), new ObjectType(Traversable::class)]); + yield [$countableTraversable, NativeTypePosition::parameter($php80), null, null]; + yield [$countableTraversable, NativeTypePosition::parameter($php81), '\Countable&\Traversable', 'Countable&Traversable']; + yield [TypeCombinator::addNull($countableTraversable), NativeTypePosition::parameter($php81), null, null]; + yield [TypeCombinator::addNull($countableTraversable), NativeTypePosition::parameter($php82), '(\Countable&\Traversable)|null', '(Countable&Traversable)|null']; + yield [TypeCombinator::union($countableTraversable, new StringType()), NativeTypePosition::returnType($php82), '(\Countable&\Traversable)|string', '(Countable&Traversable)|string']; + + // resources cannot be declared + yield [new ResourceType(), NativeTypePosition::parameter($php80), null, null]; + + // only a certain string, array, object or null widens; maybe-string/array/object accessories alone do not + yield [new IntersectionType([new HasOffsetType(new ConstantIntegerType(0)), new HasOffsetType(new ConstantIntegerType(1))]), NativeTypePosition::returnType($php82), null, null]; + $templateMixed = TemplateTypeFactory::create(TemplateTypeScope::createWithFunction('foo'), 'T', new MixedType(), TemplateTypeVariance::createInvariant()); + yield [new UnionType([new IntegerType(), $templateMixed]), NativeTypePosition::returnType($php82), null, null]; + } + + #[DataProvider('dataToNativePhpTypeNode')] + public function testToNativePhpTypeNode(Type $type, NativeTypePosition $position, ?string $expected, ?string $expectedRoundTrip): void + { + $node = $type->toNativePhpTypeNode($position); + $this->assertSame($expected, $node !== null ? self::print($node) : null); + if ($node === null) { + return; + } + + $roundTripType = ParserNodeTypeToPHPStanType::resolve($node, null); + $this->assertSame($expectedRoundTrip, $roundTripType->describe(VerbosityLevel::precise())); + $this->assertTrue( + $roundTripType->isSuperTypeOf($type)->yes(), + sprintf('%s is not a supertype of %s', $roundTripType->describe(VerbosityLevel::precise()), $type->describe(VerbosityLevel::precise())), + ); + } + + public function testStatic(): void + { + $classReflection = self::createReflectionProvider()->getClass(stdClass::class); + $staticType = new StaticType($classReflection); + + $this->assertSame('static', self::print($staticType->toNativePhpTypeNode(NativeTypePosition::returnType(new PhpVersion(80000))))); + $this->assertSame('self', self::print($staticType->toNativePhpTypeNode(NativeTypePosition::returnType(new PhpVersion(70400))))); + $this->assertSame('self', self::print($staticType->toNativePhpTypeNode(NativeTypePosition::parameter(new PhpVersion(80000))))); + + $roundTripType = ParserNodeTypeToPHPStanType::resolve($staticType->toNativePhpTypeNode(NativeTypePosition::returnType(new PhpVersion(80000))), $classReflection); + $this->assertTrue($roundTripType->equals($staticType)); + } + + public function testTrue(): void + { + $this->assertSame('bool', self::print((new ConstantBooleanType(true))->toNativePhpTypeNode(NativeTypePosition::parameter(new PhpVersion(80100))))); + $this->assertSame('true', self::print((new ConstantBooleanType(true))->toNativePhpTypeNode(NativeTypePosition::parameter(new PhpVersion(80200))))); + } + + private static function print(Identifier|Name|ComplexType|null $node): string + { + if ($node instanceof FullyQualified) { + return $node->toCodeString(); + } + + if ($node instanceof Identifier || $node instanceof Name) { + return $node->toString(); + } + + if ($node instanceof NullableType) { + return '?' . self::print($node->type); + } + + if ($node instanceof Node\UnionType) { + return implode('|', array_map(static fn (Node $member): string => $member instanceof Node\IntersectionType ? '(' . self::print($member) . ')' : self::print($member), $node->types)); + } + + if ($node instanceof Node\IntersectionType) { + return implode('&', array_map(static fn (Node $member): string => self::print($member), $node->types)); + } + + return 'null'; + } + +} diff --git a/turbo-ext/src/AccessoryArrayListType.cpp b/turbo-ext/src/AccessoryArrayListType.cpp index 22b94a2ae2c..88bc4b7c07f 100644 --- a/turbo-ext/src/AccessoryArrayListType.cpp +++ b/turbo-ext/src/AccessoryArrayListType.cpp @@ -569,6 +569,13 @@ PT_MINIT_REGISTRATION(pt_register_accessory_array_list_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isArrayAllowed() ? new Identifier('array') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isarrayallowed"), PT_CLASS_IDENTIFIER, PT_LC("array"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/AccessoryDecimalIntegerStringType.cpp b/turbo-ext/src/AccessoryDecimalIntegerStringType.cpp index d09734a0d4c..334d0dc21d7 100644 --- a/turbo-ext/src/AccessoryDecimalIntegerStringType.cpp +++ b/turbo-ext/src/AccessoryDecimalIntegerStringType.cpp @@ -750,6 +750,13 @@ PT_MINIT_REGISTRATION(pt_register_accessory_decimal_integer_string_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('string') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("string"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/AccessoryLiteralStringType.cpp b/turbo-ext/src/AccessoryLiteralStringType.cpp index 976e46fab5c..4e38e228424 100644 --- a/turbo-ext/src/AccessoryLiteralStringType.cpp +++ b/turbo-ext/src/AccessoryLiteralStringType.cpp @@ -466,6 +466,13 @@ PT_MINIT_REGISTRATION(pt_register_accessory_literal_string_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('string') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("string"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/AccessoryLowercaseStringType.cpp b/turbo-ext/src/AccessoryLowercaseStringType.cpp index 7808c1dfb43..39fb3964b59 100644 --- a/turbo-ext/src/AccessoryLowercaseStringType.cpp +++ b/turbo-ext/src/AccessoryLowercaseStringType.cpp @@ -495,6 +495,13 @@ PT_MINIT_REGISTRATION(pt_register_accessory_lowercase_string_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('string') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("string"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/AccessoryNonEmptyStringType.cpp b/turbo-ext/src/AccessoryNonEmptyStringType.cpp index 91519b8945d..bf9685ee62b 100644 --- a/turbo-ext/src/AccessoryNonEmptyStringType.cpp +++ b/turbo-ext/src/AccessoryNonEmptyStringType.cpp @@ -493,6 +493,13 @@ PT_MINIT_REGISTRATION(pt_register_accessory_non_empty_string_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('string') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("string"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/AccessoryNonFalsyStringType.cpp b/turbo-ext/src/AccessoryNonFalsyStringType.cpp index 237c790a851..36b8b8a0288 100644 --- a/turbo-ext/src/AccessoryNonFalsyStringType.cpp +++ b/turbo-ext/src/AccessoryNonFalsyStringType.cpp @@ -488,6 +488,13 @@ PT_MINIT_REGISTRATION(pt_register_accessory_non_falsy_string_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('string') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("string"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/AccessoryNumericStringType.cpp b/turbo-ext/src/AccessoryNumericStringType.cpp index 8d87a91dbd7..94808d2e7b3 100644 --- a/turbo-ext/src/AccessoryNumericStringType.cpp +++ b/turbo-ext/src/AccessoryNumericStringType.cpp @@ -545,6 +545,13 @@ PT_MINIT_REGISTRATION(pt_register_accessory_numeric_string_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('string') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("string"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/AccessoryUppercaseStringType.cpp b/turbo-ext/src/AccessoryUppercaseStringType.cpp index 3be02f97c47..01d57f26a83 100644 --- a/turbo-ext/src/AccessoryUppercaseStringType.cpp +++ b/turbo-ext/src/AccessoryUppercaseStringType.cpp @@ -495,6 +495,13 @@ PT_MINIT_REGISTRATION(pt_register_accessory_uppercase_string_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('string') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("string"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/ArrayType.cpp b/turbo-ext/src/ArrayType.cpp index 5cd812cd9a7..c6ccc5b88ef 100644 --- a/turbo-ext/src/ArrayType.cpp +++ b/turbo-ext/src/ArrayType.cpp @@ -2294,6 +2294,13 @@ PT_MINIT_REGISTRATION(pt_register_array_type) cls.method<&ArrayType::hasTemplateOrLateResolvableType>(sigs::hasTemplateOrLateResolvableType); cls.op(); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isArrayAllowed() ? new Identifier('array') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isarrayallowed"), PT_CLASS_IDENTIFIER, PT_LC("array"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares (isCallable, getCallableParametersAcceptors, * ...) */ diff --git a/turbo-ext/src/BooleanType.cpp b/turbo-ext/src/BooleanType.cpp index 64c6f7c7550..6902b6461ae 100644 --- a/turbo-ext/src/BooleanType.cpp +++ b/turbo-ext/src/BooleanType.cpp @@ -334,6 +334,13 @@ PT_MINIT_REGISTRATION(pt_register_boolean_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(BooleanType::hasTemplateOrLateResolvableType()); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('bool') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("bool"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares (getConstantStrings, getConstantScalarTypes, * getConstantScalarValues, isNull, isTrue, isFalse, isBoolean) */ diff --git a/turbo-ext/src/CallableType.cpp b/turbo-ext/src/CallableType.cpp index d693db903a7..9cb6be3a4c7 100644 --- a/turbo-ext/src/CallableType.cpp +++ b/turbo-ext/src/CallableType.cpp @@ -1216,6 +1216,13 @@ PT_MINIT_REGISTRATION(pt_register_callable_type) cls.method<&CallableType::hasTemplateOrLateResolvableType>(sigs::hasTemplateOrLateResolvableType); cls.op(); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isCallableAllowed() ? new Identifier('callable') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("iscallableallowed"), PT_CLASS_IDENTIFIER, PT_LC("callable"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::CallableType::registerTraits(cls); diff --git a/turbo-ext/src/ClosureType.cpp b/turbo-ext/src/ClosureType.cpp index 2a99de40a1c..4adaaa71b21 100644 --- a/turbo-ext/src/ClosureType.cpp +++ b/turbo-ext/src/ClosureType.cpp @@ -1301,6 +1301,13 @@ PT_MINIT_REGISTRATION(pt_register_closure_type) cls.method<&ClosureType::hasTemplateOrLateResolvableType>(sigs::hasTemplateOrLateResolvableType); cls.op(); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isClassNameAllowed() ? new FullyQualified('Closure') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isclassnameallowed"), PT_CLASS_FULLY_QUALIFIED, PT_LC("Closure"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::ClosureType::registerTraits(cls); diff --git a/turbo-ext/src/ConstantArrayType.cpp b/turbo-ext/src/ConstantArrayType.cpp index 13ef70f9b54..aa3bfd12158 100644 --- a/turbo-ext/src/ConstantArrayType.cpp +++ b/turbo-ext/src/ConstantArrayType.cpp @@ -7638,6 +7638,13 @@ PT_MINIT_REGISTRATION(pt_register_constant_array_type) * the class's chunkArray() above) */ cls.method("traitChunkArray", reg::Public, 2, { reg::obj("lengthType", ptcls::type), reg::obj("preserveKeys", ptcls::trinaryLogic) }, pt_carr_array_trait_chunk_array_handler(), &ptret::type); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isArrayAllowed() ? new Identifier('array') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isarrayallowed"), PT_CLASS_IDENTIFIER, PT_LC("array"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::ConstantArrayType::registerTraits(cls); diff --git a/turbo-ext/src/ConstantBooleanType.cpp b/turbo-ext/src/ConstantBooleanType.cpp index 81ed2a8bcca..0793584944c 100644 --- a/turbo-ext/src/ConstantBooleanType.cpp +++ b/turbo-ext/src/ConstantBooleanType.cpp @@ -339,6 +339,23 @@ PT_MINIT_REGISTRATION(pt_register_constant_boolean_type) * declaration; the registrar below skips the trait's own looseCompare() * because the class body declares one */ cls.method("scalarLooseCompare", reg::Private, 2, { reg::obj("type", ptcls::type), reg::obj("phpVersion", ptcls::phpVersion) }, pt_type_trait_constant_scalar_loose_compare, &ptret::booleanType); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* new Identifier('true' / 'false') when the position allows the value, + * else parent::toNativePhpTypeNode($position) — BooleanType's answer */ + bool value; + if (UNEXPECTED(!ConstantBooleanType(Z_OBJ_P(ZEND_THIS)).value(value))) RETURN_THROWS(); + zv::Val node = value + ? pt_type_native_type_node(position, PT_LC("istrueallowed"), PT_CLASS_IDENTIFIER, PT_LC("true")) + : pt_type_native_type_node(position, PT_LC("isfalseallowed"), PT_CLASS_IDENTIFIER, PT_LC("false")); + if (UNEXPECTED(node.isUndef())) RETURN_THROWS(); + if (Z_TYPE_P(node.raw()) == IS_NULL) { + PT_RETURN_VAL(pt_type_call_parent(pt_ce_constant_boolean_type, Z_OBJ_P(ZEND_THIS), PT_LC("tonativephptypenode"), 1, position)); + } + PT_RETURN_VAL(std::move(node)); + }); + ptdecl::ConstantBooleanType::registerTraits(cls); cls.shadow(&pt_ce_constant_boolean_type); diff --git a/turbo-ext/src/ErrorType.cpp b/turbo-ext/src/ErrorType.cpp index 1441153daf9..e21ba441c84 100644 --- a/turbo-ext/src/ErrorType.cpp +++ b/turbo-ext/src/ErrorType.cpp @@ -173,6 +173,13 @@ PT_MINIT_REGISTRATION(pt_register_error_type) }); cls.op(PT_OP_EQUALS, PT_OP_LAMBDA { return zv::Val::boolean(ErrorType::equals(argv)); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* null */ + RETURN_NULL(); + }); + cls.shadow(&pt_ce_error_type); } diff --git a/turbo-ext/src/FloatType.cpp b/turbo-ext/src/FloatType.cpp index eed2a732eca..4a098dd9868 100644 --- a/turbo-ext/src/FloatType.cpp +++ b/turbo-ext/src/FloatType.cpp @@ -439,6 +439,13 @@ PT_MINIT_REGISTRATION(pt_register_float_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(FloatType::hasTemplateOrLateResolvableType()); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('float') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("float"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::FloatType::registerTraits(cls); diff --git a/turbo-ext/src/HasMethodType.cpp b/turbo-ext/src/HasMethodType.cpp index b24a0adecdf..aa1c3e53c0b 100644 --- a/turbo-ext/src/HasMethodType.cpp +++ b/turbo-ext/src/HasMethodType.cpp @@ -460,6 +460,13 @@ PT_MINIT_REGISTRATION(pt_register_has_method_type) RETURN_FALSE; }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* null */ + RETURN_NULL(); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/HasOffsetType.cpp b/turbo-ext/src/HasOffsetType.cpp index 73dcefdf4f3..09c786abdc5 100644 --- a/turbo-ext/src/HasOffsetType.cpp +++ b/turbo-ext/src/HasOffsetType.cpp @@ -698,6 +698,13 @@ PT_MINIT_REGISTRATION(pt_register_has_offset_type) cls.method<&HasOffsetType::hasTemplateOrLateResolvableType>(sigs::hasTemplateOrLateResolvableType); cls.op(); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isArrayAllowed() ? new Identifier('array') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isarrayallowed"), PT_CLASS_IDENTIFIER, PT_LC("array"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/HasOffsetValueType.cpp b/turbo-ext/src/HasOffsetValueType.cpp index 7c23210570b..64f6068cbf8 100644 --- a/turbo-ext/src/HasOffsetValueType.cpp +++ b/turbo-ext/src/HasOffsetValueType.cpp @@ -1052,6 +1052,13 @@ PT_MINIT_REGISTRATION(pt_register_has_offset_value_type) cls.method<&HasOffsetValueType::hasTemplateOrLateResolvableType>(sigs::hasTemplateOrLateResolvableType); cls.op(); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isArrayAllowed() ? new Identifier('array') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isarrayallowed"), PT_CLASS_IDENTIFIER, PT_LC("array"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/HasPropertyType.cpp b/turbo-ext/src/HasPropertyType.cpp index f48f77b0a8c..72e6ee7a764 100644 --- a/turbo-ext/src/HasPropertyType.cpp +++ b/turbo-ext/src/HasPropertyType.cpp @@ -404,6 +404,13 @@ PT_MINIT_REGISTRATION(pt_register_has_property_type) RETURN_FALSE; }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* null */ + RETURN_NULL(); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/IntegerType.cpp b/turbo-ext/src/IntegerType.cpp index bd91d0127d6..40270d4f313 100644 --- a/turbo-ext/src/IntegerType.cpp +++ b/turbo-ext/src/IntegerType.cpp @@ -339,6 +339,13 @@ PT_MINIT_REGISTRATION(pt_register_integer_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(IntegerType::hasTemplateOrLateResolvableType()); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('int') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("int"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares (getConstantStrings, isNull, isTrue, isFalse, * isBoolean, isFloat, isInteger) */ diff --git a/turbo-ext/src/IntersectionType.cpp b/turbo-ext/src/IntersectionType.cpp index bdeb4a1755b..7eca740174f 100644 --- a/turbo-ext/src/IntersectionType.cpp +++ b/turbo-ext/src/IntersectionType.cpp @@ -3712,6 +3712,16 @@ PT_MINIT_REGISTRATION(pt_register_intersection_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { int has = IntersectionType(self).hasTemplateOrLateResolvableType(); return has < 0 ? zv::Val() : zv::Val::boolean(has == 1); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* NativePhpTypeNodeHelper::intersection($this, $position) */ + zval args[2]; + ZVAL_OBJ(&args[0], Z_OBJ_P(ZEND_THIS)); + ZVAL_COPY_VALUE(&args[1], position); + PT_RETURN_VAL(pt_type_call_static(PT_CLASS_NATIVE_PHP_TYPE_NODE_HELPER, PT_LC("intersection"), 2, args)); + }); + /* the traits, in the twin's `use` order: the class body above wins over * every name it declares (tryRemove) */ ptdecl::IntersectionType::registerTraits(cls); diff --git a/turbo-ext/src/IterableType.cpp b/turbo-ext/src/IterableType.cpp index d5db027563a..35d78e0e5f4 100644 --- a/turbo-ext/src/IterableType.cpp +++ b/turbo-ext/src/IterableType.cpp @@ -1024,6 +1024,13 @@ PT_MINIT_REGISTRATION(pt_register_iterable_type) cls.method<&IterableType::hasTemplateOrLateResolvableType>(sigs::hasTemplateOrLateResolvableType); cls.op(); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isIterableAllowed() ? new Identifier('iterable') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isiterableallowed"), PT_CLASS_IDENTIFIER, PT_LC("iterable"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::IterableType::registerTraits(cls); diff --git a/turbo-ext/src/MixedType.cpp b/turbo-ext/src/MixedType.cpp index 6e0bd470e5b..a0591fb4a87 100644 --- a/turbo-ext/src/MixedType.cpp +++ b/turbo-ext/src/MixedType.cpp @@ -1897,6 +1897,16 @@ PT_MINIT_REGISTRATION(pt_register_mixed_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $this->isExplicitMixed && $position->isMixedAllowed() ? new Identifier('mixed') : null */ + bool explicitMixed; + if (UNEXPECTED(!MixedType(Z_OBJ_P(ZEND_THIS)).isExplicitMixed(explicitMixed))) RETURN_THROWS(); + if (!explicitMixed) RETURN_NULL(); + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("ismixedallowed"), PT_CLASS_IDENTIFIER, PT_LC("mixed"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares (isCallable, getCallableParametersAcceptors, diff --git a/turbo-ext/src/NeverType.cpp b/turbo-ext/src/NeverType.cpp index c9ace651572..929ec96278a 100644 --- a/turbo-ext/src/NeverType.cpp +++ b/turbo-ext/src/NeverType.cpp @@ -506,6 +506,13 @@ PT_MINIT_REGISTRATION(pt_register_never_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isNeverAllowed() ? new Identifier('never') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isneverallowed"), PT_CLASS_IDENTIFIER, PT_LC("never"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/NonEmptyArrayType.cpp b/turbo-ext/src/NonEmptyArrayType.cpp index 0b5f26c463c..7f9f4e0eab1 100644 --- a/turbo-ext/src/NonEmptyArrayType.cpp +++ b/turbo-ext/src/NonEmptyArrayType.cpp @@ -496,6 +496,13 @@ PT_MINIT_REGISTRATION(pt_register_non_empty_array_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isArrayAllowed() ? new Identifier('array') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isarrayallowed"), PT_CLASS_IDENTIFIER, PT_LC("array"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/NonexistentParentClassType.cpp b/turbo-ext/src/NonexistentParentClassType.cpp index ecab2e2968b..bc7e27dcb12 100644 --- a/turbo-ext/src/NonexistentParentClassType.cpp +++ b/turbo-ext/src/NonexistentParentClassType.cpp @@ -210,6 +210,13 @@ PT_MINIT_REGISTRATION(pt_register_nonexistent_parent_class_type) RETURN_FALSE; }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isClassNameAllowed() ? new Name('parent') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isclassnameallowed"), PT_CLASS_NAME, PT_LC("parent"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::NonexistentParentClassType::registerTraits(cls); diff --git a/turbo-ext/src/NullType.cpp b/turbo-ext/src/NullType.cpp index 7f5d826d381..00aac8ef4bc 100644 --- a/turbo-ext/src/NullType.cpp +++ b/turbo-ext/src/NullType.cpp @@ -717,6 +717,13 @@ PT_MINIT_REGISTRATION(pt_register_null_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(NullType::hasTemplateOrLateResolvableType()); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isNullAllowed() ? new Identifier('null') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isnullallowed"), PT_CLASS_IDENTIFIER, PT_LC("null"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares (toClassConstantType, getConstantStrings) */ ptdecl::NullType::registerTraits(cls); diff --git a/turbo-ext/src/ObjectShapeType.cpp b/turbo-ext/src/ObjectShapeType.cpp index 56af57bd345..171af1935f5 100644 --- a/turbo-ext/src/ObjectShapeType.cpp +++ b/turbo-ext/src/ObjectShapeType.cpp @@ -1387,6 +1387,13 @@ PT_MINIT_REGISTRATION(pt_register_object_shape_type) pt_type_trait_undecided_comparison(cls); pt_type_trait_non_generalizable(cls); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isObjectAllowed() ? new Identifier('object') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isobjectallowed"), PT_CLASS_IDENTIFIER, PT_LC("object"))); + }); + cls.shadow(&pt_ce_object_shape_type); } diff --git a/turbo-ext/src/ObjectType.cpp b/turbo-ext/src/ObjectType.cpp index c940f3814a2..86149a40410 100644 --- a/turbo-ext/src/ObjectType.cpp +++ b/turbo-ext/src/ObjectType.cpp @@ -2857,6 +2857,16 @@ class ObjectType return pt_type_new(PT_CLASS_IDENTIFIER_TYPE_NODE, 1, name.raw()); } + /* null for an empty class name, else $position->isClassNameAllowed() + * ? new FullyQualified($className) : null; UNDEF = pending exception */ + zv::Val toNativePhpTypeNode(zval *position) const + { + zv::Val name = thisGetClassName(); + if (UNEXPECTED(name.isUndef())) return zv::Val(); + if (Z_STRLEN_P(name.raw()) == 0) return zv::Val::null(); + return pt_type_native_type_node(position, PT_LC("isclassnameallowed"), PT_CLASS_FULLY_QUALIFIED, Z_STRVAL_P(name.raw()), Z_STRLEN_P(name.raw())); + } + /* the subtracted type's answer, false without one; false with an * exception pending on an uninitialized slot */ bool hasTemplateOrLateResolvableType(bool &out) const @@ -3928,6 +3938,12 @@ PT_MINIT_REGISTRATION(pt_register_object_type) cls.method<&ObjectType::hasTemplateOrLateResolvableType>(sigs::hasTemplateOrLateResolvableType); cls.op(); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + PT_RETURN_VAL(PT_THIS.toNativePhpTypeNode(position)); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::ObjectType::registerTraits(cls); diff --git a/turbo-ext/src/ObjectWithoutClassType.cpp b/turbo-ext/src/ObjectWithoutClassType.cpp index 9e30885ebce..bc62543d403 100644 --- a/turbo-ext/src/ObjectWithoutClassType.cpp +++ b/turbo-ext/src/ObjectWithoutClassType.cpp @@ -461,6 +461,13 @@ PT_MINIT_REGISTRATION(pt_register_object_without_class_type) pt_type_trait_non_generalizable(cls); pt_type_trait_substractable(cls); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isObjectAllowed() ? new Identifier('object') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isobjectallowed"), PT_CLASS_IDENTIFIER, PT_LC("object"))); + }); + cls.shadow(&pt_ce_object_without_class_type); } diff --git a/turbo-ext/src/OversizedArrayType.cpp b/turbo-ext/src/OversizedArrayType.cpp index 8b44193079b..e6469f49938 100644 --- a/turbo-ext/src/OversizedArrayType.cpp +++ b/turbo-ext/src/OversizedArrayType.cpp @@ -447,6 +447,13 @@ PT_MINIT_REGISTRATION(pt_register_oversized_array_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isArrayAllowed() ? new Identifier('array') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isarrayallowed"), PT_CLASS_IDENTIFIER, PT_LC("array"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/ResourceType.cpp b/turbo-ext/src/ResourceType.cpp index 5a65f332f7c..cc9ac8cf710 100644 --- a/turbo-ext/src/ResourceType.cpp +++ b/turbo-ext/src/ResourceType.cpp @@ -137,6 +137,13 @@ PT_MINIT_REGISTRATION(pt_register_resource_type) RETURN_FALSE; }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* null */ + RETURN_NULL(); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::ResourceType::registerTraits(cls); diff --git a/turbo-ext/src/StaticType.cpp b/turbo-ext/src/StaticType.cpp index 482ae60c51b..3d108cadc06 100644 --- a/turbo-ext/src/StaticType.cpp +++ b/turbo-ext/src/StaticType.cpp @@ -1451,6 +1451,19 @@ PT_MINIT_REGISTRATION(pt_register_static_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return StaticType(self).delegateOp(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, argc, argv); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* new Name('static') when $position->isStaticAllowed(), else + * $position->isClassNameAllowed() ? new Name('self') : null */ + zv::Val node = pt_type_native_type_node(position, PT_LC("isstaticallowed"), PT_CLASS_NAME, PT_LC("static")); + if (UNEXPECTED(node.isUndef())) RETURN_THROWS(); + if (Z_TYPE_P(node.raw()) == IS_NULL) { + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isclassnameallowed"), PT_CLASS_NAME, PT_LC("self"))); + } + PT_RETURN_VAL(std::move(node)); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::StaticType::registerTraits(cls); diff --git a/turbo-ext/src/StrictMixedType.cpp b/turbo-ext/src/StrictMixedType.cpp index 1bb84eeb040..bd510ce63fe 100644 --- a/turbo-ext/src/StrictMixedType.cpp +++ b/turbo-ext/src/StrictMixedType.cpp @@ -429,6 +429,13 @@ PT_MINIT_REGISTRATION(pt_register_strict_mixed_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(false); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isMixedAllowed() ? new Identifier('mixed') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("ismixedallowed"), PT_CLASS_IDENTIFIER, PT_LC("mixed"))); + }); + /* the traits, in the twin's `use` order (UndecidedComparisonCompoundTypeTrait * brings UndecidedComparisonTypeTrait with it); the class body above wins * over every name it declares */ diff --git a/turbo-ext/src/StringType.cpp b/turbo-ext/src/StringType.cpp index ec3d8d66e2a..710ba7454cc 100644 --- a/turbo-ext/src/StringType.cpp +++ b/turbo-ext/src/StringType.cpp @@ -611,6 +611,13 @@ PT_MINIT_REGISTRATION(pt_register_string_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(StringType::hasTemplateOrLateResolvableType()); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isScalarAllowed() ? new Identifier('string') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isscalarallowed"), PT_CLASS_IDENTIFIER, PT_LC("string"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares (getConstantStrings, isNull, isTrue, isFalse, * isBoolean, isFloat, isInteger, isString and the other is*String diff --git a/turbo-ext/src/TypeTraits.cpp b/turbo-ext/src/TypeTraits.cpp index 6272c721393..4d703507dc3 100644 --- a/turbo-ext/src/TypeTraits.cpp +++ b/turbo-ext/src/TypeTraits.cpp @@ -180,6 +180,15 @@ zv::Val pt_type_new(int classIdx, uint32_t argc, zval *argv) return zv::Val::adopt(object); } +zv::Val pt_type_native_type_node(zval *position, const char *allowedLc, size_t allowedLen, int nodeClassIdx, const char *name, size_t nameLen) +{ + bool allowed; + if (UNEXPECTED(!pt_type_call_bool(Z_OBJ_P(position), allowedLc, allowedLen, 0, NULL, allowed))) return zv::Val(); + if (!allowed) return zv::Val::null(); + zv::Val nameZv = zv::Val::string(name, nameLen); + return pt_type_new(nodeClassIdx, 1, nameZv.raw()); +} + bool pt_type_instanceof(zval *value, int classIdx, bool &out) { zend_class_entry *ce = pt_class(classIdx); @@ -3852,6 +3861,8 @@ void pt_type_trait_late_resolvable(reg::Class &cls) cls.traitMethod(sigs::exponentiate, lrDelegate); cls.traitMethod(sigs::getFiniteTypes, lrDelegate); cls.traitMethod(sigs::resolve, lrResolve); + cls.traitMethod(sigs::toNativePhpTypeNode, lrDelegate); + cls.traitMethod(sigs::hasTemplateOrLateResolvableType, [](INTERNAL_FUNCTION_PARAMETERS) { ZEND_PARSE_PARAMETERS_NONE(); RETURN_TRUE; diff --git a/turbo-ext/src/TypeTraits.h b/turbo-ext/src/TypeTraits.h index a33a7efbdd4..44ab6ce21a4 100644 --- a/turbo-ext/src/TypeTraits.h +++ b/turbo-ext/src/TypeTraits.h @@ -170,6 +170,12 @@ zv::Val pt_type_call_static(int classIdx, const char *lcname, size_t len, uint32 * declares one; UNDEF = pending exception */ zv::Val pt_type_new(int classIdx, uint32_t argc, zval *argv); +/* $position->allowed() ? new NodeClass($name) : null — the keyword and + * class-name answers of Type::toNativePhpTypeNode(); allowedLc is the + * lowercased NativeTypePosition check, nodeClassIdx a class-map PhpParser node + * class (Identifier, Name, FullyQualified); UNDEF = pending exception */ +zv::Val pt_type_native_type_node(zval *position, const char *allowedLc, size_t allowedLen, int nodeClassIdx, const char *name, size_t nameLen); + /* $value instanceof Class for a class-map class or interface; false with * an exception pending when the class cannot be resolved */ bool pt_type_instanceof(zval *value, int classIdx, bool &out); diff --git a/turbo-ext/src/UnionType.cpp b/turbo-ext/src/UnionType.cpp index ac355c53dfc..35d0387bf55 100644 --- a/turbo-ext/src/UnionType.cpp +++ b/turbo-ext/src/UnionType.cpp @@ -3486,6 +3486,16 @@ PT_MINIT_REGISTRATION(pt_register_union_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { int has = UnionType(self).hasTemplateOrLateResolvableType(); return has < 0 ? zv::Val() : zv::Val::boolean(has == 1); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* NativePhpTypeNodeHelper::union($this, $position) */ + zval args[2]; + ZVAL_OBJ(&args[0], Z_OBJ_P(ZEND_THIS)); + ZVAL_COPY_VALUE(&args[1], position); + PT_RETURN_VAL(pt_type_call_static(PT_CLASS_NATIVE_PHP_TYPE_NODE_HELPER, PT_LC("union"), 2, args)); + }); + /* the trait: the class body above wins over every name it declares */ ptdecl::UnionType::registerTraits(cls); diff --git a/turbo-ext/src/UnresolvedTemplateArgumentType.cpp b/turbo-ext/src/UnresolvedTemplateArgumentType.cpp index 93a99c4da1b..f65cbb35181 100644 --- a/turbo-ext/src/UnresolvedTemplateArgumentType.cpp +++ b/turbo-ext/src/UnresolvedTemplateArgumentType.cpp @@ -596,6 +596,7 @@ PT_MINIT_REGISTRATION(pt_register_unresolved_template_argument_type) cls.method(sigs::toCoercedArgumentType, utaDelegate); cls.method(sigs::hasTemplateOrLateResolvableType, utaDelegate); cls.method(sigs::toPhpDocNode, utaDelegate); + cls.method(sigs::toNativePhpTypeNode, utaDelegate); cls.method(sigs::getReferencedClasses, utaDelegate); cls.op(PT_OP_GET_REFERENCED_CLASSES, PT_OP_LAMBDA { return UnresolvedTemplateArgumentType(self).delegateOp(PT_OP_GET_REFERENCED_CLASSES, argc, argv); }); cls.method(sigs::getObjectClassNames, utaDelegate); diff --git a/turbo-ext/src/VoidType.cpp b/turbo-ext/src/VoidType.cpp index 6a71744507f..8c597e6d5a4 100644 --- a/turbo-ext/src/VoidType.cpp +++ b/turbo-ext/src/VoidType.cpp @@ -378,6 +378,13 @@ PT_MINIT_REGISTRATION(pt_register_void_type) }); cls.op(PT_OP_HAS_TEMPLATE_OR_LATE_RESOLVABLE_TYPE, PT_OP_LAMBDA { return zv::Val::boolean(VoidType::hasTemplateOrLateResolvableType()); }); + cls.method(sigs::toNativePhpTypeNode, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *position; + if (!zp::parse(execute_data, position)) RETURN_THROWS(); + /* $position->isVoidAllowed() ? new Identifier('void') : null */ + PT_RETURN_VAL(pt_type_native_type_node(position, PT_LC("isvoidallowed"), PT_CLASS_IDENTIFIER, PT_LC("void"))); + }); + /* the traits, in the twin's `use` order; the class body above wins over * every name it declares */ ptdecl::VoidType::registerTraits(cls); diff --git a/turbo-ext/src/generated/AccessoryArrayListType.h b/turbo-ext/src/generated/AccessoryArrayListType.h index 5633923c3b9..75c1c9d8d02 100644 --- a/turbo-ext/src/generated/AccessoryArrayListType.h +++ b/turbo-ext/src/generated/AccessoryArrayListType.h @@ -160,7 +160,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1810 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1829 */ "toPhpDocNode\0" /* 1868 */ - "hasTemplateOrLateResolvableType"; /* 1881 */ + "position\0" /* 1881 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1890 */ + "toNativePhpTypeNode\0" /* 1922 */ + "hasTemplateOrLateResolvableType"; /* 1942 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -296,6 +299,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 132), /* getDefaultBaseType return */ reg::packed(12, 0, 1829), /* toPhpDocNode return */ + reg::packed(1881, 0, 1890), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -396,7 +400,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1782 /* exponentiate */, 1, 129, inline constexpr sigtab::Sig getFiniteTypes = { { 1795 /* getFiniteTypes */, 0, 131, 0, 131, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1810 /* getDefaultBaseType */, 0, 132, 0, 132, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1868 /* toPhpDocNode */, 0, 133, 0, 133, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1881 /* hasTemplateOrLateResolvableType */, 0, 134, 0, 134, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1922 /* toNativePhpTypeNode */, 1, 134, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1942 /* hasTemplateOrLateResolvableType */, 0, 135, 0, 135, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::AccessoryArrayListType diff --git a/turbo-ext/src/generated/AccessoryDecimalIntegerStringType.h b/turbo-ext/src/generated/AccessoryDecimalIntegerStringType.h index 9aa5ba9b68a..305297fb8f1 100644 --- a/turbo-ext/src/generated/AccessoryDecimalIntegerStringType.h +++ b/turbo-ext/src/generated/AccessoryDecimalIntegerStringType.h @@ -129,7 +129,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1325 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1344 */ "toPhpDocNode\0" /* 1383 */ - "hasTemplateOrLateResolvableType"; /* 1396 */ + "position\0" /* 1396 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1405 */ + "toNativePhpTypeNode\0" /* 1437 */ + "hasTemplateOrLateResolvableType"; /* 1457 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_BOOL, reg::NoString, false, false, 8), /* __construct $inverse */ reg::packed(26, MAY_BE_ARRAY), /* getReferencedClasses return */ @@ -219,6 +222,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(26, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(26, 0, 118), /* getDefaultBaseType return */ reg::packed(26, 0, 1344), /* toPhpDocNode return */ + reg::packed(1396, 0, 1405), /* toNativePhpTypeNode $position */ reg::packed(26, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -288,7 +292,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1297 /* exponentiate */, 1, 83, inline constexpr sigtab::Sig getFiniteTypes = { { 1310 /* getFiniteTypes */, 0, 85, 0, 85, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1325 /* getDefaultBaseType */, 0, 86, 0, 86, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1383 /* toPhpDocNode */, 0, 87, 0, 87, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1396 /* hasTemplateOrLateResolvableType */, 0, 88, 0, 88, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1437 /* toNativePhpTypeNode */, 1, 88, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1457 /* hasTemplateOrLateResolvableType */, 0, 89, 0, 89, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::AccessoryDecimalIntegerStringType diff --git a/turbo-ext/src/generated/AccessoryLiteralStringType.h b/turbo-ext/src/generated/AccessoryLiteralStringType.h index 01a11754d67..5ed4d0abd04 100644 --- a/turbo-ext/src/generated/AccessoryLiteralStringType.h +++ b/turbo-ext/src/generated/AccessoryLiteralStringType.h @@ -120,7 +120,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1216 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1235 */ "toPhpDocNode\0" /* 1274 */ - "hasTemplateOrLateResolvableType"; /* 1287 */ + "position\0" /* 1287 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1296 */ + "toNativePhpTypeNode\0" /* 1328 */ + "hasTemplateOrLateResolvableType"; /* 1348 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -206,6 +209,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 104), /* getDefaultBaseType return */ reg::packed(12, 0, 1235), /* toPhpDocNode return */ + reg::packed(1287, 0, 1296), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -273,7 +277,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1188 /* exponentiate */, 1, 79, inline constexpr sigtab::Sig getFiniteTypes = { { 1201 /* getFiniteTypes */, 0, 81, 0, 81, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1216 /* getDefaultBaseType */, 0, 82, 0, 82, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1274 /* toPhpDocNode */, 0, 83, 0, 83, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1287 /* hasTemplateOrLateResolvableType */, 0, 84, 0, 84, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1328 /* toNativePhpTypeNode */, 1, 84, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1348 /* hasTemplateOrLateResolvableType */, 0, 85, 0, 85, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::AccessoryLiteralStringType diff --git a/turbo-ext/src/generated/AccessoryLowercaseStringType.h b/turbo-ext/src/generated/AccessoryLowercaseStringType.h index 1c47bec107e..02c1ad2a6e0 100644 --- a/turbo-ext/src/generated/AccessoryLowercaseStringType.h +++ b/turbo-ext/src/generated/AccessoryLowercaseStringType.h @@ -120,7 +120,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1216 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1235 */ "toPhpDocNode\0" /* 1274 */ - "hasTemplateOrLateResolvableType"; /* 1287 */ + "position\0" /* 1287 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1296 */ + "toNativePhpTypeNode\0" /* 1328 */ + "hasTemplateOrLateResolvableType"; /* 1348 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -206,6 +209,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 104), /* getDefaultBaseType return */ reg::packed(12, 0, 1235), /* toPhpDocNode return */ + reg::packed(1287, 0, 1296), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -273,7 +277,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1188 /* exponentiate */, 1, 79, inline constexpr sigtab::Sig getFiniteTypes = { { 1201 /* getFiniteTypes */, 0, 81, 0, 81, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1216 /* getDefaultBaseType */, 0, 82, 0, 82, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1274 /* toPhpDocNode */, 0, 83, 0, 83, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1287 /* hasTemplateOrLateResolvableType */, 0, 84, 0, 84, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1328 /* toNativePhpTypeNode */, 1, 84, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1348 /* hasTemplateOrLateResolvableType */, 0, 85, 0, 85, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::AccessoryLowercaseStringType diff --git a/turbo-ext/src/generated/AccessoryNonEmptyStringType.h b/turbo-ext/src/generated/AccessoryNonEmptyStringType.h index afdb1ba10ee..a2dc34d00ae 100644 --- a/turbo-ext/src/generated/AccessoryNonEmptyStringType.h +++ b/turbo-ext/src/generated/AccessoryNonEmptyStringType.h @@ -119,7 +119,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1208 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1227 */ "toPhpDocNode\0" /* 1266 */ - "hasTemplateOrLateResolvableType"; /* 1279 */ + "position\0" /* 1279 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1288 */ + "toNativePhpTypeNode\0" /* 1320 */ + "hasTemplateOrLateResolvableType"; /* 1340 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -204,6 +207,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 104), /* getDefaultBaseType return */ reg::packed(12, 0, 1227), /* toPhpDocNode return */ + reg::packed(1279, 0, 1288), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -270,7 +274,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1180 /* exponentiate */, 1, 78, inline constexpr sigtab::Sig getFiniteTypes = { { 1193 /* getFiniteTypes */, 0, 80, 0, 80, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1208 /* getDefaultBaseType */, 0, 81, 0, 81, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1266 /* toPhpDocNode */, 0, 82, 0, 82, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1279 /* hasTemplateOrLateResolvableType */, 0, 83, 0, 83, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1320 /* toNativePhpTypeNode */, 1, 83, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1340 /* hasTemplateOrLateResolvableType */, 0, 84, 0, 84, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::AccessoryNonEmptyStringType diff --git a/turbo-ext/src/generated/AccessoryNonFalsyStringType.h b/turbo-ext/src/generated/AccessoryNonFalsyStringType.h index 44e8999c4d7..4a2a4f1d8e2 100644 --- a/turbo-ext/src/generated/AccessoryNonFalsyStringType.h +++ b/turbo-ext/src/generated/AccessoryNonFalsyStringType.h @@ -118,7 +118,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1185 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1204 */ "toPhpDocNode\0" /* 1243 */ - "hasTemplateOrLateResolvableType"; /* 1256 */ + "position\0" /* 1256 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1265 */ + "toNativePhpTypeNode\0" /* 1297 */ + "hasTemplateOrLateResolvableType"; /* 1317 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -201,6 +204,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 104), /* getDefaultBaseType return */ reg::packed(12, 0, 1204), /* toPhpDocNode return */ + reg::packed(1256, 0, 1265), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -266,7 +270,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1157 /* exponentiate */, 1, 76, inline constexpr sigtab::Sig getFiniteTypes = { { 1170 /* getFiniteTypes */, 0, 78, 0, 78, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1185 /* getDefaultBaseType */, 0, 79, 0, 79, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1243 /* toPhpDocNode */, 0, 80, 0, 80, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1256 /* hasTemplateOrLateResolvableType */, 0, 81, 0, 81, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1297 /* toNativePhpTypeNode */, 1, 81, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1317 /* hasTemplateOrLateResolvableType */, 0, 82, 0, 82, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::AccessoryNonFalsyStringType diff --git a/turbo-ext/src/generated/AccessoryNumericStringType.h b/turbo-ext/src/generated/AccessoryNumericStringType.h index a72265a1107..263c4b5fb33 100644 --- a/turbo-ext/src/generated/AccessoryNumericStringType.h +++ b/turbo-ext/src/generated/AccessoryNumericStringType.h @@ -119,7 +119,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1208 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1227 */ "toPhpDocNode\0" /* 1266 */ - "hasTemplateOrLateResolvableType"; /* 1279 */ + "position\0" /* 1279 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1288 */ + "toNativePhpTypeNode\0" /* 1320 */ + "hasTemplateOrLateResolvableType"; /* 1340 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -204,6 +207,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 104), /* getDefaultBaseType return */ reg::packed(12, 0, 1227), /* toPhpDocNode return */ + reg::packed(1279, 0, 1288), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -270,7 +274,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1180 /* exponentiate */, 1, 78, inline constexpr sigtab::Sig getFiniteTypes = { { 1193 /* getFiniteTypes */, 0, 80, 0, 80, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1208 /* getDefaultBaseType */, 0, 81, 0, 81, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1266 /* toPhpDocNode */, 0, 82, 0, 82, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1279 /* hasTemplateOrLateResolvableType */, 0, 83, 0, 83, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1320 /* toNativePhpTypeNode */, 1, 83, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1340 /* hasTemplateOrLateResolvableType */, 0, 84, 0, 84, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::AccessoryNumericStringType diff --git a/turbo-ext/src/generated/AccessoryUppercaseStringType.h b/turbo-ext/src/generated/AccessoryUppercaseStringType.h index ed46ada8bc4..c84d1028a64 100644 --- a/turbo-ext/src/generated/AccessoryUppercaseStringType.h +++ b/turbo-ext/src/generated/AccessoryUppercaseStringType.h @@ -120,7 +120,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1216 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1235 */ "toPhpDocNode\0" /* 1274 */ - "hasTemplateOrLateResolvableType"; /* 1287 */ + "position\0" /* 1287 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1296 */ + "toNativePhpTypeNode\0" /* 1328 */ + "hasTemplateOrLateResolvableType"; /* 1348 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -206,6 +209,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 104), /* getDefaultBaseType return */ reg::packed(12, 0, 1235), /* toPhpDocNode return */ + reg::packed(1287, 0, 1296), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -273,7 +277,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1188 /* exponentiate */, 1, 79, inline constexpr sigtab::Sig getFiniteTypes = { { 1201 /* getFiniteTypes */, 0, 81, 0, 81, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1216 /* getDefaultBaseType */, 0, 82, 0, 82, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1274 /* toPhpDocNode */, 0, 83, 0, 83, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1287 /* hasTemplateOrLateResolvableType */, 0, 84, 0, 84, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1328 /* toNativePhpTypeNode */, 1, 84, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1348 /* hasTemplateOrLateResolvableType */, 0, 85, 0, 85, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::AccessoryUppercaseStringType diff --git a/turbo-ext/src/generated/ArrayType.h b/turbo-ext/src/generated/ArrayType.h index f2d944cb23c..a995aff2d34 100644 --- a/turbo-ext/src/generated/ArrayType.h +++ b/turbo-ext/src/generated/ArrayType.h @@ -143,12 +143,15 @@ inline constexpr char strings[] = "traverse\0" /* 1605 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1614 */ "toPhpDocNode\0" /* 1653 */ - "right\0" /* 1666 */ - "traverseSimultaneously\0" /* 1672 */ - "typeToRemove\0" /* 1695 */ - "tryRemove\0" /* 1708 */ - "getFiniteTypes\0" /* 1718 */ - "hasTemplateOrLateResolvableType"; /* 1733 */ + "position\0" /* 1666 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1675 */ + "toNativePhpTypeNode\0" /* 1707 */ + "right\0" /* 1727 */ + "traverseSimultaneously\0" /* 1733 */ + "typeToRemove\0" /* 1756 */ + "tryRemove\0" /* 1769 */ + "getFiniteTypes\0" /* 1779 */ + "hasTemplateOrLateResolvableType"; /* 1794 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 8), /* __construct $keyType */ reg::packed(26, 0, 8), /* __construct $itemType */ @@ -252,10 +255,11 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1170, MAY_BE_CALLABLE), /* traverse $cb */ reg::packed(47, 0, 8), /* traverse return */ reg::packed(47, 0, 1614), /* toPhpDocNode return */ - reg::packed(1666, 0, 8), /* traverseSimultaneously $right */ + reg::packed(1666, 0, 1675), /* toNativePhpTypeNode $position */ + reg::packed(1727, 0, 8), /* traverseSimultaneously $right */ reg::packed(1170, MAY_BE_CALLABLE), /* traverseSimultaneously $cb */ reg::packed(47, 0, 8), /* traverseSimultaneously return */ - reg::packed(1695, 0, 8), /* tryRemove $typeToRemove */ + reg::packed(1756, 0, 8), /* tryRemove $typeToRemove */ reg::packed(47, MAY_BE_NULL, 8), /* tryRemove return */ reg::packed(47, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(47, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ @@ -324,10 +328,11 @@ inline constexpr sigtab::Sig inferTemplateTypes = { { 1500 /* inferTemplateTypes inline constexpr sigtab::Sig getReferencedTemplateTypes = { { 1578 /* getReferencedTemplateTypes */, 1, 97, 1, 98, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig traverse = { { 1605 /* traverse */, 1, 99, 1, 100, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1653 /* toPhpDocNode */, 0, 101, 0, 101, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig traverseSimultaneously = { { 1672 /* traverseSimultaneously */, 2, 102, 2, 104, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig tryRemove = { { 1708 /* tryRemove */, 1, 105, 1, 106, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getFiniteTypes = { { 1718 /* getFiniteTypes */, 0, 107, 0, 107, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1733 /* hasTemplateOrLateResolvableType */, 0, 108, 0, 108, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1707 /* toNativePhpTypeNode */, 1, 102, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig traverseSimultaneously = { { 1733 /* traverseSimultaneously */, 2, 103, 2, 105, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig tryRemove = { { 1769 /* tryRemove */, 1, 106, 1, 107, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getFiniteTypes = { { 1779 /* getFiniteTypes */, 0, 108, 0, 108, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1794 /* hasTemplateOrLateResolvableType */, 0, 109, 0, 109, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ArrayType diff --git a/turbo-ext/src/generated/BooleanType.h b/turbo-ext/src/generated/BooleanType.h index 4122ecd2c9f..4a2e75de9ec 100644 --- a/turbo-ext/src/generated/BooleanType.h +++ b/turbo-ext/src/generated/BooleanType.h @@ -75,8 +75,11 @@ inline constexpr char strings[] = "exponentiate\0" /* 469 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 482 */ "toPhpDocNode\0" /* 521 */ - "toTrinaryLogic\0" /* 534 */ - "hasTemplateOrLateResolvableType"; /* 549 */ + "position\0" /* 534 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 543 */ + "toNativePhpTypeNode\0" /* 575 */ + "toTrinaryLogic\0" /* 595 */ + "hasTemplateOrLateResolvableType"; /* 610 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getConstantStrings return */ reg::packed(12, MAY_BE_ARRAY), /* getConstantScalarTypes return */ @@ -108,6 +111,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(460, 0, 122), /* exponentiate $exponent */ reg::packed(12, 0, 122), /* exponentiate return */ reg::packed(12, 0, 482), /* toPhpDocNode return */ + reg::packed(534, 0, 543), /* toNativePhpTypeNode $position */ reg::packed(12, 0, 263), /* toTrinaryLogic return */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; @@ -141,8 +145,9 @@ inline constexpr sigtab::Sig tryRemove = { { 435 /* tryRemove */, 1, 24, 1, 25, inline constexpr sigtab::Sig getFiniteTypes = { { 445 /* getFiniteTypes */, 0, 26, 0, 26, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig exponentiate = { { 469 /* exponentiate */, 1, 27, 1, 28, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 521 /* toPhpDocNode */, 0, 29, 0, 29, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toTrinaryLogic = { { 534 /* toTrinaryLogic */, 0, 30, 0, 30, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 549 /* hasTemplateOrLateResolvableType */, 0, 31, 0, 31, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 575 /* toNativePhpTypeNode */, 1, 30, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toTrinaryLogic = { { 595 /* toTrinaryLogic */, 0, 31, 0, 31, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 610 /* hasTemplateOrLateResolvableType */, 0, 32, 0, 32, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::BooleanType diff --git a/turbo-ext/src/generated/CallableType.h b/turbo-ext/src/generated/CallableType.h index cb1c1622a7e..e6135eae25e 100644 --- a/turbo-ext/src/generated/CallableType.h +++ b/turbo-ext/src/generated/CallableType.h @@ -172,7 +172,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 1882 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1897 */ "toPhpDocNode\0" /* 1936 */ - "hasTemplateOrLateResolvableType"; /* 1949 */ + "position\0" /* 1949 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1958 */ + "toNativePhpTypeNode\0" /* 1990 */ + "hasTemplateOrLateResolvableType"; /* 2010 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 11), /* __construct $parameters */ reg::packed(16, MAY_BE_NULL, 27, false, false, 11), /* __construct $returnType */ @@ -278,6 +281,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(233, 0, 27), /* exponentiate return */ reg::packed(233, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(233, 0, 1897), /* toPhpDocNode return */ + reg::packed(1949, 0, 1958), /* toNativePhpTypeNode $position */ reg::packed(233, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -360,7 +364,8 @@ inline constexpr sigtab::Sig isCommonCallable = { { 1843 /* isCommonCallable */, inline constexpr sigtab::Sig exponentiate = { { 1869 /* exponentiate */, 1, 100, 1, 101, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 1882 /* getFiniteTypes */, 0, 102, 0, 102, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1936 /* toPhpDocNode */, 0, 103, 0, 103, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1949 /* hasTemplateOrLateResolvableType */, 0, 104, 0, 104, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1990 /* toNativePhpTypeNode */, 1, 104, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 2010 /* hasTemplateOrLateResolvableType */, 0, 105, 0, 105, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::CallableType diff --git a/turbo-ext/src/generated/ClosureType.h b/turbo-ext/src/generated/ClosureType.h index ccd8548650d..8db6cad8960 100644 --- a/turbo-ext/src/generated/ClosureType.h +++ b/turbo-ext/src/generated/ClosureType.h @@ -249,7 +249,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 3183 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 3198 */ "toPhpDocNode\0" /* 3237 */ - "hasTemplateOrLateResolvableType"; /* 3250 */ + "position\0" /* 3250 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 3259 */ + "toNativePhpTypeNode\0" /* 3291 */ + "hasTemplateOrLateResolvableType"; /* 3311 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_NULL | MAY_BE_ARRAY, reg::NoString, false, false, 11), /* __construct $parameters */ reg::packed(16, MAY_BE_NULL, 27, false, false, 11), /* __construct $returnType */ @@ -424,6 +427,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(416, 0, 27), /* exponentiate return */ reg::packed(416, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(416, 0, 3198), /* toPhpDocNode return */ + reg::packed(3250, 0, 3259), /* toNativePhpTypeNode $position */ reg::packed(416, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -540,7 +544,8 @@ inline constexpr sigtab::Sig looseCompare = { { 3148 /* looseCompare */, 2, 166, inline constexpr sigtab::Sig exponentiate = { { 3170 /* exponentiate */, 1, 169, 1, 170, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 3183 /* getFiniteTypes */, 0, 171, 0, 171, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 3237 /* toPhpDocNode */, 0, 172, 0, 172, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3250 /* hasTemplateOrLateResolvableType */, 0, 173, 0, 173, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 3291 /* toNativePhpTypeNode */, 1, 173, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3311 /* hasTemplateOrLateResolvableType */, 0, 174, 0, 174, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ClosureType diff --git a/turbo-ext/src/generated/ConstantArrayType.h b/turbo-ext/src/generated/ConstantArrayType.h index a3a9643fc28..bab798d267e 100644 --- a/turbo-ext/src/generated/ConstantArrayType.h +++ b/turbo-ext/src/generated/ConstantArrayType.h @@ -219,10 +219,13 @@ inline constexpr char strings[] = "foldUnsealedKeyCase\0" /* 2507 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 2527 */ "toPhpDocNode\0" /* 2566 */ - "value\0" /* 2579 */ - "isValidIdentifier\0" /* 2585 */ - "getFiniteTypes\0" /* 2603 */ - "hasTemplateOrLateResolvableType"; /* 2618 */ + "position\0" /* 2579 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 2588 */ + "toNativePhpTypeNode\0" /* 2620 */ + "value\0" /* 2640 */ + "isValidIdentifier\0" /* 2646 */ + "getFiniteTypes\0" /* 2664 */ + "hasTemplateOrLateResolvableType"; /* 2679 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_ARRAY), /* __construct $keyTypes */ reg::packed(9, MAY_BE_ARRAY), /* __construct $valueTypes */ @@ -408,7 +411,8 @@ inline constexpr reg::PackedArg args[] = { reg::packed(2386, MAY_BE_NULL | MAY_BE_LONG), /* foldUnsealedKeyCase $case */ reg::packed(110, 0, 254), /* foldUnsealedKeyCase return */ reg::packed(110, 0, 2527), /* toPhpDocNode return */ - reg::packed(2579, MAY_BE_STRING), /* isValidIdentifier $value */ + reg::packed(2579, 0, 2588), /* toNativePhpTypeNode $position */ + reg::packed(2640, MAY_BE_STRING), /* isValidIdentifier $value */ reg::packed(110, MAY_BE_BOOL), /* isValidIdentifier return */ reg::packed(110, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(110, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ @@ -517,9 +521,10 @@ inline constexpr sigtab::Sig filterArrayRemovingFalsey = { { 2410 /* filterArray inline constexpr sigtab::Sig foldConstantStringKeyCase = { { 2477 /* foldConstantStringKeyCase */, 2, 177, 2, 179, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig foldUnsealedKeyCase = { { 2507 /* foldUnsealedKeyCase */, 2, 180, 2, 182, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 2566 /* toPhpDocNode */, 0, 183, 0, 183, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isValidIdentifier = { { 2585 /* isValidIdentifier */, 1, 184, 1, 185, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig getFiniteTypes = { { 2603 /* getFiniteTypes */, 0, 186, 0, 186, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 2618 /* hasTemplateOrLateResolvableType */, 0, 187, 0, 187, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 2620 /* toNativePhpTypeNode */, 1, 184, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isValidIdentifier = { { 2646 /* isValidIdentifier */, 1, 185, 1, 186, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig getFiniteTypes = { { 2664 /* getFiniteTypes */, 0, 187, 0, 187, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 2679 /* hasTemplateOrLateResolvableType */, 0, 188, 0, 188, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ConstantArrayType diff --git a/turbo-ext/src/generated/ConstantBooleanType.h b/turbo-ext/src/generated/ConstantBooleanType.h index a1c444b8ff6..12cd9ff467a 100644 --- a/turbo-ext/src/generated/ConstantBooleanType.h +++ b/turbo-ext/src/generated/ConstantBooleanType.h @@ -67,8 +67,11 @@ inline constexpr char strings[] = "generalize\0" /* 426 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 437 */ "toPhpDocNode\0" /* 476 */ - "type\0" /* 489 */ - "looseCompare"; /* 494 */ + "position\0" /* 489 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 498 */ + "toNativePhpTypeNode\0" /* 530 */ + "type\0" /* 550 */ + "looseCompare"; /* 555 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_BOOL), /* __construct $value */ reg::packed(18, MAY_BE_BOOL), /* getValue return */ @@ -97,7 +100,8 @@ inline constexpr reg::PackedArg args[] = { reg::packed(383, 0, 393), /* generalize $precision */ reg::packed(18, 0, 105), /* generalize return */ reg::packed(18, 0, 437), /* toPhpDocNode return */ - reg::packed(489, 0, 105), /* looseCompare $type */ + reg::packed(489, 0, 498), /* toNativePhpTypeNode $position */ + reg::packed(550, 0, 105), /* looseCompare $type */ reg::packed(71, 0, 82), /* looseCompare $phpVersion */ reg::packed(18, 0, 197), /* looseCompare return */ }; @@ -126,7 +130,8 @@ inline constexpr sigtab::Sig isTrue = { { 368 /* isTrue */, 0, 22, 0, 22, ZEND_A inline constexpr sigtab::Sig isFalse = { { 375 /* isFalse */, 0, 23, 0, 23, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig generalize = { { 426 /* generalize */, 1, 24, 1, 25, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 476 /* toPhpDocNode */, 0, 26, 0, 26, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig looseCompare = { { 494 /* looseCompare */, 2, 27, 2, 29, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 530 /* toNativePhpTypeNode */, 1, 27, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig looseCompare = { { 555 /* looseCompare */, 2, 28, 2, 30, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ConstantBooleanType diff --git a/turbo-ext/src/generated/ErrorType.h b/turbo-ext/src/generated/ErrorType.h index c745f24229e..1a6d570105f 100644 --- a/turbo-ext/src/generated/ErrorType.h +++ b/turbo-ext/src/generated/ErrorType.h @@ -40,7 +40,10 @@ inline constexpr char strings[] = "getIterableValueType\0" /* 115 */ "type\0" /* 136 */ "subtract\0" /* 141 */ - "equals"; /* 150 */ + "equals\0" /* 150 */ + "position\0" /* 157 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 166 */ + "toNativePhpTypeNode"; /* 198 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 7), /* __construct $reason */ reg::packed(24, MAY_BE_NULL | MAY_BE_STRING), /* getReason return */ @@ -52,6 +55,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(24, 0, 78), /* subtract return */ reg::packed(136, 0, 78), /* equals $type */ reg::packed(24, MAY_BE_BOOL), /* equals return */ + reg::packed(157, 0, 166), /* toNativePhpTypeNode $position */ }; using Sig = reg::Sig; } // namespace sigtab @@ -65,6 +69,7 @@ inline constexpr sigtab::Sig getIterableKeyType = { { 96 /* getIterableKeyType * inline constexpr sigtab::Sig getIterableValueType = { { 115 /* getIterableValueType */, 0, 5, 0, 5, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig subtract = { { 141 /* subtract */, 1, 6, 1, 7, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig equals = { { 150 /* equals */, 1, 8, 1, 9, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 198 /* toNativePhpTypeNode */, 1, 10, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ErrorType diff --git a/turbo-ext/src/generated/FloatType.h b/turbo-ext/src/generated/FloatType.h index 8772c27bb9c..c9486a04e03 100644 --- a/turbo-ext/src/generated/FloatType.h +++ b/turbo-ext/src/generated/FloatType.h @@ -100,8 +100,11 @@ inline constexpr char strings[] = "exponentiate\0" /* 901 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 914 */ "toPhpDocNode\0" /* 953 */ - "getFiniteTypes\0" /* 966 */ - "hasTemplateOrLateResolvableType"; /* 981 */ + "position\0" /* 966 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 975 */ + "toNativePhpTypeNode\0" /* 1007 */ + "getFiniteTypes\0" /* 1027 */ + "hasTemplateOrLateResolvableType"; /* 1042 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -161,6 +164,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(892, 0, 104), /* exponentiate $exponent */ reg::packed(12, 0, 104), /* exponentiate return */ reg::packed(12, 0, 914), /* toPhpDocNode return */ + reg::packed(966, 0, 975), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; @@ -216,8 +220,9 @@ inline constexpr sigtab::Sig traverse = { { 854 /* traverse */, 1, 50, 1, 51, ZE inline constexpr sigtab::Sig traverseSimultaneously = { { 869 /* traverseSimultaneously */, 2, 52, 2, 54, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig exponentiate = { { 901 /* exponentiate */, 1, 55, 1, 56, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 953 /* toPhpDocNode */, 0, 57, 0, 57, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getFiniteTypes = { { 966 /* getFiniteTypes */, 0, 58, 0, 58, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 981 /* hasTemplateOrLateResolvableType */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1007 /* toNativePhpTypeNode */, 1, 58, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getFiniteTypes = { { 1027 /* getFiniteTypes */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1042 /* hasTemplateOrLateResolvableType */, 0, 60, 0, 60, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::FloatType diff --git a/turbo-ext/src/generated/HasMethodType.h b/turbo-ext/src/generated/HasMethodType.h index 00f136bcb89..bfe02870cad 100644 --- a/turbo-ext/src/generated/HasMethodType.h +++ b/turbo-ext/src/generated/HasMethodType.h @@ -115,7 +115,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1118 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1137 */ "toPhpDocNode\0" /* 1176 */ - "hasTemplateOrLateResolvableType"; /* 1189 */ + "position\0" /* 1189 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1198 */ + "toNativePhpTypeNode\0" /* 1230 */ + "hasTemplateOrLateResolvableType"; /* 1250 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $methodName */ reg::packed(23, MAY_BE_ARRAY), /* getReferencedClasses return */ @@ -184,6 +187,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(23, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(23, 0, 91), /* getDefaultBaseType return */ reg::packed(23, 0, 1137), /* toPhpDocNode return */ + reg::packed(1189, 0, 1198), /* toNativePhpTypeNode $position */ reg::packed(23, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -238,7 +242,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1090 /* exponentiate */, 1, 62, inline constexpr sigtab::Sig getFiniteTypes = { { 1103 /* getFiniteTypes */, 0, 64, 0, 64, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1118 /* getDefaultBaseType */, 0, 65, 0, 65, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1176 /* toPhpDocNode */, 0, 66, 0, 66, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1189 /* hasTemplateOrLateResolvableType */, 0, 67, 0, 67, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1230 /* toNativePhpTypeNode */, 1, 67, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1250 /* hasTemplateOrLateResolvableType */, 0, 68, 0, 68, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::HasMethodType diff --git a/turbo-ext/src/generated/HasOffsetType.h b/turbo-ext/src/generated/HasOffsetType.h index 804be73b5da..8a57e1bfadc 100644 --- a/turbo-ext/src/generated/HasOffsetType.h +++ b/turbo-ext/src/generated/HasOffsetType.h @@ -143,7 +143,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1510 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1529 */ "toPhpDocNode\0" /* 1568 */ - "hasTemplateOrLateResolvableType"; /* 1581 */ + "position\0" /* 1581 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1590 */ + "toNativePhpTypeNode\0" /* 1622 */ + "hasTemplateOrLateResolvableType"; /* 1642 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 11), /* __construct $offsetType */ reg::packed(106, 0, 11), /* getOffsetType return */ @@ -253,6 +256,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(106, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(106, 0, 193), /* getDefaultBaseType return */ reg::packed(106, 0, 1529), /* toPhpDocNode return */ + reg::packed(1581, 0, 1590), /* toNativePhpTypeNode $position */ reg::packed(106, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -328,7 +332,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1482 /* exponentiate */, 1, 103, inline constexpr sigtab::Sig getFiniteTypes = { { 1495 /* getFiniteTypes */, 0, 105, 0, 105, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1510 /* getDefaultBaseType */, 0, 106, 0, 106, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1568 /* toPhpDocNode */, 0, 107, 0, 107, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1581 /* hasTemplateOrLateResolvableType */, 0, 108, 0, 108, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1622 /* toNativePhpTypeNode */, 1, 108, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1642 /* hasTemplateOrLateResolvableType */, 0, 109, 0, 109, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::HasOffsetType diff --git a/turbo-ext/src/generated/HasOffsetValueType.h b/turbo-ext/src/generated/HasOffsetValueType.h index 205e90073f4..846dcf1b3d1 100644 --- a/turbo-ext/src/generated/HasOffsetValueType.h +++ b/turbo-ext/src/generated/HasOffsetValueType.h @@ -151,7 +151,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1584 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1603 */ "toPhpDocNode\0" /* 1642 */ - "hasTemplateOrLateResolvableType"; /* 1655 */ + "position\0" /* 1655 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1664 */ + "toNativePhpTypeNode\0" /* 1696 */ + "hasTemplateOrLateResolvableType"; /* 1716 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 11), /* __construct $offsetType */ reg::packed(94, 0, 104), /* __construct $valueType */ @@ -269,6 +272,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(134, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(134, 0, 104), /* getDefaultBaseType return */ reg::packed(134, 0, 1603), /* toPhpDocNode return */ + reg::packed(1655, 0, 1664), /* toNativePhpTypeNode $position */ reg::packed(134, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -348,7 +352,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1556 /* exponentiate */, 1, 111, inline constexpr sigtab::Sig getFiniteTypes = { { 1569 /* getFiniteTypes */, 0, 113, 0, 113, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1584 /* getDefaultBaseType */, 0, 114, 0, 114, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1642 /* toPhpDocNode */, 0, 115, 0, 115, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1655 /* hasTemplateOrLateResolvableType */, 0, 116, 0, 116, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1696 /* toNativePhpTypeNode */, 1, 116, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1716 /* hasTemplateOrLateResolvableType */, 0, 117, 0, 117, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::HasOffsetValueType diff --git a/turbo-ext/src/generated/HasPropertyType.h b/turbo-ext/src/generated/HasPropertyType.h index b6f7eccd0fb..f962f9a691f 100644 --- a/turbo-ext/src/generated/HasPropertyType.h +++ b/turbo-ext/src/generated/HasPropertyType.h @@ -110,7 +110,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 948 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 967 */ "toPhpDocNode\0" /* 1006 */ - "hasTemplateOrLateResolvableType"; /* 1019 */ + "position\0" /* 1019 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1028 */ + "toNativePhpTypeNode\0" /* 1060 */ + "hasTemplateOrLateResolvableType"; /* 1080 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $propertyName */ reg::packed(25, MAY_BE_ARRAY), /* getReferencedClasses return */ @@ -176,6 +179,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(25, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(25, 0, 93), /* getDefaultBaseType return */ reg::packed(25, 0, 967), /* toPhpDocNode return */ + reg::packed(1019, 0, 1028), /* toNativePhpTypeNode $position */ reg::packed(25, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -229,7 +233,8 @@ inline constexpr sigtab::Sig exponentiate = { { 920 /* exponentiate */, 1, 59, 1 inline constexpr sigtab::Sig getFiniteTypes = { { 933 /* getFiniteTypes */, 0, 61, 0, 61, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 948 /* getDefaultBaseType */, 0, 62, 0, 62, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1006 /* toPhpDocNode */, 0, 63, 0, 63, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1019 /* hasTemplateOrLateResolvableType */, 0, 64, 0, 64, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1060 /* toNativePhpTypeNode */, 1, 64, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1080 /* hasTemplateOrLateResolvableType */, 0, 65, 0, 65, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::HasPropertyType diff --git a/turbo-ext/src/generated/IntegerType.h b/turbo-ext/src/generated/IntegerType.h index 044cd99f876..6ce2ddc264e 100644 --- a/turbo-ext/src/generated/IntegerType.h +++ b/turbo-ext/src/generated/IntegerType.h @@ -75,7 +75,10 @@ inline constexpr char strings[] = "exponentiate\0" /* 440 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 453 */ "toPhpDocNode\0" /* 492 */ - "hasTemplateOrLateResolvableType"; /* 505 */ + "position\0" /* 505 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 514 */ + "toNativePhpTypeNode\0" /* 546 */ + "hasTemplateOrLateResolvableType"; /* 566 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, 0, 18), /* describe $level */ reg::packed(46, MAY_BE_STRING), /* describe return */ @@ -107,6 +110,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(431, 0, 75), /* exponentiate $exponent */ reg::packed(46, 0, 75), /* exponentiate return */ reg::packed(46, 0, 453), /* toPhpDocNode return */ + reg::packed(505, 0, 514), /* toNativePhpTypeNode $position */ reg::packed(46, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -139,7 +143,8 @@ inline constexpr sigtab::Sig tryRemove = { { 406 /* tryRemove */, 1, 24, 1, 25, inline constexpr sigtab::Sig getFiniteTypes = { { 416 /* getFiniteTypes */, 0, 26, 0, 26, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig exponentiate = { { 440 /* exponentiate */, 1, 27, 1, 28, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 492 /* toPhpDocNode */, 0, 29, 0, 29, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 505 /* hasTemplateOrLateResolvableType */, 0, 30, 0, 30, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 546 /* toNativePhpTypeNode */, 1, 30, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 566 /* hasTemplateOrLateResolvableType */, 0, 31, 0, 31, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::IntegerType diff --git a/turbo-ext/src/generated/IntersectionType.h b/turbo-ext/src/generated/IntersectionType.h index c6c554d6426..f6da2342672 100644 --- a/turbo-ext/src/generated/IntersectionType.h +++ b/turbo-ext/src/generated/IntersectionType.h @@ -282,7 +282,10 @@ inline constexpr char strings[] = "intersectTypesPreserveTemplateType\0" /* 3622 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 3657 */ "toPhpDocNode\0" /* 3696 */ - "hasTemplateOrLateResolvableType"; /* 3709 */ + "position\0" /* 3709 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 3718 */ + "toNativePhpTypeNode\0" /* 3750 */ + "hasTemplateOrLateResolvableType"; /* 3770 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_ARRAY), /* __construct $types */ reg::packed(18, MAY_BE_ARRAY), /* getTypes return */ @@ -535,6 +538,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(3572, MAY_BE_CALLABLE), /* intersectTypesPreserveTemplateType $getType */ reg::packed(18, 0, 56), /* intersectTypesPreserveTemplateType return */ reg::packed(18, 0, 3657), /* toPhpDocNode return */ + reg::packed(3709, 0, 3718), /* toNativePhpTypeNode $position */ reg::packed(18, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -690,7 +694,8 @@ inline constexpr sigtab::Sig intersectTypes = { { 3580 /* intersectTypes */, 1, inline constexpr sigtab::Sig intersectOperands = { { 3604 /* intersectOperands */, 1, 246, 1, 247, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; inline constexpr sigtab::Sig intersectTypesPreserveTemplateType = { { 3622 /* intersectTypesPreserveTemplateType */, 1, 248, 1, 249, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig toPhpDocNode = { { 3696 /* toPhpDocNode */, 0, 250, 0, 250, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3709 /* hasTemplateOrLateResolvableType */, 0, 251, 0, 251, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 3750 /* toNativePhpTypeNode */, 1, 251, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3770 /* hasTemplateOrLateResolvableType */, 0, 252, 0, 252, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::IntersectionType diff --git a/turbo-ext/src/generated/IterableType.h b/turbo-ext/src/generated/IterableType.h index fa921496230..53d8202f93c 100644 --- a/turbo-ext/src/generated/IterableType.h +++ b/turbo-ext/src/generated/IterableType.h @@ -140,7 +140,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 1511 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1526 */ "toPhpDocNode\0" /* 1565 */ - "hasTemplateOrLateResolvableType"; /* 1578 */ + "position\0" /* 1578 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1587 */ + "toNativePhpTypeNode\0" /* 1619 */ + "hasTemplateOrLateResolvableType"; /* 1639 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 8), /* __construct $keyType */ reg::packed(26, 0, 8), /* __construct $itemType */ @@ -234,6 +237,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(47, 0, 8), /* exponentiate return */ reg::packed(47, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(47, 0, 1526), /* toPhpDocNode return */ + reg::packed(1578, 0, 1587), /* toNativePhpTypeNode $position */ reg::packed(47, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -310,7 +314,8 @@ inline constexpr sigtab::Sig tryRemove = { { 1479 /* tryRemove */, 1, 86, 1, 87, inline constexpr sigtab::Sig exponentiate = { { 1498 /* exponentiate */, 1, 88, 1, 89, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 1511 /* getFiniteTypes */, 0, 90, 0, 90, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1565 /* toPhpDocNode */, 0, 91, 0, 91, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1578 /* hasTemplateOrLateResolvableType */, 0, 92, 0, 92, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1619 /* toNativePhpTypeNode */, 1, 92, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1639 /* hasTemplateOrLateResolvableType */, 0, 93, 0, 93, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::IterableType diff --git a/turbo-ext/src/generated/LateResolvableTypeTrait.h b/turbo-ext/src/generated/LateResolvableTypeTrait.h index c7ba88310ae..82ec1a45bc6 100644 --- a/turbo-ext/src/generated/LateResolvableTypeTrait.h +++ b/turbo-ext/src/generated/LateResolvableTypeTrait.h @@ -190,7 +190,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 3065 */ "resolve\0" /* 3080 */ "getResult\0" /* 3088 */ - "hasTemplateOrLateResolvableType"; /* 3098 */ + "position\0" /* 3098 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 3107 */ + "toNativePhpTypeNode\0" /* 3139 */ + "hasTemplateOrLateResolvableType"; /* 3159 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_ARRAY), /* getObjectClassNames return */ reg::packed(0, MAY_BE_ARRAY), /* getObjectClassReflections return */ @@ -402,6 +405,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(0, 0, 99), /* resolve return */ reg::packed(0, 0, 99), /* getResult return */ + reg::packed(3098, 0, 3107), /* toNativePhpTypeNode $position */ reg::packed(0, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -538,7 +542,8 @@ inline constexpr sigtab::Sig exponentiate = { { 3052 /* exponentiate */, 1, 205, inline constexpr sigtab::Sig getFiniteTypes = { { 3065 /* getFiniteTypes */, 0, 207, 0, 207, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig resolve = { { 3080 /* resolve */, 0, 208, 0, 208, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getResult = { { 3088 /* getResult */, 0, 209, 0, 209, ZEND_ACC_PROTECTED | ZEND_ACC_ABSTRACT } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3098 /* hasTemplateOrLateResolvableType */, 0, 210, 0, 210, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 3139 /* toNativePhpTypeNode */, 1, 210, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3159 /* hasTemplateOrLateResolvableType */, 0, 211, 0, 211, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::LateResolvableTypeTrait diff --git a/turbo-ext/src/generated/MixedType.h b/turbo-ext/src/generated/MixedType.h index 78eb7242d2d..b760f482337 100644 --- a/turbo-ext/src/generated/MixedType.h +++ b/turbo-ext/src/generated/MixedType.h @@ -224,7 +224,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 3108 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 3123 */ "toPhpDocNode\0" /* 3162 */ - "hasTemplateOrLateResolvableType"; /* 3175 */ + "position\0" /* 3175 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 3184 */ + "toNativePhpTypeNode\0" /* 3216 */ + "hasTemplateOrLateResolvableType"; /* 3236 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_BOOL, reg::NoString, false, false, 16), /* __construct $isExplicitMixed */ reg::packed(22, MAY_BE_NULL, 37, false, false, 55), /* __construct $subtractedType */ @@ -432,6 +435,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(72, 0, 37), /* exponentiate return */ reg::packed(72, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(72, 0, 3123), /* toPhpDocNode return */ + reg::packed(3175, 0, 3184), /* toNativePhpTypeNode $position */ reg::packed(72, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -569,7 +573,8 @@ inline constexpr sigtab::Sig tryRemove = { { 3076 /* tryRemove */, 1, 200, 1, 20 inline constexpr sigtab::Sig exponentiate = { { 3095 /* exponentiate */, 1, 202, 1, 203, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 3108 /* getFiniteTypes */, 0, 204, 0, 204, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 3162 /* toPhpDocNode */, 0, 205, 0, 205, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3175 /* hasTemplateOrLateResolvableType */, 0, 206, 0, 206, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 3216 /* toNativePhpTypeNode */, 1, 206, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3236 /* hasTemplateOrLateResolvableType */, 0, 207, 0, 207, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::MixedType diff --git a/turbo-ext/src/generated/NeverType.h b/turbo-ext/src/generated/NeverType.h index d65182438cf..5ea65c83d13 100644 --- a/turbo-ext/src/generated/NeverType.h +++ b/turbo-ext/src/generated/NeverType.h @@ -217,7 +217,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 2953 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 2968 */ "toPhpDocNode\0" /* 3007 */ - "hasTemplateOrLateResolvableType"; /* 3020 */ + "position\0" /* 3020 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 3029 */ + "toNativePhpTypeNode\0" /* 3061 */ + "hasTemplateOrLateResolvableType"; /* 3081 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_BOOL, reg::NoString, false, false, 11), /* __construct $isExplicit */ reg::packed(17, MAY_BE_NULL | MAY_BE_STRING, reg::NoString, false, false, 24), /* __construct $reason */ @@ -415,6 +418,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(41, 0, 171), /* exponentiate return */ reg::packed(41, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(41, 0, 2968), /* toPhpDocNode return */ + reg::packed(3020, 0, 3029), /* toNativePhpTypeNode $position */ reg::packed(41, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -546,7 +550,8 @@ inline constexpr sigtab::Sig getEnumCaseObject = { { 2913 /* getEnumCaseObject * inline constexpr sigtab::Sig exponentiate = { { 2940 /* exponentiate */, 1, 192, 1, 193, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 2953 /* getFiniteTypes */, 0, 194, 0, 194, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 3007 /* toPhpDocNode */, 0, 195, 0, 195, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3020 /* hasTemplateOrLateResolvableType */, 0, 196, 0, 196, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 3061 /* toNativePhpTypeNode */, 1, 196, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3081 /* hasTemplateOrLateResolvableType */, 0, 197, 0, 197, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::NeverType diff --git a/turbo-ext/src/generated/NonEmptyArrayType.h b/turbo-ext/src/generated/NonEmptyArrayType.h index 746e4f6599f..543ecac4dc1 100644 --- a/turbo-ext/src/generated/NonEmptyArrayType.h +++ b/turbo-ext/src/generated/NonEmptyArrayType.h @@ -160,7 +160,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1810 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1829 */ "toPhpDocNode\0" /* 1868 */ - "hasTemplateOrLateResolvableType"; /* 1881 */ + "position\0" /* 1881 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1890 */ + "toNativePhpTypeNode\0" /* 1922 */ + "hasTemplateOrLateResolvableType"; /* 1942 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -296,6 +299,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 132), /* getDefaultBaseType return */ reg::packed(12, 0, 1829), /* toPhpDocNode return */ + reg::packed(1881, 0, 1890), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -396,7 +400,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1782 /* exponentiate */, 1, 129, inline constexpr sigtab::Sig getFiniteTypes = { { 1795 /* getFiniteTypes */, 0, 131, 0, 131, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1810 /* getDefaultBaseType */, 0, 132, 0, 132, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1868 /* toPhpDocNode */, 0, 133, 0, 133, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1881 /* hasTemplateOrLateResolvableType */, 0, 134, 0, 134, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1922 /* toNativePhpTypeNode */, 1, 134, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1942 /* hasTemplateOrLateResolvableType */, 0, 135, 0, 135, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::NonEmptyArrayType diff --git a/turbo-ext/src/generated/NonexistentParentClassType.h b/turbo-ext/src/generated/NonexistentParentClassType.h index 9edd53ed4b2..ce54c99d5b4 100644 --- a/turbo-ext/src/generated/NonexistentParentClassType.h +++ b/turbo-ext/src/generated/NonexistentParentClassType.h @@ -113,7 +113,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 1435 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1450 */ "toPhpDocNode\0" /* 1489 */ - "hasTemplateOrLateResolvableType"; /* 1502 */ + "position\0" /* 1502 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1511 */ + "toNativePhpTypeNode\0" /* 1543 */ + "hasTemplateOrLateResolvableType"; /* 1563 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 6), /* describe $level */ reg::packed(34, MAY_BE_STRING), /* describe return */ @@ -193,6 +196,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(34, 0, 79), /* exponentiate return */ reg::packed(34, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(34, 0, 1450), /* toPhpDocNode return */ + reg::packed(1502, 0, 1511), /* toNativePhpTypeNode $position */ reg::packed(34, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -245,7 +249,8 @@ inline constexpr sigtab::Sig getEnumCaseObject = { { 1395 /* getEnumCaseObject * inline constexpr sigtab::Sig exponentiate = { { 1422 /* exponentiate */, 1, 74, 1, 75, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 1435 /* getFiniteTypes */, 0, 76, 0, 76, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1489 /* toPhpDocNode */, 0, 77, 0, 77, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1502 /* hasTemplateOrLateResolvableType */, 0, 78, 0, 78, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1543 /* toNativePhpTypeNode */, 1, 78, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1563 /* hasTemplateOrLateResolvableType */, 0, 79, 0, 79, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::NonexistentParentClassType diff --git a/turbo-ext/src/generated/NullType.h b/turbo-ext/src/generated/NullType.h index 9f031b18700..90b0b540b9e 100644 --- a/turbo-ext/src/generated/NullType.h +++ b/turbo-ext/src/generated/NullType.h @@ -122,7 +122,10 @@ inline constexpr char strings[] = "exponentiate\0" /* 1328 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1341 */ "toPhpDocNode\0" /* 1380 */ - "hasTemplateOrLateResolvableType"; /* 1393 */ + "position\0" /* 1393 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1402 */ + "toNativePhpTypeNode\0" /* 1434 */ + "hasTemplateOrLateResolvableType"; /* 1454 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -215,6 +218,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(1319, 0, 151), /* exponentiate $exponent */ reg::packed(12, 0, 151), /* exponentiate return */ reg::packed(12, 0, 1341), /* toPhpDocNode return */ + reg::packed(1393, 0, 1402), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -285,7 +289,8 @@ inline constexpr sigtab::Sig getGreaterOrEqualType = { { 1282 /* getGreaterOrEqu inline constexpr sigtab::Sig getFiniteTypes = { { 1304 /* getFiniteTypes */, 0, 87, 0, 87, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig exponentiate = { { 1328 /* exponentiate */, 1, 88, 1, 89, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1380 /* toPhpDocNode */, 0, 90, 0, 90, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1393 /* hasTemplateOrLateResolvableType */, 0, 91, 0, 91, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1434 /* toNativePhpTypeNode */, 1, 91, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1454 /* hasTemplateOrLateResolvableType */, 0, 92, 0, 92, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::NullType diff --git a/turbo-ext/src/generated/ObjectShapeType.h b/turbo-ext/src/generated/ObjectShapeType.h index ada5832c858..4d87d106d6f 100644 --- a/turbo-ext/src/generated/ObjectShapeType.h +++ b/turbo-ext/src/generated/ObjectShapeType.h @@ -95,7 +95,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 1091 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1106 */ "toPhpDocNode\0" /* 1145 */ - "hasTemplateOrLateResolvableType"; /* 1158 */ + "position\0" /* 1158 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1167 */ + "toNativePhpTypeNode\0" /* 1199 */ + "hasTemplateOrLateResolvableType"; /* 1219 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_ARRAY), /* __construct $properties */ reg::packed(11, MAY_BE_ARRAY), /* __construct $optionalProperties */ @@ -157,6 +160,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(42, 0, 146), /* exponentiate return */ reg::packed(42, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(42, 0, 1106), /* toPhpDocNode return */ + reg::packed(1158, 0, 1167), /* toNativePhpTypeNode $position */ reg::packed(42, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -195,7 +199,8 @@ inline constexpr sigtab::Sig traverseSimultaneously = { { 1046 /* traverseSimult inline constexpr sigtab::Sig exponentiate = { { 1078 /* exponentiate */, 1, 56, 1, 57, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 1091 /* getFiniteTypes */, 0, 58, 0, 58, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1145 /* toPhpDocNode */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1158 /* hasTemplateOrLateResolvableType */, 0, 60, 0, 60, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1199 /* toNativePhpTypeNode */, 1, 60, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1219 /* hasTemplateOrLateResolvableType */, 0, 61, 0, 61, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ObjectShapeType diff --git a/turbo-ext/src/generated/ObjectType.h b/turbo-ext/src/generated/ObjectType.h index 335f155e289..1e8f8ce5980 100644 --- a/turbo-ext/src/generated/ObjectType.h +++ b/turbo-ext/src/generated/ObjectType.h @@ -230,7 +230,10 @@ inline constexpr char strings[] = "exponentiate\0" /* 2989 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 3002 */ "toPhpDocNode\0" /* 3041 */ - "hasTemplateOrLateResolvableType"; /* 3054 */ + "position\0" /* 3054 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 3063 */ + "toNativePhpTypeNode\0" /* 3095 */ + "hasTemplateOrLateResolvableType"; /* 3115 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_STRING), /* __construct $className */ reg::packed(10, MAY_BE_NULL, 25, false, false, 43), /* __construct $subtractedType */ @@ -407,6 +410,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(2980, 0, 25), /* exponentiate $exponent */ reg::packed(111, 0, 25), /* exponentiate return */ reg::packed(111, 0, 3002), /* toPhpDocNode return */ + reg::packed(3054, 0, 3063), /* toNativePhpTypeNode $position */ reg::packed(111, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -530,7 +534,8 @@ inline constexpr sigtab::Sig tryRemove = { { 2955 /* tryRemove */, 1, 169, 1, 17 inline constexpr sigtab::Sig getFiniteTypes = { { 2965 /* getFiniteTypes */, 0, 171, 0, 171, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig exponentiate = { { 2989 /* exponentiate */, 1, 172, 1, 173, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 3041 /* toPhpDocNode */, 0, 174, 0, 174, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3054 /* hasTemplateOrLateResolvableType */, 0, 175, 0, 175, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 3095 /* toNativePhpTypeNode */, 1, 175, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3115 /* hasTemplateOrLateResolvableType */, 0, 176, 0, 176, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ObjectType diff --git a/turbo-ext/src/generated/ObjectWithoutClassType.h b/turbo-ext/src/generated/ObjectWithoutClassType.h index 2aba991ee62..ccfc39a9f11 100644 --- a/turbo-ext/src/generated/ObjectWithoutClassType.h +++ b/turbo-ext/src/generated/ObjectWithoutClassType.h @@ -74,7 +74,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 517 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 532 */ "toPhpDocNode\0" /* 571 */ - "hasTemplateOrLateResolvableType"; /* 584 */ + "position\0" /* 584 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 593 */ + "toNativePhpTypeNode\0" /* 625 */ + "hasTemplateOrLateResolvableType"; /* 645 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_NULL, 15, false, false, 33), /* __construct $subtractedType */ reg::packed(50, MAY_BE_ARRAY), /* getReferencedClasses return */ @@ -109,6 +112,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(50, 0, 15), /* exponentiate return */ reg::packed(50, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(50, 0, 532), /* toPhpDocNode return */ + reg::packed(584, 0, 593), /* toNativePhpTypeNode $position */ reg::packed(50, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -137,7 +141,8 @@ inline constexpr sigtab::Sig tryRemove = { { 485 /* tryRemove */, 1, 27, 1, 28, inline constexpr sigtab::Sig exponentiate = { { 504 /* exponentiate */, 1, 29, 1, 30, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 517 /* getFiniteTypes */, 0, 31, 0, 31, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 571 /* toPhpDocNode */, 0, 32, 0, 32, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 584 /* hasTemplateOrLateResolvableType */, 0, 33, 0, 33, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 625 /* toNativePhpTypeNode */, 1, 33, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 645 /* hasTemplateOrLateResolvableType */, 0, 34, 0, 34, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ObjectWithoutClassType diff --git a/turbo-ext/src/generated/OversizedArrayType.h b/turbo-ext/src/generated/OversizedArrayType.h index b41c268ff9e..63d4d58659e 100644 --- a/turbo-ext/src/generated/OversizedArrayType.h +++ b/turbo-ext/src/generated/OversizedArrayType.h @@ -160,7 +160,10 @@ inline constexpr char strings[] = "getDefaultBaseType\0" /* 1820 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 1839 */ "toPhpDocNode\0" /* 1878 */ - "hasTemplateOrLateResolvableType"; /* 1891 */ + "position\0" /* 1891 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 1900 */ + "toNativePhpTypeNode\0" /* 1932 */ + "hasTemplateOrLateResolvableType"; /* 1952 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -297,6 +300,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 132), /* getDefaultBaseType return */ reg::packed(12, 0, 1839), /* toPhpDocNode return */ + reg::packed(1891, 0, 1900), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -398,7 +402,8 @@ inline constexpr sigtab::Sig exponentiate = { { 1792 /* exponentiate */, 1, 130, inline constexpr sigtab::Sig getFiniteTypes = { { 1805 /* getFiniteTypes */, 0, 132, 0, 132, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getDefaultBaseType = { { 1820 /* getDefaultBaseType */, 0, 133, 0, 133, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 1878 /* toPhpDocNode */, 0, 134, 0, 134, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1891 /* hasTemplateOrLateResolvableType */, 0, 135, 0, 135, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1932 /* toNativePhpTypeNode */, 1, 135, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1952 /* hasTemplateOrLateResolvableType */, 0, 136, 0, 136, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::OversizedArrayType diff --git a/turbo-ext/src/generated/ResourceType.h b/turbo-ext/src/generated/ResourceType.h index 57c22254fb7..916331eb7d9 100644 --- a/turbo-ext/src/generated/ResourceType.h +++ b/turbo-ext/src/generated/ResourceType.h @@ -68,7 +68,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 365 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 380 */ "toPhpDocNode\0" /* 419 */ - "hasTemplateOrLateResolvableType"; /* 432 */ + "position\0" /* 432 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 441 */ + "toNativePhpTypeNode\0" /* 473 */ + "hasTemplateOrLateResolvableType"; /* 493 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, 0, 18), /* describe $level */ reg::packed(46, MAY_BE_STRING), /* describe return */ @@ -92,6 +95,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(46, 0, 75), /* exponentiate return */ reg::packed(46, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(46, 0, 380), /* toPhpDocNode return */ + reg::packed(432, 0, 441), /* toNativePhpTypeNode $position */ reg::packed(46, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -117,7 +121,8 @@ inline constexpr sigtab::Sig looseCompare = { { 330 /* looseCompare */, 2, 15, 2 inline constexpr sigtab::Sig exponentiate = { { 352 /* exponentiate */, 1, 18, 1, 19, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 365 /* getFiniteTypes */, 0, 20, 0, 20, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 419 /* toPhpDocNode */, 0, 21, 0, 21, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 432 /* hasTemplateOrLateResolvableType */, 0, 22, 0, 22, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 473 /* toNativePhpTypeNode */, 1, 22, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 493 /* hasTemplateOrLateResolvableType */, 0, 23, 0, 23, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::ResourceType diff --git a/turbo-ext/src/generated/StaticType.h b/turbo-ext/src/generated/StaticType.h index ed1b968ebe9..a0a6cd7e894 100644 --- a/turbo-ext/src/generated/StaticType.h +++ b/turbo-ext/src/generated/StaticType.h @@ -232,7 +232,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 3248 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 3263 */ "toPhpDocNode\0" /* 3302 */ - "hasTemplateOrLateResolvableType"; /* 3315 */ + "position\0" /* 3315 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 3324 */ + "toNativePhpTypeNode\0" /* 3356 */ + "hasTemplateOrLateResolvableType"; /* 3376 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 16), /* __construct $classReflection */ reg::packed(51, MAY_BE_NULL, 66, false, false, 84), /* __construct $subtractedType */ @@ -442,6 +445,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(101, 0, 66), /* exponentiate return */ reg::packed(101, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(101, 0, 3263), /* toPhpDocNode return */ + reg::packed(3315, 0, 3324), /* toNativePhpTypeNode $position */ reg::packed(101, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -581,7 +585,8 @@ inline constexpr sigtab::Sig tryRemove = { { 3216 /* tryRemove */, 1, 202, 1, 20 inline constexpr sigtab::Sig exponentiate = { { 3235 /* exponentiate */, 1, 204, 1, 205, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 3248 /* getFiniteTypes */, 0, 206, 0, 206, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 3302 /* toPhpDocNode */, 0, 207, 0, 207, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3315 /* hasTemplateOrLateResolvableType */, 0, 208, 0, 208, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 3356 /* toNativePhpTypeNode */, 1, 208, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3376 /* hasTemplateOrLateResolvableType */, 0, 209, 0, 209, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::StaticType diff --git a/turbo-ext/src/generated/StrictMixedType.h b/turbo-ext/src/generated/StrictMixedType.h index 2f5bed43c1c..e63d423ce32 100644 --- a/turbo-ext/src/generated/StrictMixedType.h +++ b/turbo-ext/src/generated/StrictMixedType.h @@ -170,7 +170,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 2466 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 2481 */ "toPhpDocNode\0" /* 2520 */ - "hasTemplateOrLateResolvableType"; /* 2533 */ + "position\0" /* 2533 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 2542 */ + "toNativePhpTypeNode\0" /* 2574 */ + "hasTemplateOrLateResolvableType"; /* 2594 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(0, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -318,6 +321,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 92), /* exponentiate return */ reg::packed(0, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(0, 0, 2481), /* toPhpDocNode return */ + reg::packed(2533, 0, 2542), /* toNativePhpTypeNode $position */ reg::packed(0, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -417,7 +421,8 @@ inline constexpr sigtab::Sig traverseSimultaneously = { { 2421 /* traverseSimult inline constexpr sigtab::Sig exponentiate = { { 2453 /* exponentiate */, 1, 142, 1, 143, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 2466 /* getFiniteTypes */, 0, 144, 0, 144, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 2520 /* toPhpDocNode */, 0, 145, 0, 145, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 2533 /* hasTemplateOrLateResolvableType */, 0, 146, 0, 146, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 2574 /* toNativePhpTypeNode */, 1, 146, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 2594 /* hasTemplateOrLateResolvableType */, 0, 147, 0, 147, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::StrictMixedType diff --git a/turbo-ext/src/generated/StringType.h b/turbo-ext/src/generated/StringType.h index 179e93dd8d3..920faf2ff4f 100644 --- a/turbo-ext/src/generated/StringType.h +++ b/turbo-ext/src/generated/StringType.h @@ -99,7 +99,10 @@ inline constexpr char strings[] = "exponentiate\0" /* 859 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 872 */ "toPhpDocNode\0" /* 911 */ - "hasTemplateOrLateResolvableType"; /* 924 */ + "position\0" /* 924 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 933 */ + "toNativePhpTypeNode\0" /* 965 */ + "hasTemplateOrLateResolvableType"; /* 985 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, 0, 18), /* describe $level */ reg::packed(46, MAY_BE_STRING), /* describe return */ @@ -161,6 +164,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(850, 0, 146), /* exponentiate $exponent */ reg::packed(46, 0, 146), /* exponentiate return */ reg::packed(46, 0, 872), /* toPhpDocNode return */ + reg::packed(924, 0, 933), /* toNativePhpTypeNode $position */ reg::packed(46, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -212,7 +216,8 @@ inline constexpr sigtab::Sig tryRemove = { { 825 /* tryRemove */, 1, 54, 1, 55, inline constexpr sigtab::Sig getFiniteTypes = { { 835 /* getFiniteTypes */, 0, 56, 0, 56, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig exponentiate = { { 859 /* exponentiate */, 1, 57, 1, 58, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 911 /* toPhpDocNode */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 924 /* hasTemplateOrLateResolvableType */, 0, 60, 0, 60, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 965 /* toNativePhpTypeNode */, 1, 60, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 985 /* hasTemplateOrLateResolvableType */, 0, 61, 0, 61, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::StringType diff --git a/turbo-ext/src/generated/UnionType.h b/turbo-ext/src/generated/UnionType.h index cc157505236..a75507d1bd2 100644 --- a/turbo-ext/src/generated/UnionType.h +++ b/turbo-ext/src/generated/UnionType.h @@ -268,8 +268,11 @@ inline constexpr char strings[] = "pickFromTypes\0" /* 3694 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 3708 */ "toPhpDocNode\0" /* 3747 */ - "notBenevolentPickFromTypes\0" /* 3760 */ - "hasTemplateOrLateResolvableType"; /* 3787 */ + "position\0" /* 3760 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 3769 */ + "toNativePhpTypeNode\0" /* 3801 */ + "notBenevolentPickFromTypes\0" /* 3821 */ + "hasTemplateOrLateResolvableType"; /* 3848 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, MAY_BE_ARRAY), /* __construct $types */ reg::packed(6, MAY_BE_BOOL, reg::NoString, false, false, 17), /* __construct $normalized */ @@ -522,6 +525,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(3685, MAY_BE_CALLABLE), /* pickFromTypes $criteria */ reg::packed(35, MAY_BE_ARRAY), /* pickFromTypes return */ reg::packed(35, 0, 3708), /* toPhpDocNode return */ + reg::packed(3760, 0, 3769), /* toNativePhpTypeNode $position */ reg::packed(3675, MAY_BE_CALLABLE), /* notBenevolentPickFromTypes $getValues */ reg::packed(35, MAY_BE_ARRAY), /* notBenevolentPickFromTypes return */ reg::packed(35, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ @@ -680,8 +684,9 @@ inline constexpr sigtab::Sig notBenevolentUnionResults = { { 3630 /* notBenevole inline constexpr sigtab::Sig unionTypes = { { 3664 /* unionTypes */, 1, 245, 1, 246, ZEND_ACC_PROTECTED } }; inline constexpr sigtab::Sig pickFromTypes = { { 3694 /* pickFromTypes */, 2, 247, 2, 249, ZEND_ACC_PROTECTED } }; inline constexpr sigtab::Sig toPhpDocNode = { { 3747 /* toPhpDocNode */, 0, 250, 0, 250, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig notBenevolentPickFromTypes = { { 3760 /* notBenevolentPickFromTypes */, 1, 251, 1, 252, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3787 /* hasTemplateOrLateResolvableType */, 0, 253, 0, 253, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 3801 /* toNativePhpTypeNode */, 1, 251, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig notBenevolentPickFromTypes = { { 3821 /* notBenevolentPickFromTypes */, 1, 252, 1, 253, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 3848 /* hasTemplateOrLateResolvableType */, 0, 254, 0, 254, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::UnionType diff --git a/turbo-ext/src/generated/UnresolvedTemplateArgumentType.h b/turbo-ext/src/generated/UnresolvedTemplateArgumentType.h index a0505c879a2..d07db6cc91f 100644 --- a/turbo-ext/src/generated/UnresolvedTemplateArgumentType.h +++ b/turbo-ext/src/generated/UnresolvedTemplateArgumentType.h @@ -84,165 +84,168 @@ inline constexpr char strings[] = "hasTemplateOrLateResolvableType\0" /* 766 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 798 */ "toPhpDocNode\0" /* 837 */ - "getReferencedClasses\0" /* 850 */ - "getObjectClassNames\0" /* 871 */ - "getObjectClassReflections\0" /* 891 */ - "getClassStringType\0" /* 917 */ - "getClassStringObjectType\0" /* 936 */ - "getObjectTypeOrClassStringObjectType\0" /* 961 */ - "isObject\0" /* 998 */ - "isEnum\0" /* 1007 */ - "getArrays\0" /* 1014 */ - "getConstantArrays\0" /* 1024 */ - "getConstantStrings\0" /* 1042 */ - "canAccessProperties\0" /* 1061 */ - "propertyName\0" /* 1081 */ - "hasProperty\0" /* 1094 */ - "scope\0" /* 1106 */ - "PHPStan\\Reflection\\ClassMemberAccessAnswerer\0" /* 1112 */ - "PHPStan\\Reflection\\ExtendedPropertyReflection\0" /* 1157 */ - "getProperty\0" /* 1203 */ - "PHPStan\\Reflection\\Type\\UnresolvedPropertyPrototypeReflection\0" /* 1215 */ - "getUnresolvedPropertyPrototype\0" /* 1277 */ - "hasInstanceProperty\0" /* 1308 */ - "getInstanceProperty\0" /* 1328 */ - "getUnresolvedInstancePropertyPrototype\0" /* 1348 */ - "hasStaticProperty\0" /* 1387 */ - "getStaticProperty\0" /* 1405 */ - "getUnresolvedStaticPropertyPrototype\0" /* 1423 */ - "canCallMethods\0" /* 1460 */ - "methodName\0" /* 1475 */ - "hasMethod\0" /* 1486 */ - "PHPStan\\Reflection\\ExtendedMethodReflection\0" /* 1496 */ - "getMethod\0" /* 1540 */ - "PHPStan\\Reflection\\Type\\UnresolvedMethodPrototypeReflection\0" /* 1550 */ - "getUnresolvedMethodPrototype\0" /* 1610 */ - "canAccessConstants\0" /* 1639 */ - "constantName\0" /* 1658 */ - "hasConstant\0" /* 1671 */ - "PHPStan\\Reflection\\ClassConstantReflection\0" /* 1683 */ - "getConstant\0" /* 1726 */ - "isIterable\0" /* 1738 */ - "isIterableAtLeastOnce\0" /* 1749 */ - "getArraySize\0" /* 1771 */ - "getIterableKeyType\0" /* 1784 */ - "getFirstIterableKeyType\0" /* 1803 */ - "getLastIterableKeyType\0" /* 1827 */ - "getIterableValueType\0" /* 1850 */ - "getFirstIterableValueType\0" /* 1871 */ - "getLastIterableValueType\0" /* 1897 */ - "isArray\0" /* 1922 */ - "isConstantArray\0" /* 1930 */ - "isOversizedArray\0" /* 1946 */ - "isList\0" /* 1963 */ - "isOffsetAccessible\0" /* 1970 */ - "isOffsetAccessLegal\0" /* 1989 */ - "offsetType\0" /* 2009 */ - "hasOffsetValueType\0" /* 2020 */ - "getOffsetValueType\0" /* 2039 */ - "valueType\0" /* 2058 */ - "unionValues\0" /* 2068 */ - "true\0" /* 2080 */ - "setOffsetValueType\0" /* 2085 */ - "setExistingOffsetValueType\0" /* 2104 */ - "unsetOffset\0" /* 2131 */ - "filterValueType\0" /* 2143 */ - "strict\0" /* 2159 */ - "getKeysArrayFiltered\0" /* 2166 */ - "getKeysArray\0" /* 2187 */ - "getValuesArray\0" /* 2200 */ - "lengthType\0" /* 2215 */ - "preserveKeys\0" /* 2226 */ - "chunkArray\0" /* 2239 */ - "fillKeysArray\0" /* 2250 */ - "flipArray\0" /* 2264 */ - "otherArraysType\0" /* 2274 */ - "intersectKeyArray\0" /* 2290 */ - "popArray\0" /* 2308 */ - "reverseArray\0" /* 2317 */ - "needleType\0" /* 2330 */ - "null\0" /* 2341 */ - "searchArray\0" /* 2346 */ - "shiftArray\0" /* 2358 */ - "shuffleArray\0" /* 2369 */ - "sliceArray\0" /* 2382 */ - "replacementType\0" /* 2393 */ - "spliceArray\0" /* 2409 */ - "sizeType\0" /* 2421 */ - "truncateListToSize\0" /* 2430 */ - "makeListMaybe\0" /* 2449 */ - "mapValueType\0" /* 2463 */ - "mapKeyType\0" /* 2476 */ - "makeAllArrayKeysOptional\0" /* 2487 */ - "case\0" /* 2512 */ - "changeKeyCaseArray\0" /* 2517 */ - "filterArrayRemovingFalsey\0" /* 2536 */ - "getEnumCases\0" /* 2562 */ - "PHPStan\\Type\\Enum\\EnumCaseObjectType\0" /* 2575 */ - "getEnumCaseObject\0" /* 2612 */ - "getFiniteTypes\0" /* 2630 */ - "exponent\0" /* 2645 */ - "exponentiate\0" /* 2654 */ - "isCallable\0" /* 2667 */ - "getCallableParametersAcceptors\0" /* 2678 */ - "isCloneable\0" /* 2709 */ - "PHPStan\\Type\\BooleanType\0" /* 2721 */ - "toBoolean\0" /* 2746 */ - "toNumber\0" /* 2756 */ - "toBitwiseNotType\0" /* 2765 */ - "toGetClassResultType\0" /* 2782 */ - "reflectionProvider\0" /* 2803 */ - "PHPStan\\Reflection\\ReflectionProvider\0" /* 2822 */ - "toClassConstantType\0" /* 2860 */ - "PHPStan\\Type\\ClassNameToObjectTypeResult\0" /* 2880 */ - "toObjectTypeForInstanceofCheck\0" /* 2921 */ - "objectOrClassType\0" /* 2952 */ - "allowString\0" /* 2970 */ - "allowSameClass\0" /* 2982 */ - "toObjectTypeForIsACheck\0" /* 2997 */ - "toInteger\0" /* 3021 */ - "toFloat\0" /* 3031 */ - "toString\0" /* 3039 */ - "toArray\0" /* 3048 */ - "toArrayKey\0" /* 3056 */ - "isSmallerThan\0" /* 3067 */ - "isSmallerThanOrEqual\0" /* 3081 */ - "isConstantValue\0" /* 3102 */ - "isConstantScalarValue\0" /* 3118 */ - "getConstantScalarTypes\0" /* 3140 */ - "getConstantScalarValues\0" /* 3163 */ - "isNull\0" /* 3187 */ - "isTrue\0" /* 3194 */ - "isFalse\0" /* 3201 */ - "isBoolean\0" /* 3209 */ - "isFloat\0" /* 3219 */ - "isInteger\0" /* 3227 */ - "isString\0" /* 3237 */ - "isNumericString\0" /* 3246 */ - "isDecimalIntegerString\0" /* 3262 */ - "isNonEmptyString\0" /* 3285 */ - "isNonFalsyString\0" /* 3302 */ - "isLiteralString\0" /* 3319 */ - "isLowercaseString\0" /* 3335 */ - "isUppercaseString\0" /* 3353 */ - "isClassString\0" /* 3371 */ - "isVoid\0" /* 3385 */ - "isScalar\0" /* 3392 */ - "looseCompare\0" /* 3401 */ - "getSmallerType\0" /* 3414 */ - "getSmallerOrEqualType\0" /* 3429 */ - "getGreaterType\0" /* 3451 */ - "getGreaterOrEqualType\0" /* 3466 */ - "ancestorClassName\0" /* 3488 */ - "templateTypeName\0" /* 3506 */ - "getTemplateType\0" /* 3523 */ - "receivedType\0" /* 3539 */ - "PHPStan\\Type\\Generic\\TemplateTypeMap\0" /* 3552 */ - "inferTemplateTypes\0" /* 3589 */ - "positionVariance\0" /* 3608 */ - "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 3625 */ - "getReferencedTemplateTypes\0" /* 3667 */ - "toAbsoluteNumber"; /* 3694 */ + "position\0" /* 850 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 859 */ + "toNativePhpTypeNode\0" /* 891 */ + "getReferencedClasses\0" /* 911 */ + "getObjectClassNames\0" /* 932 */ + "getObjectClassReflections\0" /* 952 */ + "getClassStringType\0" /* 978 */ + "getClassStringObjectType\0" /* 997 */ + "getObjectTypeOrClassStringObjectType\0" /* 1022 */ + "isObject\0" /* 1059 */ + "isEnum\0" /* 1068 */ + "getArrays\0" /* 1075 */ + "getConstantArrays\0" /* 1085 */ + "getConstantStrings\0" /* 1103 */ + "canAccessProperties\0" /* 1122 */ + "propertyName\0" /* 1142 */ + "hasProperty\0" /* 1155 */ + "scope\0" /* 1167 */ + "PHPStan\\Reflection\\ClassMemberAccessAnswerer\0" /* 1173 */ + "PHPStan\\Reflection\\ExtendedPropertyReflection\0" /* 1218 */ + "getProperty\0" /* 1264 */ + "PHPStan\\Reflection\\Type\\UnresolvedPropertyPrototypeReflection\0" /* 1276 */ + "getUnresolvedPropertyPrototype\0" /* 1338 */ + "hasInstanceProperty\0" /* 1369 */ + "getInstanceProperty\0" /* 1389 */ + "getUnresolvedInstancePropertyPrototype\0" /* 1409 */ + "hasStaticProperty\0" /* 1448 */ + "getStaticProperty\0" /* 1466 */ + "getUnresolvedStaticPropertyPrototype\0" /* 1484 */ + "canCallMethods\0" /* 1521 */ + "methodName\0" /* 1536 */ + "hasMethod\0" /* 1547 */ + "PHPStan\\Reflection\\ExtendedMethodReflection\0" /* 1557 */ + "getMethod\0" /* 1601 */ + "PHPStan\\Reflection\\Type\\UnresolvedMethodPrototypeReflection\0" /* 1611 */ + "getUnresolvedMethodPrototype\0" /* 1671 */ + "canAccessConstants\0" /* 1700 */ + "constantName\0" /* 1719 */ + "hasConstant\0" /* 1732 */ + "PHPStan\\Reflection\\ClassConstantReflection\0" /* 1744 */ + "getConstant\0" /* 1787 */ + "isIterable\0" /* 1799 */ + "isIterableAtLeastOnce\0" /* 1810 */ + "getArraySize\0" /* 1832 */ + "getIterableKeyType\0" /* 1845 */ + "getFirstIterableKeyType\0" /* 1864 */ + "getLastIterableKeyType\0" /* 1888 */ + "getIterableValueType\0" /* 1911 */ + "getFirstIterableValueType\0" /* 1932 */ + "getLastIterableValueType\0" /* 1958 */ + "isArray\0" /* 1983 */ + "isConstantArray\0" /* 1991 */ + "isOversizedArray\0" /* 2007 */ + "isList\0" /* 2024 */ + "isOffsetAccessible\0" /* 2031 */ + "isOffsetAccessLegal\0" /* 2050 */ + "offsetType\0" /* 2070 */ + "hasOffsetValueType\0" /* 2081 */ + "getOffsetValueType\0" /* 2100 */ + "valueType\0" /* 2119 */ + "unionValues\0" /* 2129 */ + "true\0" /* 2141 */ + "setOffsetValueType\0" /* 2146 */ + "setExistingOffsetValueType\0" /* 2165 */ + "unsetOffset\0" /* 2192 */ + "filterValueType\0" /* 2204 */ + "strict\0" /* 2220 */ + "getKeysArrayFiltered\0" /* 2227 */ + "getKeysArray\0" /* 2248 */ + "getValuesArray\0" /* 2261 */ + "lengthType\0" /* 2276 */ + "preserveKeys\0" /* 2287 */ + "chunkArray\0" /* 2300 */ + "fillKeysArray\0" /* 2311 */ + "flipArray\0" /* 2325 */ + "otherArraysType\0" /* 2335 */ + "intersectKeyArray\0" /* 2351 */ + "popArray\0" /* 2369 */ + "reverseArray\0" /* 2378 */ + "needleType\0" /* 2391 */ + "null\0" /* 2402 */ + "searchArray\0" /* 2407 */ + "shiftArray\0" /* 2419 */ + "shuffleArray\0" /* 2430 */ + "sliceArray\0" /* 2443 */ + "replacementType\0" /* 2454 */ + "spliceArray\0" /* 2470 */ + "sizeType\0" /* 2482 */ + "truncateListToSize\0" /* 2491 */ + "makeListMaybe\0" /* 2510 */ + "mapValueType\0" /* 2524 */ + "mapKeyType\0" /* 2537 */ + "makeAllArrayKeysOptional\0" /* 2548 */ + "case\0" /* 2573 */ + "changeKeyCaseArray\0" /* 2578 */ + "filterArrayRemovingFalsey\0" /* 2597 */ + "getEnumCases\0" /* 2623 */ + "PHPStan\\Type\\Enum\\EnumCaseObjectType\0" /* 2636 */ + "getEnumCaseObject\0" /* 2673 */ + "getFiniteTypes\0" /* 2691 */ + "exponent\0" /* 2706 */ + "exponentiate\0" /* 2715 */ + "isCallable\0" /* 2728 */ + "getCallableParametersAcceptors\0" /* 2739 */ + "isCloneable\0" /* 2770 */ + "PHPStan\\Type\\BooleanType\0" /* 2782 */ + "toBoolean\0" /* 2807 */ + "toNumber\0" /* 2817 */ + "toBitwiseNotType\0" /* 2826 */ + "toGetClassResultType\0" /* 2843 */ + "reflectionProvider\0" /* 2864 */ + "PHPStan\\Reflection\\ReflectionProvider\0" /* 2883 */ + "toClassConstantType\0" /* 2921 */ + "PHPStan\\Type\\ClassNameToObjectTypeResult\0" /* 2941 */ + "toObjectTypeForInstanceofCheck\0" /* 2982 */ + "objectOrClassType\0" /* 3013 */ + "allowString\0" /* 3031 */ + "allowSameClass\0" /* 3043 */ + "toObjectTypeForIsACheck\0" /* 3058 */ + "toInteger\0" /* 3082 */ + "toFloat\0" /* 3092 */ + "toString\0" /* 3100 */ + "toArray\0" /* 3109 */ + "toArrayKey\0" /* 3117 */ + "isSmallerThan\0" /* 3128 */ + "isSmallerThanOrEqual\0" /* 3142 */ + "isConstantValue\0" /* 3163 */ + "isConstantScalarValue\0" /* 3179 */ + "getConstantScalarTypes\0" /* 3201 */ + "getConstantScalarValues\0" /* 3224 */ + "isNull\0" /* 3248 */ + "isTrue\0" /* 3255 */ + "isFalse\0" /* 3262 */ + "isBoolean\0" /* 3270 */ + "isFloat\0" /* 3280 */ + "isInteger\0" /* 3288 */ + "isString\0" /* 3298 */ + "isNumericString\0" /* 3307 */ + "isDecimalIntegerString\0" /* 3323 */ + "isNonEmptyString\0" /* 3346 */ + "isNonFalsyString\0" /* 3363 */ + "isLiteralString\0" /* 3380 */ + "isLowercaseString\0" /* 3396 */ + "isUppercaseString\0" /* 3414 */ + "isClassString\0" /* 3432 */ + "isVoid\0" /* 3446 */ + "isScalar\0" /* 3453 */ + "looseCompare\0" /* 3462 */ + "getSmallerType\0" /* 3475 */ + "getSmallerOrEqualType\0" /* 3490 */ + "getGreaterType\0" /* 3512 */ + "getGreaterOrEqualType\0" /* 3527 */ + "ancestorClassName\0" /* 3549 */ + "templateTypeName\0" /* 3567 */ + "getTemplateType\0" /* 3584 */ + "receivedType\0" /* 3600 */ + "PHPStan\\Type\\Generic\\TemplateTypeMap\0" /* 3613 */ + "inferTemplateTypes\0" /* 3650 */ + "positionVariance\0" /* 3669 */ + "PHPStan\\Type\\Generic\\TemplateTypeVariance\0" /* 3686 */ + "getReferencedTemplateTypes\0" /* 3728 */ + "toAbsoluteNumber"; /* 3755 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 5), /* __construct $site */ reg::packed(25, 0, 38), /* __construct $templateType */ @@ -297,6 +300,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(114, 0, 84), /* toCoercedArgumentType return */ reg::packed(114, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ reg::packed(114, 0, 798), /* toPhpDocNode return */ + reg::packed(850, 0, 859), /* toNativePhpTypeNode $position */ reg::packed(114, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(114, MAY_BE_ARRAY), /* getObjectClassNames return */ reg::packed(114, MAY_BE_ARRAY), /* getObjectClassReflections return */ @@ -309,44 +313,44 @@ inline constexpr reg::PackedArg args[] = { reg::packed(114, MAY_BE_ARRAY), /* getConstantArrays return */ reg::packed(114, MAY_BE_ARRAY), /* getConstantStrings return */ reg::packed(114, 0, 570), /* canAccessProperties return */ - reg::packed(1081, MAY_BE_STRING), /* hasProperty $propertyName */ + reg::packed(1142, MAY_BE_STRING), /* hasProperty $propertyName */ reg::packed(114, 0, 570), /* hasProperty return */ - reg::packed(1081, MAY_BE_STRING), /* getProperty $propertyName */ - reg::packed(1106, 0, 1112), /* getProperty $scope */ - reg::packed(114, 0, 1157), /* getProperty return */ - reg::packed(1081, MAY_BE_STRING), /* getUnresolvedPropertyPrototype $propertyName */ - reg::packed(1106, 0, 1112), /* getUnresolvedPropertyPrototype $scope */ - reg::packed(114, 0, 1215), /* getUnresolvedPropertyPrototype return */ - reg::packed(1081, MAY_BE_STRING), /* hasInstanceProperty $propertyName */ + reg::packed(1142, MAY_BE_STRING), /* getProperty $propertyName */ + reg::packed(1167, 0, 1173), /* getProperty $scope */ + reg::packed(114, 0, 1218), /* getProperty return */ + reg::packed(1142, MAY_BE_STRING), /* getUnresolvedPropertyPrototype $propertyName */ + reg::packed(1167, 0, 1173), /* getUnresolvedPropertyPrototype $scope */ + reg::packed(114, 0, 1276), /* getUnresolvedPropertyPrototype return */ + reg::packed(1142, MAY_BE_STRING), /* hasInstanceProperty $propertyName */ reg::packed(114, 0, 570), /* hasInstanceProperty return */ - reg::packed(1081, MAY_BE_STRING), /* getInstanceProperty $propertyName */ - reg::packed(1106, 0, 1112), /* getInstanceProperty $scope */ - reg::packed(114, 0, 1157), /* getInstanceProperty return */ - reg::packed(1081, MAY_BE_STRING), /* getUnresolvedInstancePropertyPrototype $propertyName */ - reg::packed(1106, 0, 1112), /* getUnresolvedInstancePropertyPrototype $scope */ - reg::packed(114, 0, 1215), /* getUnresolvedInstancePropertyPrototype return */ - reg::packed(1081, MAY_BE_STRING), /* hasStaticProperty $propertyName */ + reg::packed(1142, MAY_BE_STRING), /* getInstanceProperty $propertyName */ + reg::packed(1167, 0, 1173), /* getInstanceProperty $scope */ + reg::packed(114, 0, 1218), /* getInstanceProperty return */ + reg::packed(1142, MAY_BE_STRING), /* getUnresolvedInstancePropertyPrototype $propertyName */ + reg::packed(1167, 0, 1173), /* getUnresolvedInstancePropertyPrototype $scope */ + reg::packed(114, 0, 1276), /* getUnresolvedInstancePropertyPrototype return */ + reg::packed(1142, MAY_BE_STRING), /* hasStaticProperty $propertyName */ reg::packed(114, 0, 570), /* hasStaticProperty return */ - reg::packed(1081, MAY_BE_STRING), /* getStaticProperty $propertyName */ - reg::packed(1106, 0, 1112), /* getStaticProperty $scope */ - reg::packed(114, 0, 1157), /* getStaticProperty return */ - reg::packed(1081, MAY_BE_STRING), /* getUnresolvedStaticPropertyPrototype $propertyName */ - reg::packed(1106, 0, 1112), /* getUnresolvedStaticPropertyPrototype $scope */ - reg::packed(114, 0, 1215), /* getUnresolvedStaticPropertyPrototype return */ + reg::packed(1142, MAY_BE_STRING), /* getStaticProperty $propertyName */ + reg::packed(1167, 0, 1173), /* getStaticProperty $scope */ + reg::packed(114, 0, 1218), /* getStaticProperty return */ + reg::packed(1142, MAY_BE_STRING), /* getUnresolvedStaticPropertyPrototype $propertyName */ + reg::packed(1167, 0, 1173), /* getUnresolvedStaticPropertyPrototype $scope */ + reg::packed(114, 0, 1276), /* getUnresolvedStaticPropertyPrototype return */ reg::packed(114, 0, 570), /* canCallMethods return */ - reg::packed(1475, MAY_BE_STRING), /* hasMethod $methodName */ + reg::packed(1536, MAY_BE_STRING), /* hasMethod $methodName */ reg::packed(114, 0, 570), /* hasMethod return */ - reg::packed(1475, MAY_BE_STRING), /* getMethod $methodName */ - reg::packed(1106, 0, 1112), /* getMethod $scope */ - reg::packed(114, 0, 1496), /* getMethod return */ - reg::packed(1475, MAY_BE_STRING), /* getUnresolvedMethodPrototype $methodName */ - reg::packed(1106, 0, 1112), /* getUnresolvedMethodPrototype $scope */ - reg::packed(114, 0, 1550), /* getUnresolvedMethodPrototype return */ + reg::packed(1536, MAY_BE_STRING), /* getMethod $methodName */ + reg::packed(1167, 0, 1173), /* getMethod $scope */ + reg::packed(114, 0, 1557), /* getMethod return */ + reg::packed(1536, MAY_BE_STRING), /* getUnresolvedMethodPrototype $methodName */ + reg::packed(1167, 0, 1173), /* getUnresolvedMethodPrototype $scope */ + reg::packed(114, 0, 1611), /* getUnresolvedMethodPrototype return */ reg::packed(114, 0, 570), /* canAccessConstants return */ - reg::packed(1658, MAY_BE_STRING), /* hasConstant $constantName */ + reg::packed(1719, MAY_BE_STRING), /* hasConstant $constantName */ reg::packed(114, 0, 570), /* hasConstant return */ - reg::packed(1658, MAY_BE_STRING), /* getConstant $constantName */ - reg::packed(114, 0, 1683), /* getConstant return */ + reg::packed(1719, MAY_BE_STRING), /* getConstant $constantName */ + reg::packed(114, 0, 1744), /* getConstant return */ reg::packed(114, 0, 570), /* isIterable return */ reg::packed(114, 0, 570), /* isIterableAtLeastOnce return */ reg::packed(114, 0, 84), /* getArraySize return */ @@ -362,49 +366,49 @@ inline constexpr reg::PackedArg args[] = { reg::packed(114, 0, 570), /* isList return */ reg::packed(114, 0, 570), /* isOffsetAccessible return */ reg::packed(114, 0, 570), /* isOffsetAccessLegal return */ - reg::packed(2009, 0, 84), /* hasOffsetValueType $offsetType */ + reg::packed(2070, 0, 84), /* hasOffsetValueType $offsetType */ reg::packed(114, 0, 570), /* hasOffsetValueType return */ - reg::packed(2009, 0, 84), /* getOffsetValueType $offsetType */ + reg::packed(2070, 0, 84), /* getOffsetValueType $offsetType */ reg::packed(114, 0, 84), /* getOffsetValueType return */ - reg::packed(2009, MAY_BE_NULL, 84), /* setOffsetValueType $offsetType */ - reg::packed(2058, 0, 84), /* setOffsetValueType $valueType */ - reg::packed(2068, MAY_BE_BOOL, reg::NoString, false, false, 2080), /* setOffsetValueType $unionValues */ + reg::packed(2070, MAY_BE_NULL, 84), /* setOffsetValueType $offsetType */ + reg::packed(2119, 0, 84), /* setOffsetValueType $valueType */ + reg::packed(2129, MAY_BE_BOOL, reg::NoString, false, false, 2141), /* setOffsetValueType $unionValues */ reg::packed(114, 0, 84), /* setOffsetValueType return */ - reg::packed(2009, 0, 84), /* setExistingOffsetValueType $offsetType */ - reg::packed(2058, 0, 84), /* setExistingOffsetValueType $valueType */ + reg::packed(2070, 0, 84), /* setExistingOffsetValueType $offsetType */ + reg::packed(2119, 0, 84), /* setExistingOffsetValueType $valueType */ reg::packed(114, 0, 84), /* setExistingOffsetValueType return */ - reg::packed(2009, 0, 84), /* unsetOffset $offsetType */ + reg::packed(2070, 0, 84), /* unsetOffset $offsetType */ reg::packed(114, 0, 84), /* unsetOffset return */ - reg::packed(2143, 0, 84), /* getKeysArrayFiltered $filterValueType */ - reg::packed(2159, 0, 570), /* getKeysArrayFiltered $strict */ + reg::packed(2204, 0, 84), /* getKeysArrayFiltered $filterValueType */ + reg::packed(2220, 0, 570), /* getKeysArrayFiltered $strict */ reg::packed(114, 0, 84), /* getKeysArrayFiltered return */ reg::packed(114, 0, 84), /* getKeysArray return */ reg::packed(114, 0, 84), /* getValuesArray return */ - reg::packed(2215, 0, 84), /* chunkArray $lengthType */ - reg::packed(2226, 0, 570), /* chunkArray $preserveKeys */ + reg::packed(2276, 0, 84), /* chunkArray $lengthType */ + reg::packed(2287, 0, 570), /* chunkArray $preserveKeys */ reg::packed(114, 0, 84), /* chunkArray return */ - reg::packed(2058, 0, 84), /* fillKeysArray $valueType */ + reg::packed(2119, 0, 84), /* fillKeysArray $valueType */ reg::packed(114, 0, 84), /* fillKeysArray return */ reg::packed(114, 0, 84), /* flipArray return */ - reg::packed(2274, 0, 84), /* intersectKeyArray $otherArraysType */ + reg::packed(2335, 0, 84), /* intersectKeyArray $otherArraysType */ reg::packed(114, 0, 84), /* intersectKeyArray return */ reg::packed(114, 0, 84), /* popArray return */ - reg::packed(2226, 0, 570), /* reverseArray $preserveKeys */ + reg::packed(2287, 0, 570), /* reverseArray $preserveKeys */ reg::packed(114, 0, 84), /* reverseArray return */ - reg::packed(2330, 0, 84), /* searchArray $needleType */ - reg::packed(2159, MAY_BE_NULL, 570, false, false, 2341), /* searchArray $strict */ + reg::packed(2391, 0, 84), /* searchArray $needleType */ + reg::packed(2220, MAY_BE_NULL, 570, false, false, 2402), /* searchArray $strict */ reg::packed(114, 0, 84), /* searchArray return */ reg::packed(114, 0, 84), /* shiftArray return */ reg::packed(114, 0, 84), /* shuffleArray return */ - reg::packed(2009, 0, 84), /* sliceArray $offsetType */ - reg::packed(2215, 0, 84), /* sliceArray $lengthType */ - reg::packed(2226, 0, 570), /* sliceArray $preserveKeys */ + reg::packed(2070, 0, 84), /* sliceArray $offsetType */ + reg::packed(2276, 0, 84), /* sliceArray $lengthType */ + reg::packed(2287, 0, 570), /* sliceArray $preserveKeys */ reg::packed(114, 0, 84), /* sliceArray return */ - reg::packed(2009, 0, 84), /* spliceArray $offsetType */ - reg::packed(2215, 0, 84), /* spliceArray $lengthType */ - reg::packed(2393, 0, 84), /* spliceArray $replacementType */ + reg::packed(2070, 0, 84), /* spliceArray $offsetType */ + reg::packed(2276, 0, 84), /* spliceArray $lengthType */ + reg::packed(2454, 0, 84), /* spliceArray $replacementType */ reg::packed(114, 0, 84), /* spliceArray return */ - reg::packed(2421, 0, 84), /* truncateListToSize $sizeType */ + reg::packed(2482, 0, 84), /* truncateListToSize $sizeType */ reg::packed(114, 0, 84), /* truncateListToSize return */ reg::packed(114, 0, 84), /* makeListMaybe return */ reg::packed(626, MAY_BE_CALLABLE), /* mapValueType $cb */ @@ -412,29 +416,29 @@ inline constexpr reg::PackedArg args[] = { reg::packed(626, MAY_BE_CALLABLE), /* mapKeyType $cb */ reg::packed(114, 0, 84), /* mapKeyType return */ reg::packed(114, 0, 84), /* makeAllArrayKeysOptional return */ - reg::packed(2512, MAY_BE_NULL | MAY_BE_LONG), /* changeKeyCaseArray $case */ + reg::packed(2573, MAY_BE_NULL | MAY_BE_LONG), /* changeKeyCaseArray $case */ reg::packed(114, 0, 84), /* changeKeyCaseArray return */ reg::packed(114, 0, 84), /* filterArrayRemovingFalsey return */ reg::packed(114, MAY_BE_ARRAY), /* getEnumCases return */ - reg::packed(114, MAY_BE_NULL, 2575), /* getEnumCaseObject return */ + reg::packed(114, MAY_BE_NULL, 2636), /* getEnumCaseObject return */ reg::packed(114, MAY_BE_ARRAY), /* getFiniteTypes return */ - reg::packed(2645, 0, 84), /* exponentiate $exponent */ + reg::packed(2706, 0, 84), /* exponentiate $exponent */ reg::packed(114, 0, 84), /* exponentiate return */ reg::packed(114, 0, 570), /* isCallable return */ - reg::packed(1106, 0, 1112), /* getCallableParametersAcceptors $scope */ + reg::packed(1167, 0, 1173), /* getCallableParametersAcceptors $scope */ reg::packed(114, MAY_BE_ARRAY), /* getCallableParametersAcceptors return */ reg::packed(114, 0, 570), /* isCloneable return */ - reg::packed(114, 0, 2721), /* toBoolean return */ + reg::packed(114, 0, 2782), /* toBoolean return */ reg::packed(114, 0, 84), /* toNumber return */ reg::packed(114, 0, 84), /* toBitwiseNotType return */ reg::packed(114, 0, 84), /* toGetClassResultType return */ - reg::packed(2803, 0, 2822), /* toClassConstantType $reflectionProvider */ + reg::packed(2864, 0, 2883), /* toClassConstantType $reflectionProvider */ reg::packed(114, 0, 84), /* toClassConstantType return */ - reg::packed(114, 0, 2880), /* toObjectTypeForInstanceofCheck return */ - reg::packed(2952, 0, 84), /* toObjectTypeForIsACheck $objectOrClassType */ - reg::packed(2970, MAY_BE_BOOL), /* toObjectTypeForIsACheck $allowString */ - reg::packed(2982, MAY_BE_BOOL), /* toObjectTypeForIsACheck $allowSameClass */ - reg::packed(114, 0, 2880), /* toObjectTypeForIsACheck return */ + reg::packed(114, 0, 2941), /* toObjectTypeForInstanceofCheck return */ + reg::packed(3013, 0, 84), /* toObjectTypeForIsACheck $objectOrClassType */ + reg::packed(3031, MAY_BE_BOOL), /* toObjectTypeForIsACheck $allowString */ + reg::packed(3043, MAY_BE_BOOL), /* toObjectTypeForIsACheck $allowSameClass */ + reg::packed(114, 0, 2941), /* toObjectTypeForIsACheck return */ reg::packed(114, 0, 84), /* toInteger return */ reg::packed(114, 0, 84), /* toFloat return */ reg::packed(114, 0, 84), /* toString return */ @@ -469,7 +473,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(114, 0, 570), /* isScalar return */ reg::packed(274, 0, 84), /* looseCompare $type */ reg::packed(536, 0, 547), /* looseCompare $phpVersion */ - reg::packed(114, 0, 2721), /* looseCompare return */ + reg::packed(114, 0, 2782), /* looseCompare return */ reg::packed(536, 0, 547), /* getSmallerType $phpVersion */ reg::packed(114, 0, 84), /* getSmallerType return */ reg::packed(536, 0, 547), /* getSmallerOrEqualType $phpVersion */ @@ -478,12 +482,12 @@ inline constexpr reg::PackedArg args[] = { reg::packed(114, 0, 84), /* getGreaterType return */ reg::packed(536, 0, 547), /* getGreaterOrEqualType $phpVersion */ reg::packed(114, 0, 84), /* getGreaterOrEqualType return */ - reg::packed(3488, MAY_BE_STRING), /* getTemplateType $ancestorClassName */ - reg::packed(3506, MAY_BE_STRING), /* getTemplateType $templateTypeName */ + reg::packed(3549, MAY_BE_STRING), /* getTemplateType $ancestorClassName */ + reg::packed(3567, MAY_BE_STRING), /* getTemplateType $templateTypeName */ reg::packed(114, 0, 84), /* getTemplateType return */ - reg::packed(3539, 0, 84), /* inferTemplateTypes $receivedType */ - reg::packed(114, 0, 3552), /* inferTemplateTypes return */ - reg::packed(3608, 0, 3625), /* getReferencedTemplateTypes $positionVariance */ + reg::packed(3600, 0, 84), /* inferTemplateTypes $receivedType */ + reg::packed(114, 0, 3613), /* inferTemplateTypes return */ + reg::packed(3669, 0, 3686), /* getReferencedTemplateTypes $positionVariance */ reg::packed(114, MAY_BE_ARRAY), /* getReferencedTemplateTypes return */ reg::packed(114, 0, 84), /* toAbsoluteNumber return */ }; @@ -519,126 +523,127 @@ inline constexpr sigtab::Sig tryRemove = { { 734 /* tryRemove */, 1, 47, 1, 48, inline constexpr sigtab::Sig toCoercedArgumentType = { { 744 /* toCoercedArgumentType */, 1, 49, 1, 50, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 766 /* hasTemplateOrLateResolvableType */, 0, 51, 0, 51, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 837 /* toPhpDocNode */, 0, 52, 0, 52, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getReferencedClasses = { { 850 /* getReferencedClasses */, 0, 53, 0, 53, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getObjectClassNames = { { 871 /* getObjectClassNames */, 0, 54, 0, 54, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getObjectClassReflections = { { 891 /* getObjectClassReflections */, 0, 55, 0, 55, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getClassStringType = { { 917 /* getClassStringType */, 0, 56, 0, 56, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getClassStringObjectType = { { 936 /* getClassStringObjectType */, 0, 57, 0, 57, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getObjectTypeOrClassStringObjectType = { { 961 /* getObjectTypeOrClassStringObjectType */, 0, 58, 0, 58, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isObject = { { 998 /* isObject */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isEnum = { { 1007 /* isEnum */, 0, 60, 0, 60, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getArrays = { { 1014 /* getArrays */, 0, 61, 0, 61, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantArrays = { { 1024 /* getConstantArrays */, 0, 62, 0, 62, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantStrings = { { 1042 /* getConstantStrings */, 0, 63, 0, 63, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canAccessProperties = { { 1061 /* canAccessProperties */, 0, 64, 0, 64, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasProperty = { { 1094 /* hasProperty */, 1, 65, 1, 66, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getProperty = { { 1203 /* getProperty */, 2, 67, 2, 69, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getUnresolvedPropertyPrototype = { { 1277 /* getUnresolvedPropertyPrototype */, 2, 70, 2, 72, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasInstanceProperty = { { 1308 /* hasInstanceProperty */, 1, 73, 1, 74, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getInstanceProperty = { { 1328 /* getInstanceProperty */, 2, 75, 2, 77, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getUnresolvedInstancePropertyPrototype = { { 1348 /* getUnresolvedInstancePropertyPrototype */, 2, 78, 2, 80, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasStaticProperty = { { 1387 /* hasStaticProperty */, 1, 81, 1, 82, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getStaticProperty = { { 1405 /* getStaticProperty */, 2, 83, 2, 85, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getUnresolvedStaticPropertyPrototype = { { 1423 /* getUnresolvedStaticPropertyPrototype */, 2, 86, 2, 88, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canCallMethods = { { 1460 /* canCallMethods */, 0, 89, 0, 89, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasMethod = { { 1486 /* hasMethod */, 1, 90, 1, 91, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getMethod = { { 1540 /* getMethod */, 2, 92, 2, 94, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getUnresolvedMethodPrototype = { { 1610 /* getUnresolvedMethodPrototype */, 2, 95, 2, 97, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canAccessConstants = { { 1639 /* canAccessConstants */, 0, 98, 0, 98, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasConstant = { { 1671 /* hasConstant */, 1, 99, 1, 100, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstant = { { 1726 /* getConstant */, 1, 101, 1, 102, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isIterable = { { 1738 /* isIterable */, 0, 103, 0, 103, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isIterableAtLeastOnce = { { 1749 /* isIterableAtLeastOnce */, 0, 104, 0, 104, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getArraySize = { { 1771 /* getArraySize */, 0, 105, 0, 105, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getIterableKeyType = { { 1784 /* getIterableKeyType */, 0, 106, 0, 106, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getFirstIterableKeyType = { { 1803 /* getFirstIterableKeyType */, 0, 107, 0, 107, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getLastIterableKeyType = { { 1827 /* getLastIterableKeyType */, 0, 108, 0, 108, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getIterableValueType = { { 1850 /* getIterableValueType */, 0, 109, 0, 109, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getFirstIterableValueType = { { 1871 /* getFirstIterableValueType */, 0, 110, 0, 110, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getLastIterableValueType = { { 1897 /* getLastIterableValueType */, 0, 111, 0, 111, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isArray = { { 1922 /* isArray */, 0, 112, 0, 112, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isConstantArray = { { 1930 /* isConstantArray */, 0, 113, 0, 113, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isOversizedArray = { { 1946 /* isOversizedArray */, 0, 114, 0, 114, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isList = { { 1963 /* isList */, 0, 115, 0, 115, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isOffsetAccessible = { { 1970 /* isOffsetAccessible */, 0, 116, 0, 116, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isOffsetAccessLegal = { { 1989 /* isOffsetAccessLegal */, 0, 117, 0, 117, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasOffsetValueType = { { 2020 /* hasOffsetValueType */, 1, 118, 1, 119, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getOffsetValueType = { { 2039 /* getOffsetValueType */, 1, 120, 1, 121, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig setOffsetValueType = { { 2085 /* setOffsetValueType */, 2, 122, 3, 125, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig setExistingOffsetValueType = { { 2104 /* setExistingOffsetValueType */, 2, 126, 2, 128, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig unsetOffset = { { 2131 /* unsetOffset */, 1, 129, 1, 130, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getKeysArrayFiltered = { { 2166 /* getKeysArrayFiltered */, 2, 131, 2, 133, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getKeysArray = { { 2187 /* getKeysArray */, 0, 134, 0, 134, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getValuesArray = { { 2200 /* getValuesArray */, 0, 135, 0, 135, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig chunkArray = { { 2239 /* chunkArray */, 2, 136, 2, 138, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig fillKeysArray = { { 2250 /* fillKeysArray */, 1, 139, 1, 140, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig flipArray = { { 2264 /* flipArray */, 0, 141, 0, 141, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig intersectKeyArray = { { 2290 /* intersectKeyArray */, 1, 142, 1, 143, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig popArray = { { 2308 /* popArray */, 0, 144, 0, 144, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig reverseArray = { { 2317 /* reverseArray */, 1, 145, 1, 146, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig searchArray = { { 2346 /* searchArray */, 1, 147, 2, 149, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig shiftArray = { { 2358 /* shiftArray */, 0, 150, 0, 150, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig shuffleArray = { { 2369 /* shuffleArray */, 0, 151, 0, 151, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig sliceArray = { { 2382 /* sliceArray */, 3, 152, 3, 155, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig spliceArray = { { 2409 /* spliceArray */, 3, 156, 3, 159, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig truncateListToSize = { { 2430 /* truncateListToSize */, 1, 160, 1, 161, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig makeListMaybe = { { 2449 /* makeListMaybe */, 0, 162, 0, 162, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig mapValueType = { { 2463 /* mapValueType */, 1, 163, 1, 164, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig mapKeyType = { { 2476 /* mapKeyType */, 1, 165, 1, 166, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig makeAllArrayKeysOptional = { { 2487 /* makeAllArrayKeysOptional */, 0, 167, 0, 167, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig changeKeyCaseArray = { { 2517 /* changeKeyCaseArray */, 1, 168, 1, 169, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig filterArrayRemovingFalsey = { { 2536 /* filterArrayRemovingFalsey */, 0, 170, 0, 170, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getEnumCases = { { 2562 /* getEnumCases */, 0, 171, 0, 171, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getEnumCaseObject = { { 2612 /* getEnumCaseObject */, 0, 172, 0, 172, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getFiniteTypes = { { 2630 /* getFiniteTypes */, 0, 173, 0, 173, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig exponentiate = { { 2654 /* exponentiate */, 1, 174, 1, 175, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isCallable = { { 2667 /* isCallable */, 0, 176, 0, 176, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getCallableParametersAcceptors = { { 2678 /* getCallableParametersAcceptors */, 1, 177, 1, 178, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isCloneable = { { 2709 /* isCloneable */, 0, 179, 0, 179, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toBoolean = { { 2746 /* toBoolean */, 0, 180, 0, 180, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toNumber = { { 2756 /* toNumber */, 0, 181, 0, 181, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toBitwiseNotType = { { 2765 /* toBitwiseNotType */, 0, 182, 0, 182, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toGetClassResultType = { { 2782 /* toGetClassResultType */, 0, 183, 0, 183, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toClassConstantType = { { 2860 /* toClassConstantType */, 1, 184, 1, 185, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toObjectTypeForInstanceofCheck = { { 2921 /* toObjectTypeForInstanceofCheck */, 0, 186, 0, 186, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toObjectTypeForIsACheck = { { 2997 /* toObjectTypeForIsACheck */, 3, 187, 3, 190, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toInteger = { { 3021 /* toInteger */, 0, 191, 0, 191, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toFloat = { { 3031 /* toFloat */, 0, 192, 0, 192, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toString = { { 3039 /* toString */, 0, 193, 0, 193, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toArray = { { 3048 /* toArray */, 0, 194, 0, 194, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toArrayKey = { { 3056 /* toArrayKey */, 0, 195, 0, 195, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isSmallerThan = { { 3067 /* isSmallerThan */, 2, 196, 2, 198, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isSmallerThanOrEqual = { { 3081 /* isSmallerThanOrEqual */, 2, 199, 2, 201, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isConstantValue = { { 3102 /* isConstantValue */, 0, 202, 0, 202, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isConstantScalarValue = { { 3118 /* isConstantScalarValue */, 0, 203, 0, 203, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantScalarTypes = { { 3140 /* getConstantScalarTypes */, 0, 204, 0, 204, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantScalarValues = { { 3163 /* getConstantScalarValues */, 0, 205, 0, 205, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isNull = { { 3187 /* isNull */, 0, 206, 0, 206, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isTrue = { { 3194 /* isTrue */, 0, 207, 0, 207, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isFalse = { { 3201 /* isFalse */, 0, 208, 0, 208, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isBoolean = { { 3209 /* isBoolean */, 0, 209, 0, 209, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isFloat = { { 3219 /* isFloat */, 0, 210, 0, 210, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isInteger = { { 3227 /* isInteger */, 0, 211, 0, 211, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isString = { { 3237 /* isString */, 0, 212, 0, 212, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isNumericString = { { 3246 /* isNumericString */, 0, 213, 0, 213, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isDecimalIntegerString = { { 3262 /* isDecimalIntegerString */, 0, 214, 0, 214, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isNonEmptyString = { { 3285 /* isNonEmptyString */, 0, 215, 0, 215, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isNonFalsyString = { { 3302 /* isNonFalsyString */, 0, 216, 0, 216, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isLiteralString = { { 3319 /* isLiteralString */, 0, 217, 0, 217, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isLowercaseString = { { 3335 /* isLowercaseString */, 0, 218, 0, 218, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isUppercaseString = { { 3353 /* isUppercaseString */, 0, 219, 0, 219, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isClassString = { { 3371 /* isClassString */, 0, 220, 0, 220, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isVoid = { { 3385 /* isVoid */, 0, 221, 0, 221, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig isScalar = { { 3392 /* isScalar */, 0, 222, 0, 222, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig looseCompare = { { 3401 /* looseCompare */, 2, 223, 2, 225, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getSmallerType = { { 3414 /* getSmallerType */, 1, 226, 1, 227, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getSmallerOrEqualType = { { 3429 /* getSmallerOrEqualType */, 1, 228, 1, 229, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getGreaterType = { { 3451 /* getGreaterType */, 1, 230, 1, 231, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getGreaterOrEqualType = { { 3466 /* getGreaterOrEqualType */, 1, 232, 1, 233, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getTemplateType = { { 3523 /* getTemplateType */, 2, 234, 2, 236, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig inferTemplateTypes = { { 3589 /* inferTemplateTypes */, 1, 237, 1, 238, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getReferencedTemplateTypes = { { 3667 /* getReferencedTemplateTypes */, 1, 239, 1, 240, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig toAbsoluteNumber = { { 3694 /* toAbsoluteNumber */, 0, 241, 0, 241, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 891 /* toNativePhpTypeNode */, 1, 53, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getReferencedClasses = { { 911 /* getReferencedClasses */, 0, 54, 0, 54, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getObjectClassNames = { { 932 /* getObjectClassNames */, 0, 55, 0, 55, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getObjectClassReflections = { { 952 /* getObjectClassReflections */, 0, 56, 0, 56, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClassStringType = { { 978 /* getClassStringType */, 0, 57, 0, 57, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getClassStringObjectType = { { 997 /* getClassStringObjectType */, 0, 58, 0, 58, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getObjectTypeOrClassStringObjectType = { { 1022 /* getObjectTypeOrClassStringObjectType */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isObject = { { 1059 /* isObject */, 0, 60, 0, 60, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isEnum = { { 1068 /* isEnum */, 0, 61, 0, 61, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getArrays = { { 1075 /* getArrays */, 0, 62, 0, 62, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantArrays = { { 1085 /* getConstantArrays */, 0, 63, 0, 63, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantStrings = { { 1103 /* getConstantStrings */, 0, 64, 0, 64, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canAccessProperties = { { 1122 /* canAccessProperties */, 0, 65, 0, 65, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasProperty = { { 1155 /* hasProperty */, 1, 66, 1, 67, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getProperty = { { 1264 /* getProperty */, 2, 68, 2, 70, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getUnresolvedPropertyPrototype = { { 1338 /* getUnresolvedPropertyPrototype */, 2, 71, 2, 73, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasInstanceProperty = { { 1369 /* hasInstanceProperty */, 1, 74, 1, 75, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getInstanceProperty = { { 1389 /* getInstanceProperty */, 2, 76, 2, 78, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getUnresolvedInstancePropertyPrototype = { { 1409 /* getUnresolvedInstancePropertyPrototype */, 2, 79, 2, 81, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasStaticProperty = { { 1448 /* hasStaticProperty */, 1, 82, 1, 83, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getStaticProperty = { { 1466 /* getStaticProperty */, 2, 84, 2, 86, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getUnresolvedStaticPropertyPrototype = { { 1484 /* getUnresolvedStaticPropertyPrototype */, 2, 87, 2, 89, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canCallMethods = { { 1521 /* canCallMethods */, 0, 90, 0, 90, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasMethod = { { 1547 /* hasMethod */, 1, 91, 1, 92, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getMethod = { { 1601 /* getMethod */, 2, 93, 2, 95, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getUnresolvedMethodPrototype = { { 1671 /* getUnresolvedMethodPrototype */, 2, 96, 2, 98, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canAccessConstants = { { 1700 /* canAccessConstants */, 0, 99, 0, 99, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasConstant = { { 1732 /* hasConstant */, 1, 100, 1, 101, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstant = { { 1787 /* getConstant */, 1, 102, 1, 103, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isIterable = { { 1799 /* isIterable */, 0, 104, 0, 104, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isIterableAtLeastOnce = { { 1810 /* isIterableAtLeastOnce */, 0, 105, 0, 105, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getArraySize = { { 1832 /* getArraySize */, 0, 106, 0, 106, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getIterableKeyType = { { 1845 /* getIterableKeyType */, 0, 107, 0, 107, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getFirstIterableKeyType = { { 1864 /* getFirstIterableKeyType */, 0, 108, 0, 108, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getLastIterableKeyType = { { 1888 /* getLastIterableKeyType */, 0, 109, 0, 109, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getIterableValueType = { { 1911 /* getIterableValueType */, 0, 110, 0, 110, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getFirstIterableValueType = { { 1932 /* getFirstIterableValueType */, 0, 111, 0, 111, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getLastIterableValueType = { { 1958 /* getLastIterableValueType */, 0, 112, 0, 112, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isArray = { { 1983 /* isArray */, 0, 113, 0, 113, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isConstantArray = { { 1991 /* isConstantArray */, 0, 114, 0, 114, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isOversizedArray = { { 2007 /* isOversizedArray */, 0, 115, 0, 115, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isList = { { 2024 /* isList */, 0, 116, 0, 116, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isOffsetAccessible = { { 2031 /* isOffsetAccessible */, 0, 117, 0, 117, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isOffsetAccessLegal = { { 2050 /* isOffsetAccessLegal */, 0, 118, 0, 118, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasOffsetValueType = { { 2081 /* hasOffsetValueType */, 1, 119, 1, 120, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getOffsetValueType = { { 2100 /* getOffsetValueType */, 1, 121, 1, 122, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig setOffsetValueType = { { 2146 /* setOffsetValueType */, 2, 123, 3, 126, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig setExistingOffsetValueType = { { 2165 /* setExistingOffsetValueType */, 2, 127, 2, 129, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig unsetOffset = { { 2192 /* unsetOffset */, 1, 130, 1, 131, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getKeysArrayFiltered = { { 2227 /* getKeysArrayFiltered */, 2, 132, 2, 134, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getKeysArray = { { 2248 /* getKeysArray */, 0, 135, 0, 135, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getValuesArray = { { 2261 /* getValuesArray */, 0, 136, 0, 136, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig chunkArray = { { 2300 /* chunkArray */, 2, 137, 2, 139, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig fillKeysArray = { { 2311 /* fillKeysArray */, 1, 140, 1, 141, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig flipArray = { { 2325 /* flipArray */, 0, 142, 0, 142, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig intersectKeyArray = { { 2351 /* intersectKeyArray */, 1, 143, 1, 144, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig popArray = { { 2369 /* popArray */, 0, 145, 0, 145, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig reverseArray = { { 2378 /* reverseArray */, 1, 146, 1, 147, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig searchArray = { { 2407 /* searchArray */, 1, 148, 2, 150, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig shiftArray = { { 2419 /* shiftArray */, 0, 151, 0, 151, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig shuffleArray = { { 2430 /* shuffleArray */, 0, 152, 0, 152, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig sliceArray = { { 2443 /* sliceArray */, 3, 153, 3, 156, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig spliceArray = { { 2470 /* spliceArray */, 3, 157, 3, 160, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig truncateListToSize = { { 2491 /* truncateListToSize */, 1, 161, 1, 162, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig makeListMaybe = { { 2510 /* makeListMaybe */, 0, 163, 0, 163, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig mapValueType = { { 2524 /* mapValueType */, 1, 164, 1, 165, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig mapKeyType = { { 2537 /* mapKeyType */, 1, 166, 1, 167, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig makeAllArrayKeysOptional = { { 2548 /* makeAllArrayKeysOptional */, 0, 168, 0, 168, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig changeKeyCaseArray = { { 2578 /* changeKeyCaseArray */, 1, 169, 1, 170, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig filterArrayRemovingFalsey = { { 2597 /* filterArrayRemovingFalsey */, 0, 171, 0, 171, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getEnumCases = { { 2623 /* getEnumCases */, 0, 172, 0, 172, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getEnumCaseObject = { { 2673 /* getEnumCaseObject */, 0, 173, 0, 173, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getFiniteTypes = { { 2691 /* getFiniteTypes */, 0, 174, 0, 174, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig exponentiate = { { 2715 /* exponentiate */, 1, 175, 1, 176, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isCallable = { { 2728 /* isCallable */, 0, 177, 0, 177, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getCallableParametersAcceptors = { { 2739 /* getCallableParametersAcceptors */, 1, 178, 1, 179, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isCloneable = { { 2770 /* isCloneable */, 0, 180, 0, 180, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toBoolean = { { 2807 /* toBoolean */, 0, 181, 0, 181, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNumber = { { 2817 /* toNumber */, 0, 182, 0, 182, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toBitwiseNotType = { { 2826 /* toBitwiseNotType */, 0, 183, 0, 183, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toGetClassResultType = { { 2843 /* toGetClassResultType */, 0, 184, 0, 184, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toClassConstantType = { { 2921 /* toClassConstantType */, 1, 185, 1, 186, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toObjectTypeForInstanceofCheck = { { 2982 /* toObjectTypeForInstanceofCheck */, 0, 187, 0, 187, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toObjectTypeForIsACheck = { { 3058 /* toObjectTypeForIsACheck */, 3, 188, 3, 191, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toInteger = { { 3082 /* toInteger */, 0, 192, 0, 192, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toFloat = { { 3092 /* toFloat */, 0, 193, 0, 193, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toString = { { 3100 /* toString */, 0, 194, 0, 194, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toArray = { { 3109 /* toArray */, 0, 195, 0, 195, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toArrayKey = { { 3117 /* toArrayKey */, 0, 196, 0, 196, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isSmallerThan = { { 3128 /* isSmallerThan */, 2, 197, 2, 199, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isSmallerThanOrEqual = { { 3142 /* isSmallerThanOrEqual */, 2, 200, 2, 202, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isConstantValue = { { 3163 /* isConstantValue */, 0, 203, 0, 203, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isConstantScalarValue = { { 3179 /* isConstantScalarValue */, 0, 204, 0, 204, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantScalarTypes = { { 3201 /* getConstantScalarTypes */, 0, 205, 0, 205, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantScalarValues = { { 3224 /* getConstantScalarValues */, 0, 206, 0, 206, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isNull = { { 3248 /* isNull */, 0, 207, 0, 207, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isTrue = { { 3255 /* isTrue */, 0, 208, 0, 208, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isFalse = { { 3262 /* isFalse */, 0, 209, 0, 209, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isBoolean = { { 3270 /* isBoolean */, 0, 210, 0, 210, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isFloat = { { 3280 /* isFloat */, 0, 211, 0, 211, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isInteger = { { 3288 /* isInteger */, 0, 212, 0, 212, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isString = { { 3298 /* isString */, 0, 213, 0, 213, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isNumericString = { { 3307 /* isNumericString */, 0, 214, 0, 214, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isDecimalIntegerString = { { 3323 /* isDecimalIntegerString */, 0, 215, 0, 215, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isNonEmptyString = { { 3346 /* isNonEmptyString */, 0, 216, 0, 216, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isNonFalsyString = { { 3363 /* isNonFalsyString */, 0, 217, 0, 217, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isLiteralString = { { 3380 /* isLiteralString */, 0, 218, 0, 218, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isLowercaseString = { { 3396 /* isLowercaseString */, 0, 219, 0, 219, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isUppercaseString = { { 3414 /* isUppercaseString */, 0, 220, 0, 220, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isClassString = { { 3432 /* isClassString */, 0, 221, 0, 221, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isVoid = { { 3446 /* isVoid */, 0, 222, 0, 222, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig isScalar = { { 3453 /* isScalar */, 0, 223, 0, 223, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig looseCompare = { { 3462 /* looseCompare */, 2, 224, 2, 226, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getSmallerType = { { 3475 /* getSmallerType */, 1, 227, 1, 228, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getSmallerOrEqualType = { { 3490 /* getSmallerOrEqualType */, 1, 229, 1, 230, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getGreaterType = { { 3512 /* getGreaterType */, 1, 231, 1, 232, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getGreaterOrEqualType = { { 3527 /* getGreaterOrEqualType */, 1, 233, 1, 234, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getTemplateType = { { 3584 /* getTemplateType */, 2, 235, 2, 237, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig inferTemplateTypes = { { 3650 /* inferTemplateTypes */, 1, 238, 1, 239, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getReferencedTemplateTypes = { { 3728 /* getReferencedTemplateTypes */, 1, 240, 1, 241, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toAbsoluteNumber = { { 3755 /* toAbsoluteNumber */, 0, 242, 0, 242, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::UnresolvedTemplateArgumentType diff --git a/turbo-ext/src/generated/VoidType.h b/turbo-ext/src/generated/VoidType.h index 76d9059045a..362d155c814 100644 --- a/turbo-ext/src/generated/VoidType.h +++ b/turbo-ext/src/generated/VoidType.h @@ -100,7 +100,10 @@ inline constexpr char strings[] = "getFiniteTypes\0" /* 895 */ "PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\0" /* 910 */ "toPhpDocNode\0" /* 949 */ - "hasTemplateOrLateResolvableType"; /* 962 */ + "position\0" /* 962 */ + "PHPStan\\Type\\NativeTypePosition\0" /* 971 */ + "toNativePhpTypeNode\0" /* 1003 */ + "hasTemplateOrLateResolvableType"; /* 1023 */ inline constexpr reg::PackedArg args[] = { reg::packed(12, MAY_BE_ARRAY), /* getReferencedClasses return */ reg::packed(12, MAY_BE_ARRAY), /* getObjectClassNames return */ @@ -160,6 +163,7 @@ inline constexpr reg::PackedArg args[] = { reg::packed(12, 0, 85), /* exponentiate return */ reg::packed(12, MAY_BE_ARRAY), /* getFiniteTypes return */ reg::packed(12, 0, 910), /* toPhpDocNode return */ + reg::packed(962, 0, 971), /* toNativePhpTypeNode $position */ reg::packed(12, MAY_BE_BOOL), /* hasTemplateOrLateResolvableType return */ }; using Sig = reg::Sig; @@ -214,7 +218,8 @@ inline constexpr sigtab::Sig traverseSimultaneously = { { 850 /* traverseSimulta inline constexpr sigtab::Sig exponentiate = { { 882 /* exponentiate */, 1, 54, 1, 55, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig getFiniteTypes = { { 895 /* getFiniteTypes */, 0, 56, 0, 56, ZEND_ACC_PUBLIC } }; inline constexpr sigtab::Sig toPhpDocNode = { { 949 /* toPhpDocNode */, 0, 57, 0, 57, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 962 /* hasTemplateOrLateResolvableType */, 0, 58, 0, 58, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig toNativePhpTypeNode = { { 1003 /* toNativePhpTypeNode */, 1, 58, 1, reg::NoArg, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig hasTemplateOrLateResolvableType = { { 1023 /* hasTemplateOrLateResolvableType */, 0, 59, 0, 59, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::VoidType diff --git a/turbo-ext/src/support.cpp b/turbo-ext/src/support.cpp index 5f9b626eecc..825bd0086f1 100644 --- a/turbo-ext/src/support.cpp +++ b/turbo-ext/src/support.cpp @@ -413,6 +413,7 @@ static const pt_class_template pt_class_templates[PT_CLASS_COUNT] = { /* PT_CLASS_CLOSURE_CALL_CONTEXT_MATCHER */ {"closureCallContextMatcher", "PHPStan\\Analyser\\ClosureCallContextMatcher"}, /* PT_CLASS_CLASS_CONSTANT_PATTERN_RESOLVER */ {"classConstantPatternResolver", "PHPStan\\Type\\ClassConstantPatternResolver"}, /* PT_CLASS_DEPENDENCY_TYPES */ {"dependencyTypes", "PHPStan\\Dependency\\DependencyTypes"}, + /* PT_CLASS_NATIVE_PHP_TYPE_NODE_HELPER */ {"nativePhpTypeNodeHelper", "PHPStan\\Type\\NativePhpTypeNodeHelper"}, }; zend_class_entry *pt_class(int idx) diff --git a/turbo-ext/src/support.h b/turbo-ext/src/support.h index 043560faaa0..76f44d25daf 100644 --- a/turbo-ext/src/support.h +++ b/turbo-ext/src/support.h @@ -515,6 +515,8 @@ enum { PT_CLASS_CLASS_CONSTANT_PATTERN_RESOLVER, /* the dependencies of the handlers' results */ PT_CLASS_DEPENDENCY_TYPES, + /* the compound arms of Type::toNativePhpTypeNode() */ + PT_CLASS_NATIVE_PHP_TYPE_NODE_HELPER, PT_CLASS_COUNT }; diff --git a/turbo-ext/tests/type-family.php b/turbo-ext/tests/type-family.php index 30802a6f19c..04bf5951fa4 100644 --- a/turbo-ext/tests/type-family.php +++ b/turbo-ext/tests/type-family.php @@ -8661,6 +8661,88 @@ public function getTypes(): array } } +// ---- toNativePhpTypeNode() of every shadowed Type family ---- +{ + $nodeView = static function (mixed $node) use (&$nodeView): mixed { + if ($node instanceof \PhpParser\Node\NullableType) { + return ['?', $nodeView($node->type)]; + } + if ($node instanceof \PhpParser\Node\UnionType || $node instanceof \PhpParser\Node\IntersectionType) { + return [get_class($node), array_map($nodeView, $node->types)]; + } + if ($node instanceof \PhpParser\Node\Identifier || $node instanceof \PhpParser\Node\Name) { + return [get_class($node), $node->toString()]; + } + return $node; + }; + $positions = []; + foreach ([70100, 70400, 80000, 80100, 80200] as $versionId) { + $version = new \PHPStan\Php\PhpVersion($versionId); + $positions["parameter $versionId"] = \PHPStan\Type\NativeTypePosition::parameter($version); + $positions["return $versionId"] = \PHPStan\Type\NativeTypePosition::returnType($version); + $positions["property $versionId"] = \PHPStan\Type\NativeTypePosition::property($version); + $positions["unionMember $versionId"] = \PHPStan\Type\NativeTypePosition::returnType($version)->toUnionMember(); + } + $foo = new \PHPStan\Type\ObjectType('Foo'); + $bar = new \PHPStan\Type\ObjectType('Bar'); + $mixed = new \PHPStan\Type\MixedType(); + $subjects = [ + 'bool' => new \PHPStan\Type\BooleanType(), + 'true' => new \PHPStan\Type\Constant\ConstantBooleanType(true), + 'false' => new \PHPStan\Type\Constant\ConstantBooleanType(false), + 'int' => new \PHPStan\Type\IntegerType(), + 'int1' => new \PHPStan\Type\Constant\ConstantIntegerType(1), + 'float' => new \PHPStan\Type\FloatType(), + 'string' => new \PHPStan\Type\StringType(), + 'numericString' => new \PHPStan\Type\Accessory\AccessoryNumericStringType(), + 'nonEmptyString' => new \PHPStan\Type\Accessory\AccessoryNonEmptyStringType(), + 'nonFalsyString' => new \PHPStan\Type\Accessory\AccessoryNonFalsyStringType(), + 'literalString' => new \PHPStan\Type\Accessory\AccessoryLiteralStringType(), + 'lowercaseString' => new \PHPStan\Type\Accessory\AccessoryLowercaseStringType(), + 'uppercaseString' => new \PHPStan\Type\Accessory\AccessoryUppercaseStringType(), + 'decimalIntString' => new \PHPStan\Type\Accessory\AccessoryDecimalIntegerStringType(), + 'array' => new \PHPStan\Type\ArrayType($mixed, $mixed), + 'constantArray' => new \PHPStan\Type\Constant\ConstantArrayType([], []), + 'nonEmptyArray' => new \PHPStan\Type\Accessory\NonEmptyArrayType(), + 'list' => new \PHPStan\Type\Accessory\AccessoryArrayListType(), + 'oversizedArray' => new \PHPStan\Type\Accessory\OversizedArrayType(), + 'hasOffset' => new \PHPStan\Type\Accessory\HasOffsetType(new \PHPStan\Type\Constant\ConstantStringType('a')), + 'hasOffsetValue' => new \PHPStan\Type\Accessory\HasOffsetValueType(new \PHPStan\Type\Constant\ConstantStringType('a'), $mixed), + 'iterable' => new \PHPStan\Type\IterableType($mixed, $mixed), + 'callable' => new \PHPStan\Type\CallableType(), + 'closure' => new \PHPStan\Type\ClosureType(), + 'null' => new \PHPStan\Type\NullType(), + 'void' => new \PHPStan\Type\VoidType(), + 'never' => new \PHPStan\Type\NeverType(), + 'explicitNever' => new \PHPStan\Type\NeverType(true), + 'mixed' => $mixed, + 'explicitMixed' => new \PHPStan\Type\MixedType(true), + 'strictMixed' => new \PHPStan\Type\StrictMixedType(), + 'error' => new \PHPStan\Type\ErrorType(), + 'resource' => new \PHPStan\Type\ResourceType(), + 'object' => new \PHPStan\Type\ObjectWithoutClassType(), + 'objectShape' => new \PHPStan\Type\ObjectShapeType([], []), + 'Foo' => $foo, + 'static' => new \PHPStan\Type\StaticType($stringReflectionProvider->getClass(\PHPStan\TrinaryLogic::class)), + 'parent' => new \PHPStan\Type\NonexistentParentClassType(), + 'hasMethod' => new \PHPStan\Type\Accessory\HasMethodType('foo'), + 'hasProperty' => new \PHPStan\Type\Accessory\HasPropertyType('foo'), + 'Foo|null' => new \PHPStan\Type\UnionType([$foo, new \PHPStan\Type\NullType()]), + 'int|string|null' => new \PHPStan\Type\UnionType([new \PHPStan\Type\IntegerType(), new \PHPStan\Type\StringType(), new \PHPStan\Type\NullType()]), + 'false|null' => new \PHPStan\Type\UnionType([new \PHPStan\Type\Constant\ConstantBooleanType(false), new \PHPStan\Type\NullType()]), + 'Foo&Bar' => new \PHPStan\Type\IntersectionType([$foo, $bar]), + '(Foo&Bar)|null' => new \PHPStan\Type\UnionType([new \PHPStan\Type\IntersectionType([$foo, $bar]), new \PHPStan\Type\NullType()]), + 'object&hasMethod' => new \PHPStan\Type\IntersectionType([new \PHPStan\Type\ObjectWithoutClassType(), new \PHPStan\Type\Accessory\HasMethodType('foo')]), + 'non-empty-string' => new \PHPStan\Type\IntersectionType([new \PHPStan\Type\StringType(), new \PHPStan\Type\Accessory\AccessoryNonEmptyStringType()]), + 'keyOf' => new \PHPStan\Type\KeyOfType(new \PHPStan\Type\Constant\ConstantArrayType([new \PHPStan\Type\Constant\ConstantStringType('a')], [$mixed])), + ]; + foreach ($subjects as $name => $subject) { + foreach ($positions as $positionName => $position) { + $observations["toNativePhpTypeNode $name $positionName"] = $nodeView($subject->toNativePhpTypeNode($position)); + } + } +} + // observations holding bytes that are not UTF-8 (the invalid-UTF-8 subject's // descriptions) go out base64-encoded so json_encode() keeps every byte; the // non-finite floats (the NAN and infinity subjects' values) as their names