FullyQualified.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Name;
  3. class FullyQualified extends \PhpParser\Node\Name {
  4. /**
  5. * Checks whether the name is unqualified. (E.g. Name)
  6. *
  7. * @return bool Whether the name is unqualified
  8. */
  9. public function isUnqualified(): bool {
  10. return false;
  11. }
  12. /**
  13. * Checks whether the name is qualified. (E.g. Name\Name)
  14. *
  15. * @return bool Whether the name is qualified
  16. */
  17. public function isQualified(): bool {
  18. return false;
  19. }
  20. /**
  21. * Checks whether the name is fully qualified. (E.g. \Name)
  22. *
  23. * @return bool Whether the name is fully qualified
  24. */
  25. public function isFullyQualified(): bool {
  26. return true;
  27. }
  28. /**
  29. * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name)
  30. *
  31. * @return bool Whether the name is relative
  32. */
  33. public function isRelative(): bool {
  34. return false;
  35. }
  36. public function toCodeString(): string {
  37. return '\\' . $this->toString();
  38. }
  39. public function getType(): string {
  40. return 'Name_FullyQualified';
  41. }
  42. }