StaticReflectionProperty.php 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. *
  15. * This software consists of voluntary contributions made by many individuals
  16. * and is licensed under the MIT license. For more information, see
  17. * <http://www.doctrine-project.org>.
  18. */
  19. namespace Doctrine\Common\Reflection;
  20. use ReflectionProperty;
  21. use ReflectionException;
  22. class StaticReflectionProperty extends ReflectionProperty
  23. {
  24. /**
  25. * The PSR-0 parser object.
  26. *
  27. * @var StaticReflectionParser
  28. */
  29. protected $staticReflectionParser;
  30. /**
  31. * The name of the property.
  32. *
  33. * @var string
  34. */
  35. protected $propertyName;
  36. public function __construct(StaticReflectionParser $staticReflectionParser, $propertyName)
  37. {
  38. $this->staticReflectionParser = $staticReflectionParser;
  39. $this->propertyName = $propertyName;
  40. }
  41. public function getName()
  42. {
  43. return $this->propertyName;
  44. }
  45. protected function getStaticReflectionParser()
  46. {
  47. return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('property', $this->propertyName);
  48. }
  49. public function getDeclaringClass()
  50. {
  51. return $this->getStaticReflectionParser()->getReflectionClass();
  52. }
  53. public function getDocComment()
  54. {
  55. return $this->getStaticReflectionParser()->getDocComment('property', $this->propertyName);
  56. }
  57. public function getUseStatements()
  58. {
  59. return $this->getStaticReflectionParser()->getUseStatements();
  60. }
  61. public static function export ($class, $name, $return = false) { throw new ReflectionException('Method not implemented'); }
  62. public function getModifiers() { throw new ReflectionException('Method not implemented'); }
  63. public function getValue($object = NULL) { throw new ReflectionException('Method not implemented'); }
  64. public function isDefault() { throw new ReflectionException('Method not implemented'); }
  65. public function isPrivate() { throw new ReflectionException('Method not implemented'); }
  66. public function isProtected() { throw new ReflectionException('Method not implemented'); }
  67. public function isPublic() { throw new ReflectionException('Method not implemented'); }
  68. public function isStatic() { throw new ReflectionException('Method not implemented'); }
  69. public function setAccessible ($accessible) { throw new ReflectionException('Method not implemented'); }
  70. public function setValue ($object, $value = NULL) { throw new ReflectionException('Method not implemented'); }
  71. public function __toString() { throw new ReflectionException('Method not implemented'); }
  72. }