+ /**
+ * Returns a string representation of the name as it would occur in code (e.g., including
+ * leading backslash for fully qualified names.
+ *
+ * @return string String representation
+ */
+ public function toCodeString() : string {
+ return $this->toString();
+ }
+
+ /**
+ * Returns lowercased string representation of the name, without taking the name type into
+ * account (e.g., no leading backslash for fully qualified names).
+ *
+ * @return string Lowercased string representation
+ */
+ public function toLowerString() : string {
+ return strtolower(implode('\\', $this->parts));
+ }
+
+ /**
+ * Checks whether the identifier is a special class name (self, parent or static).
+ *
+ * @return bool Whether identifier is a special class name
+ */
+ public function isSpecialClassName() : bool {
+ return count($this->parts) === 1
+ && isset(self::$specialClassNames[strtolower($this->parts[0])]);
+ }
+