| 1: | <?php declare(strict_types = 1); |
| 2: | |
| 3: | namespace PHPStan\PhpDocParser\Ast\Type; |
| 4: | |
| 5: | /** |
| 6: | * A class-like name, as opposed to a keyword like `int`, `mixed` or |
| 7: | * `non-falsy-string`, which is an IdentifierTypeNode. |
| 8: | * |
| 9: | * The parser never produces name nodes, because it does not know which |
| 10: | * identifiers are keywords. They are created by tools that do, for example |
| 11: | * when turning a resolved type back into a PHPDoc node. |
| 12: | */ |
| 13: | interface NameNode extends TypeNode |
| 14: | { |
| 15: | |
| 16: | /** |
| 17: | * The name without a leading backslash, e.g. Foo\Bar. |
| 18: | */ |
| 19: | public function toString(): string; |
| 20: | |
| 21: | /** |
| 22: | * The name as written in PHPDoc, e.g. \Foo\Bar or Bar. |
| 23: | */ |
| 24: | public function toCodeString(): string; |
| 25: | |
| 26: | /** |
| 27: | * @return non-empty-list<string> |
| 28: | */ |
| 29: | public function getParts(): array; |
| 30: | |
| 31: | public function getFirst(): string; |
| 32: | |
| 33: | public function getLast(): string; |
| 34: | |
| 35: | public function isFullyQualified(): bool; |
| 36: | |
| 37: | } |
| 38: |