summaryrefslogtreecommitdiff
path: root/vendor/phpdocumentor/type-resolver/src/Types
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/phpdocumentor/type-resolver/src/Types')
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php83
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php125
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php42
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Array_.php29
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Boolean.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Callable_.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/ClassString.php62
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Collection.php68
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Compound.php38
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Context.php95
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php420
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Expression.php51
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Float_.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Integer.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php56
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Intersection.php37
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php38
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Never_.php35
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Null_.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Nullable.php51
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Object_.php69
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Parent_.php34
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Resource_.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Scalar.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Self_.php34
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Static_.php39
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/String_.php32
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/This.php35
-rw-r--r--vendor/phpdocumentor/type-resolver/src/Types/Void_.php35
30 files changed, 1764 insertions, 0 deletions
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php b/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php
new file mode 100644
index 000000000..b674862af
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php
@@ -0,0 +1,83 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Represents a list of values. This is an abstract class for Array_ and Collection.
+ *
+ * @psalm-immutable
+ */
+abstract class AbstractList implements Type
+{
+ /** @var Type */
+ protected $valueType;
+
+ /** @var Type|null */
+ protected $keyType;
+
+ /** @var Type */
+ protected $defaultKeyType;
+
+ /**
+ * Initializes this representation of an array with the given Type.
+ */
+ public function __construct(?Type $valueType = null, ?Type $keyType = null)
+ {
+ if ($valueType === null) {
+ $valueType = new Mixed_();
+ }
+
+ $this->valueType = $valueType;
+ $this->defaultKeyType = new Compound([new String_(), new Integer()]);
+ $this->keyType = $keyType;
+ }
+
+ /**
+ * Returns the type for the keys of this array.
+ */
+ public function getKeyType(): Type
+ {
+ return $this->keyType ?? $this->defaultKeyType;
+ }
+
+ /**
+ * Returns the value for the keys of this array.
+ */
+ public function getValueType(): Type
+ {
+ return $this->valueType;
+ }
+
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ if ($this->keyType) {
+ return 'array<' . $this->keyType . ',' . $this->valueType . '>';
+ }
+
+ if ($this->valueType instanceof Mixed_) {
+ return 'array';
+ }
+
+ if ($this->valueType instanceof Compound) {
+ return '(' . $this->valueType . ')[]';
+ }
+
+ return $this->valueType . '[]';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php b/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php
new file mode 100644
index 000000000..472a1cdc6
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php
@@ -0,0 +1,125 @@
+<?php
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+declare(strict_types=1);
+
+namespace phpDocumentor\Reflection\Types;
+
+use ArrayIterator;
+use IteratorAggregate;
+use phpDocumentor\Reflection\Type;
+
+use function array_key_exists;
+use function implode;
+
+/**
+ * Base class for aggregated types like Compound and Intersection
+ *
+ * A Aggregated Type is not so much a special keyword or object reference but is a series of Types that are separated
+ * using separator.
+ *
+ * @psalm-immutable
+ * @template-implements IteratorAggregate<int, Type>
+ */
+abstract class AggregatedType implements Type, IteratorAggregate
+{
+ /**
+ * @psalm-allow-private-mutation
+ * @var array<int, Type>
+ */
+ private $types = [];
+
+ /** @var string */
+ private $token;
+
+ /**
+ * @param array<Type> $types
+ */
+ public function __construct(array $types, string $token)
+ {
+ foreach ($types as $type) {
+ $this->add($type);
+ }
+
+ $this->token = $token;
+ }
+
+ /**
+ * Returns the type at the given index.
+ */
+ public function get(int $index): ?Type
+ {
+ if (!$this->has($index)) {
+ return null;
+ }
+
+ return $this->types[$index];
+ }
+
+ /**
+ * Tests if this compound type has a type with the given index.
+ */
+ public function has(int $index): bool
+ {
+ return array_key_exists($index, $this->types);
+ }
+
+ /**
+ * Tests if this compound type contains the given type.
+ */
+ public function contains(Type $type): bool
+ {
+ foreach ($this->types as $typePart) {
+ // if the type is duplicate; do not add it
+ if ((string) $typePart === (string) $type) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return implode($this->token, $this->types);
+ }
+
+ /**
+ * @return ArrayIterator<int, Type>
+ */
+ public function getIterator(): ArrayIterator
+ {
+ return new ArrayIterator($this->types);
+ }
+
+ /**
+ * @psalm-suppress ImpureMethodCall
+ */
+ private function add(Type $type): void
+ {
+ if ($type instanceof self) {
+ foreach ($type->getIterator() as $subType) {
+ $this->add($subType);
+ }
+
+ return;
+ }
+
+ // if the type is duplicate; do not add it
+ if ($this->contains($type)) {
+ return;
+ }
+
+ $this->types[] = $type;
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php b/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php
new file mode 100644
index 000000000..cf86df007
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php
@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\PseudoType;
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing a array-key Type.
+ *
+ * A array-key Type is the supertype (but not a union) of int and string.
+ *
+ * @psalm-immutable
+ */
+final class ArrayKey extends AggregatedType implements PseudoType
+{
+ public function __construct()
+ {
+ parent::__construct([new String_(), new Integer()], '|');
+ }
+
+ public function underlyingType(): Type
+ {
+ return new Compound([new String_(), new Integer()]);
+ }
+
+ public function __toString(): string
+ {
+ return 'array-key';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Array_.php b/vendor/phpdocumentor/type-resolver/src/Types/Array_.php
new file mode 100644
index 000000000..bc17225f5
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Array_.php
@@ -0,0 +1,29 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+/**
+ * Represents an array type as described in the PSR-5, the PHPDoc Standard.
+ *
+ * An array can be represented in two forms:
+ *
+ * 1. Untyped (`array`), where the key and value type is unknown and hence classified as 'Mixed_'.
+ * 2. Types (`string[]`), where the value type is provided by preceding an opening and closing square bracket with a
+ * type name.
+ *
+ * @psalm-immutable
+ */
+class Array_ extends AbstractList
+{
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Boolean.php b/vendor/phpdocumentor/type-resolver/src/Types/Boolean.php
new file mode 100644
index 000000000..8b1a3f34e
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Boolean.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing a Boolean type.
+ *
+ * @psalm-immutable
+ */
+class Boolean implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'bool';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Callable_.php b/vendor/phpdocumentor/type-resolver/src/Types/Callable_.php
new file mode 100644
index 000000000..4e67aa4a0
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Callable_.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing a Callable type.
+ *
+ * @psalm-immutable
+ */
+final class Callable_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'callable';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ClassString.php b/vendor/phpdocumentor/type-resolver/src/Types/ClassString.php
new file mode 100644
index 000000000..fbdd879bb
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/ClassString.php
@@ -0,0 +1,62 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Fqsen;
+use phpDocumentor\Reflection\PseudoType;
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the type 'string'.
+ *
+ * @psalm-immutable
+ */
+final class ClassString extends String_ implements PseudoType
+{
+ /** @var Fqsen|null */
+ private $fqsen;
+
+ /**
+ * Initializes this representation of a class string with the given Fqsen.
+ */
+ public function __construct(?Fqsen $fqsen = null)
+ {
+ $this->fqsen = $fqsen;
+ }
+
+ public function underlyingType(): Type
+ {
+ return new String_();
+ }
+
+ /**
+ * Returns the FQSEN associated with this object.
+ */
+ public function getFqsen(): ?Fqsen
+ {
+ return $this->fqsen;
+ }
+
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ if ($this->fqsen === null) {
+ return 'class-string';
+ }
+
+ return 'class-string<' . (string) $this->fqsen . '>';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Collection.php b/vendor/phpdocumentor/type-resolver/src/Types/Collection.php
new file mode 100644
index 000000000..943cc22e5
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Collection.php
@@ -0,0 +1,68 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Fqsen;
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Represents a collection type as described in the PSR-5, the PHPDoc Standard.
+ *
+ * A collection can be represented in two forms:
+ *
+ * 1. `ACollectionObject<aValueType>`
+ * 2. `ACollectionObject<aValueType,aKeyType>`
+ *
+ * - ACollectionObject can be 'array' or an object that can act as an array
+ * - aValueType and aKeyType can be any type expression
+ *
+ * @psalm-immutable
+ */
+final class Collection extends AbstractList
+{
+ /** @var Fqsen|null */
+ private $fqsen;
+
+ /**
+ * Initializes this representation of an array with the given Type or Fqsen.
+ */
+ public function __construct(?Fqsen $fqsen, Type $valueType, ?Type $keyType = null)
+ {
+ parent::__construct($valueType, $keyType);
+
+ $this->fqsen = $fqsen;
+ }
+
+ /**
+ * Returns the FQSEN associated with this object.
+ */
+ public function getFqsen(): ?Fqsen
+ {
+ return $this->fqsen;
+ }
+
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ $objectType = (string) ($this->fqsen ?? 'object');
+
+ if ($this->keyType === null) {
+ return $objectType . '<' . $this->valueType . '>';
+ }
+
+ return $objectType . '<' . $this->keyType . ',' . $this->valueType . '>';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Compound.php b/vendor/phpdocumentor/type-resolver/src/Types/Compound.php
new file mode 100644
index 000000000..ad426cc2c
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Compound.php
@@ -0,0 +1,38 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing a Compound Type.
+ *
+ * A Compound Type is not so much a special keyword or object reference but is a series of Types that are separated
+ * using an OR operator (`|`). This combination of types signifies that whatever is associated with this compound type
+ * may contain a value with any of the given types.
+ *
+ * @psalm-immutable
+ */
+final class Compound extends AggregatedType
+{
+ /**
+ * Initializes a compound type (i.e. `string|int`) and tests if the provided types all implement the Type interface.
+ *
+ * @param array<Type> $types
+ */
+ public function __construct(array $types)
+ {
+ parent::__construct($types, '|');
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Context.php b/vendor/phpdocumentor/type-resolver/src/Types/Context.php
new file mode 100644
index 000000000..79aadaf88
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Context.php
@@ -0,0 +1,95 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use function strlen;
+use function substr;
+use function trim;
+
+/**
+ * Provides information about the Context in which the DocBlock occurs that receives this context.
+ *
+ * A DocBlock does not know of its own accord in which namespace it occurs and which namespace aliases are applicable
+ * for the block of code in which it is in. This information is however necessary to resolve Class names in tags since
+ * you can provide a short form or make use of namespace aliases.
+ *
+ * The phpDocumentor Reflection component knows how to create this class but if you use the DocBlock parser from your
+ * own application it is possible to generate a Context class using the ContextFactory; this will analyze the file in
+ * which an associated class resides for its namespace and imports.
+ *
+ * @see ContextFactory::createFromClassReflector()
+ * @see ContextFactory::createForNamespace()
+ *
+ * @psalm-immutable
+ */
+final class Context
+{
+ /** @var string The current namespace. */
+ private $namespace;
+
+ /**
+ * @var string[] List of namespace aliases => Fully Qualified Namespace.
+ * @psalm-var array<string, string>
+ */
+ private $namespaceAliases;
+
+ /**
+ * Initializes the new context and normalizes all passed namespaces to be in Qualified Namespace Name (QNN)
+ * format (without a preceding `\`).
+ *
+ * @param string $namespace The namespace where this DocBlock resides in.
+ * @param string[] $namespaceAliases List of namespace aliases => Fully Qualified Namespace.
+ * @psalm-param array<string, string> $namespaceAliases
+ */
+ public function __construct(string $namespace, array $namespaceAliases = [])
+ {
+ $this->namespace = $namespace !== 'global' && $namespace !== 'default'
+ ? trim($namespace, '\\')
+ : '';
+
+ foreach ($namespaceAliases as $alias => $fqnn) {
+ if ($fqnn[0] === '\\') {
+ $fqnn = substr($fqnn, 1);
+ }
+
+ if ($fqnn[strlen($fqnn) - 1] === '\\') {
+ $fqnn = substr($fqnn, 0, -1);
+ }
+
+ $namespaceAliases[$alias] = $fqnn;
+ }
+
+ $this->namespaceAliases = $namespaceAliases;
+ }
+
+ /**
+ * Returns the Qualified Namespace Name (thus without `\` in front) where the associated element is in.
+ */
+ public function getNamespace(): string
+ {
+ return $this->namespace;
+ }
+
+ /**
+ * Returns a list of Qualified Namespace Names (thus without `\` in front) that are imported, the keys represent
+ * the alias for the imported Namespace.
+ *
+ * @return string[]
+ * @psalm-return array<string, string>
+ */
+ public function getNamespaceAliases(): array
+ {
+ return $this->namespaceAliases;
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php
new file mode 100644
index 000000000..892ee0f90
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php
@@ -0,0 +1,420 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use ArrayIterator;
+use InvalidArgumentException;
+use ReflectionClass;
+use ReflectionClassConstant;
+use ReflectionMethod;
+use ReflectionParameter;
+use ReflectionProperty;
+use Reflector;
+use RuntimeException;
+use UnexpectedValueException;
+
+use function define;
+use function defined;
+use function file_exists;
+use function file_get_contents;
+use function get_class;
+use function in_array;
+use function is_string;
+use function strrpos;
+use function substr;
+use function token_get_all;
+use function trim;
+
+use const T_AS;
+use const T_CLASS;
+use const T_CURLY_OPEN;
+use const T_DOLLAR_OPEN_CURLY_BRACES;
+use const T_NAME_FULLY_QUALIFIED;
+use const T_NAME_QUALIFIED;
+use const T_NAMESPACE;
+use const T_NS_SEPARATOR;
+use const T_STRING;
+use const T_USE;
+
+if (!defined('T_NAME_QUALIFIED')) {
+ define('T_NAME_QUALIFIED', 'T_NAME_QUALIFIED');
+}
+
+if (!defined('T_NAME_FULLY_QUALIFIED')) {
+ define('T_NAME_FULLY_QUALIFIED', 'T_NAME_FULLY_QUALIFIED');
+}
+
+/**
+ * Convenience class to create a Context for DocBlocks when not using the Reflection Component of phpDocumentor.
+ *
+ * For a DocBlock to be able to resolve types that use partial namespace names or rely on namespace imports we need to
+ * provide a bit of context so that the DocBlock can read that and based on it decide how to resolve the types to
+ * Fully Qualified names.
+ *
+ * @see Context for more information.
+ */
+final class ContextFactory
+{
+ /** The literal used at the end of a use statement. */
+ private const T_LITERAL_END_OF_USE = ';';
+
+ /** The literal used between sets of use statements */
+ private const T_LITERAL_USE_SEPARATOR = ',';
+
+ /**
+ * Build a Context given a Class Reflection.
+ *
+ * @see Context for more information on Contexts.
+ */
+ public function createFromReflector(Reflector $reflector): Context
+ {
+ if ($reflector instanceof ReflectionClass) {
+ //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable
+ /** @var ReflectionClass<object> $reflector */
+
+ return $this->createFromReflectionClass($reflector);
+ }
+
+ if ($reflector instanceof ReflectionParameter) {
+ return $this->createFromReflectionParameter($reflector);
+ }
+
+ if ($reflector instanceof ReflectionMethod) {
+ return $this->createFromReflectionMethod($reflector);
+ }
+
+ if ($reflector instanceof ReflectionProperty) {
+ return $this->createFromReflectionProperty($reflector);
+ }
+
+ if ($reflector instanceof ReflectionClassConstant) {
+ return $this->createFromReflectionClassConstant($reflector);
+ }
+
+ throw new UnexpectedValueException('Unhandled \Reflector instance given: ' . get_class($reflector));
+ }
+
+ private function createFromReflectionParameter(ReflectionParameter $parameter): Context
+ {
+ $class = $parameter->getDeclaringClass();
+ if (!$class) {
+ throw new InvalidArgumentException('Unable to get class of ' . $parameter->getName());
+ }
+
+ return $this->createFromReflectionClass($class);
+ }
+
+ private function createFromReflectionMethod(ReflectionMethod $method): Context
+ {
+ $class = $method->getDeclaringClass();
+
+ return $this->createFromReflectionClass($class);
+ }
+
+ private function createFromReflectionProperty(ReflectionProperty $property): Context
+ {
+ $class = $property->getDeclaringClass();
+
+ return $this->createFromReflectionClass($class);
+ }
+
+ private function createFromReflectionClassConstant(ReflectionClassConstant $constant): Context
+ {
+ //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable
+ /** @phpstan-var ReflectionClass<object> $class */
+ $class = $constant->getDeclaringClass();
+
+ return $this->createFromReflectionClass($class);
+ }
+
+ /**
+ * @phpstan-param ReflectionClass<object> $class
+ */
+ private function createFromReflectionClass(ReflectionClass $class): Context
+ {
+ $fileName = $class->getFileName();
+ $namespace = $class->getNamespaceName();
+
+ if (is_string($fileName) && file_exists($fileName)) {
+ $contents = file_get_contents($fileName);
+ if ($contents === false) {
+ throw new RuntimeException('Unable to read file "' . $fileName . '"');
+ }
+
+ return $this->createForNamespace($namespace, $contents);
+ }
+
+ return new Context($namespace, []);
+ }
+
+ /**
+ * Build a Context for a namespace in the provided file contents.
+ *
+ * @see Context for more information on Contexts.
+ *
+ * @param string $namespace It does not matter if a `\` precedes the namespace name,
+ * this method first normalizes.
+ * @param string $fileContents The file's contents to retrieve the aliases from with the given namespace.
+ */
+ public function createForNamespace(string $namespace, string $fileContents): Context
+ {
+ $namespace = trim($namespace, '\\');
+ $useStatements = [];
+ $currentNamespace = '';
+ $tokens = new ArrayIterator(token_get_all($fileContents));
+
+ while ($tokens->valid()) {
+ $currentToken = $tokens->current();
+ switch ($currentToken[0]) {
+ case T_NAMESPACE:
+ $currentNamespace = $this->parseNamespace($tokens);
+ break;
+ case T_CLASS:
+ // Fast-forward the iterator through the class so that any
+ // T_USE tokens found within are skipped - these are not
+ // valid namespace use statements so should be ignored.
+ $braceLevel = 0;
+ $firstBraceFound = false;
+ while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) {
+ $currentToken = $tokens->current();
+ if (
+ $currentToken === '{'
+ || in_array($currentToken[0], [T_CURLY_OPEN, T_DOLLAR_OPEN_CURLY_BRACES], true)
+ ) {
+ if (!$firstBraceFound) {
+ $firstBraceFound = true;
+ }
+
+ ++$braceLevel;
+ }
+
+ if ($currentToken === '}') {
+ --$braceLevel;
+ }
+
+ $tokens->next();
+ }
+
+ break;
+ case T_USE:
+ if ($currentNamespace === $namespace) {
+ $useStatements += $this->parseUseStatement($tokens);
+ }
+
+ break;
+ }
+
+ $tokens->next();
+ }
+
+ return new Context($namespace, $useStatements);
+ }
+
+ /**
+ * Deduce the name from tokens when we are at the T_NAMESPACE token.
+ *
+ * @param ArrayIterator<int, string|array{0:int,1:string,2:int}> $tokens
+ */
+ private function parseNamespace(ArrayIterator $tokens): string
+ {
+ // skip to the first string or namespace separator
+ $this->skipToNextStringOrNamespaceSeparator($tokens);
+
+ $name = '';
+ $acceptedTokens = [T_STRING, T_NS_SEPARATOR, T_NAME_QUALIFIED];
+ while ($tokens->valid() && in_array($tokens->current()[0], $acceptedTokens, true)) {
+ $name .= $tokens->current()[1];
+ $tokens->next();
+ }
+
+ return $name;
+ }
+
+ /**
+ * Deduce the names of all imports when we are at the T_USE token.
+ *
+ * @param ArrayIterator<int, string|array{0:int,1:string,2:int}> $tokens
+ *
+ * @return string[]
+ * @psalm-return array<string, string>
+ */
+ private function parseUseStatement(ArrayIterator $tokens): array
+ {
+ $uses = [];
+
+ while ($tokens->valid()) {
+ $this->skipToNextStringOrNamespaceSeparator($tokens);
+
+ $uses += $this->extractUseStatements($tokens);
+ $currentToken = $tokens->current();
+ if ($currentToken[0] === self::T_LITERAL_END_OF_USE) {
+ return $uses;
+ }
+ }
+
+ return $uses;
+ }
+
+ /**
+ * Fast-forwards the iterator as longs as we don't encounter a T_STRING or T_NS_SEPARATOR token.
+ *
+ * @param ArrayIterator<int, string|array{0:int,1:string,2:int}> $tokens
+ */
+ private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens): void
+ {
+ while ($tokens->valid()) {
+ $currentToken = $tokens->current();
+ if (in_array($currentToken[0], [T_STRING, T_NS_SEPARATOR], true)) {
+ break;
+ }
+
+ if ($currentToken[0] === T_NAME_QUALIFIED) {
+ break;
+ }
+
+ if (defined('T_NAME_FULLY_QUALIFIED') && $currentToken[0] === T_NAME_FULLY_QUALIFIED) {
+ break;
+ }
+
+ $tokens->next();
+ }
+ }
+
+ /**
+ * Deduce the namespace name and alias of an import when we are at the T_USE token or have not reached the end of
+ * a USE statement yet. This will return a key/value array of the alias => namespace.
+ *
+ * @param ArrayIterator<int, string|array{0:int,1:string,2:int}> $tokens
+ *
+ * @return string[]
+ * @psalm-return array<string, string>
+ *
+ * @psalm-suppress TypeDoesNotContainType
+ */
+ private function extractUseStatements(ArrayIterator $tokens): array
+ {
+ $extractedUseStatements = [];
+ $groupedNs = '';
+ $currentNs = '';
+ $currentAlias = '';
+ $state = 'start';
+
+ while ($tokens->valid()) {
+ $currentToken = $tokens->current();
+ $tokenId = is_string($currentToken) ? $currentToken : $currentToken[0];
+ $tokenValue = is_string($currentToken) ? null : $currentToken[1];
+ switch ($state) {
+ case 'start':
+ switch ($tokenId) {
+ case T_STRING:
+ case T_NS_SEPARATOR:
+ $currentNs .= (string) $tokenValue;
+ $currentAlias = $tokenValue;
+ break;
+ case T_NAME_QUALIFIED:
+ case T_NAME_FULLY_QUALIFIED:
+ $currentNs .= (string) $tokenValue;
+ $currentAlias = substr(
+ (string) $tokenValue,
+ (int) (strrpos((string) $tokenValue, '\\')) + 1
+ );
+ break;
+ case T_CURLY_OPEN:
+ case '{':
+ $state = 'grouped';
+ $groupedNs = $currentNs;
+ break;
+ case T_AS:
+ $state = 'start-alias';
+ break;
+ case self::T_LITERAL_USE_SEPARATOR:
+ case self::T_LITERAL_END_OF_USE:
+ $state = 'end';
+ break;
+ default:
+ break;
+ }
+
+ break;
+ case 'start-alias':
+ switch ($tokenId) {
+ case T_STRING:
+ $currentAlias = $tokenValue;
+ break;
+ case self::T_LITERAL_USE_SEPARATOR:
+ case self::T_LITERAL_END_OF_USE:
+ $state = 'end';
+ break;
+ default:
+ break;
+ }
+
+ break;
+ case 'grouped':
+ switch ($tokenId) {
+ case T_STRING:
+ case T_NS_SEPARATOR:
+ $currentNs .= (string) $tokenValue;
+ $currentAlias = $tokenValue;
+ break;
+ case T_AS:
+ $state = 'grouped-alias';
+ break;
+ case self::T_LITERAL_USE_SEPARATOR:
+ $state = 'grouped';
+ $extractedUseStatements[(string) $currentAlias] = $currentNs;
+ $currentNs = $groupedNs;
+ $currentAlias = '';
+ break;
+ case self::T_LITERAL_END_OF_USE:
+ $state = 'end';
+ break;
+ default:
+ break;
+ }
+
+ break;
+ case 'grouped-alias':
+ switch ($tokenId) {
+ case T_STRING:
+ $currentAlias = $tokenValue;
+ break;
+ case self::T_LITERAL_USE_SEPARATOR:
+ $state = 'grouped';
+ $extractedUseStatements[(string) $currentAlias] = $currentNs;
+ $currentNs = $groupedNs;
+ $currentAlias = '';
+ break;
+ case self::T_LITERAL_END_OF_USE:
+ $state = 'end';
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ($state === 'end') {
+ break;
+ }
+
+ $tokens->next();
+ }
+
+ if ($groupedNs !== $currentNs) {
+ $extractedUseStatements[(string) $currentAlias] = $currentNs;
+ }
+
+ return $extractedUseStatements;
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Expression.php b/vendor/phpdocumentor/type-resolver/src/Types/Expression.php
new file mode 100644
index 000000000..da5f65d59
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Expression.php
@@ -0,0 +1,51 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Represents an expression type as described in the PSR-5, the PHPDoc Standard.
+ *
+ * @psalm-immutable
+ */
+final class Expression implements Type
+{
+ /** @var Type */
+ protected $valueType;
+
+ /**
+ * Initializes this representation of an array with the given Type.
+ */
+ public function __construct(Type $valueType)
+ {
+ $this->valueType = $valueType;
+ }
+
+ /**
+ * Returns the value for the keys of this array.
+ */
+ public function getValueType(): Type
+ {
+ return $this->valueType;
+ }
+
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return '(' . $this->valueType . ')';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Float_.php b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php
new file mode 100644
index 000000000..86138c0e7
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing a Float.
+ *
+ * @psalm-immutable
+ */
+final class Float_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'float';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Integer.php b/vendor/phpdocumentor/type-resolver/src/Types/Integer.php
new file mode 100644
index 000000000..10ce3c58c
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Integer.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value object representing Integer type
+ *
+ * @psalm-immutable
+ */
+class Integer implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'int';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php b/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php
new file mode 100644
index 000000000..9836961fd
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php
@@ -0,0 +1,56 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Fqsen;
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the type 'string'.
+ *
+ * @psalm-immutable
+ */
+final class InterfaceString implements Type
+{
+ /** @var Fqsen|null */
+ private $fqsen;
+
+ /**
+ * Initializes this representation of a class string with the given Fqsen.
+ */
+ public function __construct(?Fqsen $fqsen = null)
+ {
+ $this->fqsen = $fqsen;
+ }
+
+ /**
+ * Returns the FQSEN associated with this object.
+ */
+ public function getFqsen(): ?Fqsen
+ {
+ return $this->fqsen;
+ }
+
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ if ($this->fqsen === null) {
+ return 'interface-string';
+ }
+
+ return 'interface-string<' . (string) $this->fqsen . '>';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php b/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php
new file mode 100644
index 000000000..ced37b626
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Intersection.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+declare(strict_types=1);
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing a Compound Type.
+ *
+ * A Intersection Type is not so much a special keyword or object reference but is a series of Types that are separated
+ * using an AND operator (`&`). This combination of types signifies that whatever is associated with this Intersection
+ * type may contain a value with any of the given types.
+ *
+ * @psalm-immutable
+ */
+final class Intersection extends AggregatedType
+{
+ /**
+ * Initializes a intersection type (i.e. `\A&\B`) and tests if the provided types all implement the Type interface.
+ *
+ * @param array<Type> $types
+ */
+ public function __construct(array $types)
+ {
+ parent::__construct($types, '&');
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php b/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php
new file mode 100644
index 000000000..1ca069f2e
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php
@@ -0,0 +1,38 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+/**
+ * Value Object representing iterable type
+ *
+ * @psalm-immutable
+ */
+final class Iterable_ extends AbstractList
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ if ($this->keyType) {
+ return 'iterable<' . $this->keyType . ',' . $this->valueType . '>';
+ }
+
+ if ($this->valueType instanceof Mixed_) {
+ return 'iterable';
+ }
+
+ return 'iterable<' . $this->valueType . '>';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php b/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php
new file mode 100644
index 000000000..56d1b6dab
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing an unknown, or mixed, type.
+ *
+ * @psalm-immutable
+ */
+final class Mixed_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'mixed';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Never_.php b/vendor/phpdocumentor/type-resolver/src/Types/Never_.php
new file mode 100644
index 000000000..40a99c9ad
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Never_.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the return-type 'never'.
+ *
+ * Never is generally only used when working with return types as it signifies that the method that only
+ * ever throw or exit.
+ *
+ * @psalm-immutable
+ */
+final class Never_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'never';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Null_.php b/vendor/phpdocumentor/type-resolver/src/Types/Null_.php
new file mode 100644
index 000000000..7ae802c4c
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Null_.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing a null value or type.
+ *
+ * @psalm-immutable
+ */
+final class Null_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'null';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Nullable.php b/vendor/phpdocumentor/type-resolver/src/Types/Nullable.php
new file mode 100644
index 000000000..a94693507
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Nullable.php
@@ -0,0 +1,51 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing a nullable type. The real type is wrapped.
+ *
+ * @psalm-immutable
+ */
+final class Nullable implements Type
+{
+ /** @var Type The actual type that is wrapped */
+ private $realType;
+
+ /**
+ * Initialises this nullable type using the real type embedded
+ */
+ public function __construct(Type $realType)
+ {
+ $this->realType = $realType;
+ }
+
+ /**
+ * Provide access to the actual type directly, if needed.
+ */
+ public function getActualType(): Type
+ {
+ return $this->realType;
+ }
+
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return '?' . $this->realType->__toString();
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Object_.php b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php
new file mode 100644
index 000000000..90dee57ac
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php
@@ -0,0 +1,69 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use InvalidArgumentException;
+use phpDocumentor\Reflection\Fqsen;
+use phpDocumentor\Reflection\Type;
+
+use function strpos;
+
+/**
+ * Value Object representing an object.
+ *
+ * An object can be either typed or untyped. When an object is typed it means that it has an identifier, the FQSEN,
+ * pointing to an element in PHP. Object types that are untyped do not refer to a specific class but represent objects
+ * in general.
+ *
+ * @psalm-immutable
+ */
+final class Object_ implements Type
+{
+ /** @var Fqsen|null */
+ private $fqsen;
+
+ /**
+ * Initializes this object with an optional FQSEN, if not provided this object is considered 'untyped'.
+ *
+ * @throws InvalidArgumentException When provided $fqsen is not a valid type.
+ */
+ public function __construct(?Fqsen $fqsen = null)
+ {
+ if (strpos((string) $fqsen, '::') !== false || strpos((string) $fqsen, '()') !== false) {
+ throw new InvalidArgumentException(
+ 'Object types can only refer to a class, interface or trait but a method, function, constant or '
+ . 'property was received: ' . (string) $fqsen
+ );
+ }
+
+ $this->fqsen = $fqsen;
+ }
+
+ /**
+ * Returns the FQSEN associated with this object.
+ */
+ public function getFqsen(): ?Fqsen
+ {
+ return $this->fqsen;
+ }
+
+ public function __toString(): string
+ {
+ if ($this->fqsen) {
+ return (string) $this->fqsen;
+ }
+
+ return 'object';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php b/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php
new file mode 100644
index 000000000..348385991
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php
@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the 'parent' type.
+ *
+ * Parent, as a Type, represents the parent class of class in which the associated element was defined.
+ *
+ * @psalm-immutable
+ */
+final class Parent_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'parent';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php b/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php
new file mode 100644
index 000000000..1998ee0ad
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the 'resource' Type.
+ *
+ * @psalm-immutable
+ */
+final class Resource_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'resource';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php b/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php
new file mode 100644
index 000000000..80241c21e
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the 'scalar' pseudo-type, which is either a string, integer, float or boolean.
+ *
+ * @psalm-immutable
+ */
+final class Scalar implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'scalar';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Self_.php b/vendor/phpdocumentor/type-resolver/src/Types/Self_.php
new file mode 100644
index 000000000..5096126e5
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Self_.php
@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the 'self' type.
+ *
+ * Self, as a Type, represents the class in which the associated element was defined.
+ *
+ * @psalm-immutable
+ */
+final class Self_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'self';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Static_.php b/vendor/phpdocumentor/type-resolver/src/Types/Static_.php
new file mode 100644
index 000000000..6fe365ff1
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Static_.php
@@ -0,0 +1,39 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the 'static' type.
+ *
+ * Self, as a Type, represents the class in which the associated element was called. This differs from self as self does
+ * not take inheritance into account but static means that the return type is always that of the class of the called
+ * element.
+ *
+ * See the documentation on late static binding in the PHP Documentation for more information on the difference between
+ * static and self.
+ *
+ * @psalm-immutable
+ */
+final class Static_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'static';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/String_.php b/vendor/phpdocumentor/type-resolver/src/Types/String_.php
new file mode 100644
index 000000000..a4bb47f1a
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/String_.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the type 'string'.
+ *
+ * @psalm-immutable
+ */
+class String_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'string';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/This.php b/vendor/phpdocumentor/type-resolver/src/Types/This.php
new file mode 100644
index 000000000..602fc698f
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/This.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the '$this' pseudo-type.
+ *
+ * $this, as a Type, represents the instance of the class associated with the element as it was called. $this is
+ * commonly used when documenting fluent interfaces since it represents that the same object is returned.
+ *
+ * @psalm-immutable
+ */
+final class This implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return '$this';
+ }
+}
diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Void_.php b/vendor/phpdocumentor/type-resolver/src/Types/Void_.php
new file mode 100644
index 000000000..23a601d47
--- /dev/null
+++ b/vendor/phpdocumentor/type-resolver/src/Types/Void_.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of phpDocumentor.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\Types;
+
+use phpDocumentor\Reflection\Type;
+
+/**
+ * Value Object representing the return-type 'void'.
+ *
+ * Void is generally only used when working with return types as it signifies that the method intentionally does not
+ * return any value.
+ *
+ * @psalm-immutable
+ */
+final class Void_ implements Type
+{
+ /**
+ * Returns a rendered output of the Type as it would be used in a DocBlock.
+ */
+ public function __toString(): string
+ {
+ return 'void';
+ }
+}