Methods |
public __construct(?phpDocumentor Initializes this TypeResolver with the means to create and resolve Fqsen objects. |
public addKeyword(string $keyword, string $typeClassName) : void Adds a keyword to the list of Keywords and associates it with a specific Value Object.
|
public createType(?PHPStan\PhpDocParser\Ast\Type\TypeNode $type, phpDocumentor |
public resolve(string $type, ?phpDocumentor Analyzes the given type and returns the FQCN variant. When a type is provided this method checks whether it is not a keyword or Fully Qualified Class Name. If so it will use the given namespace and aliases to expand the type to a FQCN representation. This method only works as expected if the namespace and aliases are set; no dynamic reflection is being performed here.
|
Constants |
private phpDocumentor
|
Properties |
private $fqsenResolver = NULL
|
private $keywords = ['string' => 'phpDocumentor\Reflection\Types\String_', 'class-string' => 'phpDocumentor\Reflection\Types\ClassString', 'interface-string' => 'phpDocumentor\Reflection\Types\InterfaceString', 'html-escaped-string' => 'phpDocumentor\Reflection\PseudoTypes\HtmlEscapedString', 'lowercase-string' => 'phpDocumentor\Reflection\PseudoTypes\LowercaseString', 'non-empty-lowercase-string' => 'phpDocumentor\Reflection\PseudoTypes\NonEmptyLowercaseString', 'non-empty-string' => 'phpDocumentor\Reflection\PseudoTypes\NonEmptyString', 'numeric-string' => 'phpDocumentor\Reflection\PseudoTypes\NumericString', 'numeric' => 'phpDocumentor\Reflection\PseudoTypes\Numeric_', 'trait-string' => 'phpDocumentor\Reflection\PseudoTypes\TraitString', 'int' => 'phpDocumentor\Reflection\Types\Integer', 'integer' => 'phpDocumentor\Reflection\Types\Integer', 'positive-int' => 'phpDocumentor\Reflection\PseudoTypes\PositiveInteger', 'negative-int' => 'phpDocumentor\Reflection\PseudoTypes\NegativeInteger', 'bool' => 'phpDocumentor\Reflection\Types\Boolean', 'boolean' => 'phpDocumentor\Reflection\Types\Boolean', 'real' => 'phpDocumentor\Reflection\Types\Float_', 'float' => 'phpDocumentor\Reflection\Types\Float_', 'double' => 'phpDocumentor\Reflection\Types\Float_', 'object' => 'phpDocumentor\Reflection\Types\Object_', 'mixed' => 'phpDocumentor\Reflection\Types\Mixed_', 'array' => 'phpDocumentor\Reflection\Types\Array_', 'array-key' => 'phpDocumentor\Reflection\Types\ArrayKey', 'resource' => 'phpDocumentor\Reflection\Types\Resource_', 'void' => 'phpDocumentor\Reflection\Types\Void_', 'null' => 'phpDocumentor\Reflection\Types\Null_', 'scalar' => 'phpDocumentor\Reflection\Types\Scalar', 'callback' => 'phpDocumentor\Reflection\Types\Callable_', 'callable' => 'phpDocumentor\Reflection\Types\Callable_', 'callable-string' => 'phpDocumentor\Reflection\PseudoTypes\CallableString', 'false' => 'phpDocumentor\Reflection\PseudoTypes\False_', 'true' => 'phpDocumentor\Reflection\PseudoTypes\True_', 'literal-string' => 'phpDocumentor\Reflection\PseudoTypes\LiteralString', 'self' => 'phpDocumentor\Reflection\Types\Self_', '$this' => 'phpDocumentor\Reflection\Types\This', 'static' => 'phpDocumentor\Reflection\Types\Static_', 'parent' => 'phpDocumentor\Reflection\Types\Parent_', 'iterable' => 'phpDocumentor\Reflection\Types\Iterable_', 'never' => 'phpDocumentor\Reflection\Types\Never_', 'list' => 'phpDocumentor\Reflection\PseudoTypes\List_', 'non-empty-list' => 'phpDocumentor\Reflection\PseudoTypes\NonEmptyList']
|
private $lexer = NULL
|
private $typeParser = NULL
|
Methods |
private createArray(array $typeNodes, phpDocumentor
|
private createFromCallable(PHPStan\PhpDocParser\Ast\Type\CallableTypeNode $type, phpDocumentor |
private createFromConst(PHPStan\PhpDocParser\Ast\Type\ConstTypeNode $type, phpDocumentor |
private createFromGeneric(PHPStan\PhpDocParser\Ast\Type\GenericTypeNode $type, phpDocumentor |
private isFqsen(string $type) : bool Tests whether the given type is a Fully Qualified Structural Element Name.
|
private isKeyword(string $type) : bool Detects whether the given type represents a PHPDoc keyword.
|
private isPartialStructuralElementName(string $type) : bool Detects whether the given type represents a relative structural element name.
|
private parse(PHPStan\PhpDocParser\Parser\TokenIterator $tokenIterator) : PHPStan\PhpDocParser\Ast\Type\TypeNode |
private resolveKeyword(string $type) : phpDocumentor Resolves the given keyword (such as
|
private resolveSingleType(string $type, phpDocumentor resolve the given type into a type object
|
private resolveTypedObject(string $type, ?phpDocumentor Resolves the given FQSEN string into an FQSEN object.
|
private tryParseRemainingCompoundTypes(PHPStan\PhpDocParser\Parser\TokenIterator $tokenIterator, phpDocumentor Will try to parse unsupported type notations by phpstan The phpstan parser doesn't support the illegal nullable combinations like this library does. This method will warn the user about those notations but for bc purposes we will still have it here. |
private validArrayKeyType(?phpDocumentor |