StaticReflectionMethod.php 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 ReflectionMethod;
  21. use ReflectionException;
  22. class StaticReflectionMethod extends ReflectionMethod
  23. {
  24. /**
  25. * The PSR-0 parser object.
  26. *
  27. * @var StaticReflectionParser
  28. */
  29. protected $staticReflectionParser;
  30. /**
  31. * The name of the method.
  32. *
  33. * @var string
  34. */
  35. protected $methodName;
  36. public function __construct(StaticReflectionParser $staticReflectionParser, $methodName)
  37. {
  38. $this->staticReflectionParser = $staticReflectionParser;
  39. $this->methodName = $methodName;
  40. }
  41. public function getName()
  42. {
  43. return $this->methodName;
  44. }
  45. protected function getStaticReflectionParser()
  46. {
  47. return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('method', $this->methodName);
  48. }
  49. public function getDeclaringClass()
  50. {
  51. return $this->getStaticReflectionParser()->getReflectionClass();
  52. }
  53. public function getNamespaceName()
  54. {
  55. return $this->getStaticReflectionParser()->getNamespaceName();
  56. }
  57. public function getDocComment()
  58. {
  59. return $this->getStaticReflectionParser()->getDocComment('method', $this->methodName);
  60. }
  61. public function getUseStatements()
  62. {
  63. return $this->getStaticReflectionParser()->getUseStatements();
  64. }
  65. public static function export($class, $name, $return = false) { throw new ReflectionException('Method not implemented'); }
  66. public function getClosure($object) { throw new ReflectionException('Method not implemented'); }
  67. public function getModifiers() { throw new ReflectionException('Method not implemented'); }
  68. public function getPrototype() { throw new ReflectionException('Method not implemented'); }
  69. public function invoke($object, $parameter = NULL) { throw new ReflectionException('Method not implemented'); }
  70. public function invokeArgs($object, array $args) { throw new ReflectionException('Method not implemented'); }
  71. public function isAbstract() { throw new ReflectionException('Method not implemented'); }
  72. public function isConstructor() { throw new ReflectionException('Method not implemented'); }
  73. public function isDestructor() { throw new ReflectionException('Method not implemented'); }
  74. public function isFinal() { throw new ReflectionException('Method not implemented'); }
  75. public function isPrivate() { throw new ReflectionException('Method not implemented'); }
  76. public function isProtected() { throw new ReflectionException('Method not implemented'); }
  77. public function isPublic() { throw new ReflectionException('Method not implemented'); }
  78. public function isStatic() { throw new ReflectionException('Method not implemented'); }
  79. public function setAccessible($accessible) { throw new ReflectionException('Method not implemented'); }
  80. public function __toString() { throw new ReflectionException('Method not implemented'); }
  81. public function getClosureThis() { throw new ReflectionException('Method not implemented'); }
  82. public function getEndLine() { throw new ReflectionException('Method not implemented'); }
  83. public function getExtension() { throw new ReflectionException('Method not implemented'); }
  84. public function getExtensionName() { throw new ReflectionException('Method not implemented'); }
  85. public function getFileName() { throw new ReflectionException('Method not implemented'); }
  86. public function getNumberOfParameters() { throw new ReflectionException('Method not implemented'); }
  87. public function getNumberOfRequiredParameters() { throw new ReflectionException('Method not implemented'); }
  88. public function getParameters() { throw new ReflectionException('Method not implemented'); }
  89. public function getShortName() { throw new ReflectionException('Method not implemented'); }
  90. public function getStartLine() { throw new ReflectionException('Method not implemented'); }
  91. public function getStaticVariables() { throw new ReflectionException('Method not implemented'); }
  92. public function inNamespace() { throw new ReflectionException('Method not implemented'); }
  93. public function isClosure() { throw new ReflectionException('Method not implemented'); }
  94. public function isDeprecated() { throw new ReflectionException('Method not implemented'); }
  95. public function isInternal() { throw new ReflectionException('Method not implemented'); }
  96. public function isUserDefined() { throw new ReflectionException('Method not implemented'); }
  97. public function returnsReference() { throw new ReflectionException('Method not implemented'); }
  98. }