StaticReflectionMethod.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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. /**
  37. * @param StaticReflectionParser $staticReflectionParser
  38. * @param string $methodName
  39. */
  40. public function __construct(StaticReflectionParser $staticReflectionParser, $methodName)
  41. {
  42. $this->staticReflectionParser = $staticReflectionParser;
  43. $this->methodName = $methodName;
  44. }
  45. /**
  46. * {@inheritDoc}
  47. */
  48. public function getName()
  49. {
  50. return $this->methodName;
  51. }
  52. /**
  53. * @return StaticReflectionParser
  54. */
  55. protected function getStaticReflectionParser()
  56. {
  57. return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('method', $this->methodName);
  58. }
  59. /**
  60. * {@inheritDoc}
  61. */
  62. public function getDeclaringClass()
  63. {
  64. return $this->getStaticReflectionParser()->getReflectionClass();
  65. }
  66. /**
  67. * {@inheritDoc}
  68. */
  69. public function getNamespaceName()
  70. {
  71. return $this->getStaticReflectionParser()->getNamespaceName();
  72. }
  73. /**
  74. * {@inheritDoc}
  75. */
  76. public function getDocComment()
  77. {
  78. return $this->getStaticReflectionParser()->getDocComment('method', $this->methodName);
  79. }
  80. /**
  81. * @return array
  82. */
  83. public function getUseStatements()
  84. {
  85. return $this->getStaticReflectionParser()->getUseStatements();
  86. }
  87. /**
  88. * {@inheritDoc}
  89. */
  90. public static function export($class, $name, $return = false)
  91. {
  92. throw new ReflectionException('Method not implemented');
  93. }
  94. /**
  95. * {@inheritDoc}
  96. */
  97. public function getClosure($object)
  98. {
  99. throw new ReflectionException('Method not implemented');
  100. }
  101. /**
  102. * {@inheritDoc}
  103. */
  104. public function getModifiers()
  105. {
  106. throw new ReflectionException('Method not implemented');
  107. }
  108. /**
  109. * {@inheritDoc}
  110. */
  111. public function getPrototype()
  112. {
  113. throw new ReflectionException('Method not implemented');
  114. }
  115. /**
  116. * {@inheritDoc}
  117. */
  118. public function invoke($object, $parameter = null)
  119. {
  120. throw new ReflectionException('Method not implemented');
  121. }
  122. /**
  123. * {@inheritDoc}
  124. */
  125. public function invokeArgs($object, array $args)
  126. {
  127. throw new ReflectionException('Method not implemented');
  128. }
  129. /**
  130. * {@inheritDoc}
  131. */
  132. public function isAbstract()
  133. {
  134. throw new ReflectionException('Method not implemented');
  135. }
  136. /**
  137. * {@inheritDoc}
  138. */
  139. public function isConstructor()
  140. {
  141. throw new ReflectionException('Method not implemented');
  142. }
  143. /**
  144. * {@inheritDoc}
  145. */
  146. public function isDestructor()
  147. {
  148. throw new ReflectionException('Method not implemented');
  149. }
  150. /**
  151. * {@inheritDoc}
  152. */
  153. public function isFinal()
  154. {
  155. throw new ReflectionException('Method not implemented');
  156. }
  157. /**
  158. * {@inheritDoc}
  159. */
  160. public function isPrivate()
  161. {
  162. throw new ReflectionException('Method not implemented');
  163. }
  164. /**
  165. * {@inheritDoc}
  166. */
  167. public function isProtected()
  168. {
  169. throw new ReflectionException('Method not implemented');
  170. }
  171. /**
  172. * {@inheritDoc}
  173. */
  174. public function isPublic()
  175. {
  176. throw new ReflectionException('Method not implemented');
  177. }
  178. /**
  179. * {@inheritDoc}
  180. */
  181. public function isStatic()
  182. {
  183. throw new ReflectionException('Method not implemented');
  184. }
  185. /**
  186. * {@inheritDoc}
  187. */
  188. public function setAccessible($accessible)
  189. {
  190. throw new ReflectionException('Method not implemented');
  191. }
  192. /**
  193. * {@inheritDoc}
  194. */
  195. public function __toString()
  196. {
  197. throw new ReflectionException('Method not implemented');
  198. }
  199. /**
  200. * {@inheritDoc}
  201. */
  202. public function getClosureThis()
  203. {
  204. throw new ReflectionException('Method not implemented');
  205. }
  206. /**
  207. * {@inheritDoc}
  208. */
  209. public function getEndLine()
  210. {
  211. throw new ReflectionException('Method not implemented');
  212. }
  213. /**
  214. * {@inheritDoc}
  215. */
  216. public function getExtension()
  217. {
  218. throw new ReflectionException('Method not implemented');
  219. }
  220. /**
  221. * {@inheritDoc}
  222. */
  223. public function getExtensionName()
  224. {
  225. throw new ReflectionException('Method not implemented');
  226. }
  227. /**
  228. * {@inheritDoc}
  229. */
  230. public function getFileName()
  231. {
  232. throw new ReflectionException('Method not implemented');
  233. }
  234. /**
  235. * {@inheritDoc}
  236. */
  237. public function getNumberOfParameters()
  238. {
  239. throw new ReflectionException('Method not implemented');
  240. }
  241. /**
  242. * {@inheritDoc}
  243. */
  244. public function getNumberOfRequiredParameters()
  245. {
  246. throw new ReflectionException('Method not implemented');
  247. }
  248. /**
  249. * {@inheritDoc}
  250. */
  251. public function getParameters()
  252. {
  253. throw new ReflectionException('Method not implemented');
  254. }
  255. /**
  256. * {@inheritDoc}
  257. */
  258. public function getShortName()
  259. {
  260. throw new ReflectionException('Method not implemented');
  261. }
  262. /**
  263. * {@inheritDoc}
  264. */
  265. public function getStartLine()
  266. {
  267. throw new ReflectionException('Method not implemented');
  268. }
  269. /**
  270. * {@inheritDoc}
  271. */
  272. public function getStaticVariables()
  273. {
  274. throw new ReflectionException('Method not implemented');
  275. }
  276. /**
  277. * {@inheritDoc}
  278. */
  279. public function inNamespace()
  280. {
  281. throw new ReflectionException('Method not implemented');
  282. }
  283. /**
  284. * {@inheritDoc}
  285. */
  286. public function isClosure()
  287. {
  288. throw new ReflectionException('Method not implemented');
  289. }
  290. /**
  291. * {@inheritDoc}
  292. */
  293. public function isDeprecated()
  294. {
  295. throw new ReflectionException('Method not implemented');
  296. }
  297. /**
  298. * {@inheritDoc}
  299. */
  300. public function isInternal()
  301. {
  302. throw new ReflectionException('Method not implemented');
  303. }
  304. /**
  305. * {@inheritDoc}
  306. */
  307. public function isUserDefined()
  308. {
  309. throw new ReflectionException('Method not implemented');
  310. }
  311. /**
  312. * {@inheritDoc}
  313. */
  314. public function returnsReference()
  315. {
  316. throw new ReflectionException('Method not implemented');
  317. }
  318. }