123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php declare(strict_types=1);
- namespace PhpParser\Node;
- use PhpParser\NodeAbstract;
- class Identifier extends NodeAbstract {
-
- public string $name;
-
- private static array $specialClassNames = [
- 'self' => true,
- 'parent' => true,
- 'static' => true,
- ];
-
- public function __construct(string $name, array $attributes = []) {
- $this->attributes = $attributes;
- $this->name = $name;
- }
- public function getSubNodeNames(): array {
- return ['name'];
- }
-
- public function toString(): string {
- return $this->name;
- }
-
- public function toLowerString(): string {
- return strtolower($this->name);
- }
-
- public function isSpecialClassName(): bool {
- return isset(self::$specialClassNames[strtolower($this->name)]);
- }
-
- public function __toString(): string {
- return $this->name;
- }
- public function getType(): string {
- return 'Identifier';
- }
- }
|