StaticReflectionProperty.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?php
  2. namespace Doctrine\Common\Reflection;
  3. use ReflectionException;
  4. use ReflectionProperty;
  5. class StaticReflectionProperty extends ReflectionProperty
  6. {
  7. /**
  8. * The PSR-0 parser object.
  9. *
  10. * @var StaticReflectionParser
  11. */
  12. protected $staticReflectionParser;
  13. /**
  14. * The name of the property.
  15. *
  16. * @var string|null
  17. */
  18. protected $propertyName;
  19. /**
  20. * @param string|null $propertyName
  21. */
  22. public function __construct(StaticReflectionParser $staticReflectionParser, $propertyName)
  23. {
  24. $this->staticReflectionParser = $staticReflectionParser;
  25. $this->propertyName = $propertyName;
  26. }
  27. /**
  28. * {@inheritDoc}
  29. */
  30. public function getName()
  31. {
  32. return $this->propertyName;
  33. }
  34. /**
  35. * @return StaticReflectionParser
  36. */
  37. protected function getStaticReflectionParser()
  38. {
  39. return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('property', $this->propertyName);
  40. }
  41. /**
  42. * {@inheritDoc}
  43. */
  44. public function getDeclaringClass()
  45. {
  46. return $this->getStaticReflectionParser()->getReflectionClass();
  47. }
  48. /**
  49. * {@inheritDoc}
  50. */
  51. public function getDocComment()
  52. {
  53. return $this->getStaticReflectionParser()->getDocComment('property', $this->propertyName);
  54. }
  55. /**
  56. * @return string[]
  57. */
  58. public function getUseStatements()
  59. {
  60. return $this->getStaticReflectionParser()->getUseStatements();
  61. }
  62. /**
  63. * {@inheritDoc}
  64. */
  65. public static function export($class, $name, $return = false)
  66. {
  67. throw new ReflectionException('Method not implemented');
  68. }
  69. /**
  70. * {@inheritDoc}
  71. */
  72. public function getModifiers()
  73. {
  74. throw new ReflectionException('Method not implemented');
  75. }
  76. /**
  77. * {@inheritDoc}
  78. */
  79. public function getValue($object = null)
  80. {
  81. throw new ReflectionException('Method not implemented');
  82. }
  83. /**
  84. * {@inheritDoc}
  85. */
  86. public function isDefault()
  87. {
  88. throw new ReflectionException('Method not implemented');
  89. }
  90. /**
  91. * {@inheritDoc}
  92. */
  93. public function isPrivate()
  94. {
  95. throw new ReflectionException('Method not implemented');
  96. }
  97. /**
  98. * {@inheritDoc}
  99. */
  100. public function isProtected()
  101. {
  102. throw new ReflectionException('Method not implemented');
  103. }
  104. /**
  105. * {@inheritDoc}
  106. */
  107. public function isPublic()
  108. {
  109. throw new ReflectionException('Method not implemented');
  110. }
  111. /**
  112. * {@inheritDoc}
  113. */
  114. public function isStatic()
  115. {
  116. throw new ReflectionException('Method not implemented');
  117. }
  118. /**
  119. * {@inheritDoc}
  120. */
  121. public function setAccessible($accessible)
  122. {
  123. throw new ReflectionException('Method not implemented');
  124. }
  125. /**
  126. * {@inheritDoc}
  127. */
  128. public function setValue($object, $value = null)
  129. {
  130. throw new ReflectionException('Method not implemented');
  131. }
  132. /**
  133. * {@inheritDoc}
  134. */
  135. public function __toString()
  136. {
  137. throw new ReflectionException('Method not implemented');
  138. }
  139. }