PhpDocTypeNameResolver
class PhpDocTypeNameResolver
Properties
| protected array<string, array<string, array<string, class-string>>> | $imports |
Methods
Resolve a PHPDoc type name in its declaring class context.
Parse class imports from a PHP source file.
Parse a namespace declaration.
Collect the tokens belonging to one use statement.
Parse one normal or grouped use statement.
Parse comma-separated import entries.
Find the next non-ignorable token.
Join token text without whitespace or comments.
Determine if the type is built into PHP or PHPDoc.
Details
at line 21
string
resolve(string $name, ReflectionClass $class)
Resolve a PHPDoc type name in its declaring class context.
at line 50
protected array
importsFor(ReflectionClass $class)
Get the class imports declared by the source file.
at line 68
protected array
parseImports(string $file)
Parse class imports from a PHP source file.
at line 132
protected array
parseNamespace(array $tokens, int $index)
Parse a namespace declaration.
at line 157
protected array
collectUseStatement(array $tokens, int $index)
Collect the tokens belonging to one use statement.
at line 180
protected array
parseUseStatement(array $tokens)
Parse one normal or grouped use statement.
at line 200
protected array
parseImportEntries(array $tokens, string $prefix = '')
Parse comma-separated import entries.
at line 236
protected PhpToken|null
nextSignificantToken(array $tokens, int $index)
Find the next non-ignorable token.
at line 252
protected string
joinTokenText(array $tokens)
Join token text without whitespace or comments.
at line 268
static protected bool
isBuiltIn(string $type)
Determine if the type is built into PHP or PHPDoc.