null, 'float' => null, 'string' => null, 'bool' => null, 'callable' => null, 'self' => null, 'parent' => null, 'array' => null, 'iterable' => null, 'object' => null, 'void' => null, 'mixed' => null, 'static' => null, 'null' => null, 'never' => null, 'false' => null, 'true' => null, ]; /** @var non-empty-string */ private string $name; /** @internal */ public function __construct( private Reflector $reflector, private ReflectionParameter|ReflectionMethod|ReflectionFunction|ReflectionEnum|ReflectionProperty $owner, Identifier|Name $type, ) { $name = $type->toString(); assert($name !== ''); $this->name = $name; } /** @internal */ public function withOwner(ReflectionParameter|ReflectionMethod|ReflectionFunction|ReflectionEnum|ReflectionProperty $owner): static { $clone = clone $this; $clone->owner = $owner; return $clone; } /** @return non-empty-string */ public function getName(): string { return $this->name; } /** * Checks if it is a built-in type (i.e., it's not an object...) * * @see https://php.net/manual/en/reflectiontype.isbuiltin.php */ public function isBuiltin(): bool { return array_key_exists(strtolower($this->name), self::BUILT_IN_TYPES); } public function getClass(): ReflectionClass { if (! $this->isBuiltin()) { return $this->reflector->reflectClass($this->name); } if ( $this->owner instanceof ReflectionEnum || $this->owner instanceof ReflectionFunction || ($this->owner instanceof ReflectionParameter && $this->owner->getDeclaringFunction() instanceof ReflectionFunction) ) { throw new LogicException(sprintf('The type %s cannot be resolved to class', $this->name)); } $lowercaseName = strtolower($this->name); if ($lowercaseName === 'self') { $class = $this->owner->getImplementingClass(); assert($class instanceof ReflectionClass); return $class; } if ($lowercaseName === 'parent') { $class = $this->owner->getDeclaringClass(); assert($class instanceof ReflectionClass); $parentClass = $class->getParentClass(); assert($parentClass instanceof ReflectionClass); return $parentClass; } if ( $this->owner instanceof ReflectionMethod && $lowercaseName === 'static' ) { return $this->owner->getCurrentClass(); } throw new LogicException(sprintf('The type %s cannot be resolved to class', $this->name)); } public function allowsNull(): bool { return match (strtolower($this->name)) { 'mixed' => true, 'null' => true, default => false, }; } /** @return non-empty-string */ public function __toString(): string { return $this->getName(); } } __halt_compiler();----SIGNATURE:----aX/gCdCIfOklfS8UJLRQFxZSTkvbfGDn2G8MudYbGv/XV6ar8SxuctXalECivY81cl2Od3AaDcdUIO7NyAZU5m70ro3nvy7tEF/aU0PTXQ++nGKYftLdFz/NULlT/FaNfNG3aVeMewlTXSmZKku5X3wlQHjEqHE3HMgjwIbmxwglUZeJcI6HMvy4b3P0y852zm4gNzDauokjDwygwEMz4Jg+ZkBCkhf8rj909syJwZDkZva3GFBcoXPHQRI5P0nsQFoC+tpCCA3JUpCJTLY7FTd4rwLgIfBLJBjKcWstdAsHNiD1sYZnJ3qym98eez57a/A6C4pq1oLWKs6wfpncz3nVsv/aUPHZfC5aamqoE2E04zvcBY3eTmhZNpf03oHZV+HCHCIbmGXvA7Kyf3NFhaGe3D0bsMY0Ragw2M6SgXMl9cpf1Eg57RsBXfx1oUg58zmckCgp+1SkBxV3uA0cgNHD//9B+cC8EYqDiJEcwvHq9Wyp2b+o5t+5h2yJLAlEBY1Cc5ijgN5qmWvlwkkQYbV8ipcvyIqDPZcKbwp94iuWlIogYiJ1HGfokXiJtqyK2HLAKcuuaZvcyCiojbq860Y9tn/C8uir1TR4OMlxxxj2kfQEV0FY+J0HO5fH0rzUajj9YEbWeZsfZl4DF9B5tdIJ0HvmZCBvlEGqNSnHKKc=----ATTACHMENT:----NjQwNTU4ODEyMzU1NjcxMiA0OTUxMTUwMDg2NTQwMDU2IDg2Njk5MjI0NzQyMzc0MDU=