TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
MethodReflection.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Extbase\Reflection;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
20 class MethodReflection extends \ReflectionMethod
21 {
25  protected $docCommentParser;
26 
32  public function getDeclaringClass()
33  {
34  return new ClassReflection(parent::getDeclaringClass()->getName());
35  }
36 
44  public function getParameters()
45  {
46  $extendedParameters = [];
47  foreach (parent::getParameters() as $parameter) {
48  $extendedParameters[] = new ParameterReflection([$this->getDeclaringClass()->getName(), $this->getName()], $parameter->getName());
49  }
50  return $extendedParameters;
51  }
52 
60  public function isTaggedWith($tag)
61  {
62  $result = $this->getDocCommentParser()->isTaggedWith($tag);
63  return $result;
64  }
65 
71  public function getTagsValues()
72  {
73  return $this->getDocCommentParser()->getTagsValues();
74  }
75 
82  public function getTagValues($tag)
83  {
84  return $this->getDocCommentParser()->getTagValues($tag);
85  }
86 
92  public function getDescription()
93  {
94  return $this->getDocCommentParser()->getDescription();
95  }
96 
103  protected function getDocCommentParser()
104  {
105  if (!is_object($this->docCommentParser)) {
106  $this->docCommentParser = new DocCommentParser();
107  $this->docCommentParser->parseDocComment($this->getDocComment());
108  }
110  }
111 }