PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
wpide / vendor / nikic / php-parser / lib / PhpParser / Node / Identifier.php

Identifier.php in WPIDE – File Manager & Code Editor 3.5.9, at vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php

76 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php declare(strict_types=1);
2
3 namespace PhpParser\Node;
4
5 use PhpParser\NodeAbstract;
6
7 /**
8 * Represents a non-namespaced name. Namespaced names are represented using Name nodes.
9 */
10 class Identifier extends NodeAbstract
11 {
12 /** @var string Identifier as string */
13 public $name;
14
15 private static $specialClassNames = [
16 'self' => true,
17 'parent' => true,
18 'static' => true,
19 ];
20
21 /**
22 * Constructs an identifier node.
23 *
24 * @param string $name Identifier as string
25 * @param array $attributes Additional attributes
26 */
27 public function __construct(string $name, array $attributes = []) {
28 $this->attributes = $attributes;
29 $this->name = $name;
30 }
31
32 public function getSubNodeNames() : array {
33 return ['name'];
34 }
35
36 /**
37 * Get identifier as string.
38 *
39 * @return string Identifier as string.
40 */
41 public function toString() : string {
42 return $this->name;
43 }
44
45 /**
46 * Get lowercased identifier as string.
47 *
48 * @return string Lowercased identifier as string
49 */
50 public function toLowerString() : string {
51 return strtolower($this->name);
52 }
53
54 /**
55 * Checks whether the identifier is a special class name (self, parent or static).
56 *
57 * @return bool Whether identifier is a special class name
58 */
59 public function isSpecialClassName() : bool {
60 return isset(self::$specialClassNames[strtolower($this->name)]);
61 }
62
63 /**
64 * Get identifier as string.
65 *
66 * @return string Identifier as string
67 */
68 public function __toString() : string {
69 return $this->name;
70 }
71
72 public function getType() : string {
73 return 'Identifier';
74 }
75 }
76