TYPO3 CMS  TYPO3_6-2
ClassReflection.php
Go to the documentation of this file.
1 <?php
3 
19 class ClassReflection extends \ReflectionClass {
20 
24  protected $docCommentParser;
25 
31  public function __construct($className) {
32  parent::__construct($className);
33  }
34 
43  public function getMethods($filter = NULL) {
44  $extendedMethods = array();
45  $methods = $filter === NULL ? parent::getMethods() : parent::getMethods($filter);
46  foreach ($methods as $method) {
47  $extendedMethods[] = new \TYPO3\CMS\Extbase\Reflection\MethodReflection($this->getName(), $method->getName());
48  }
49  return $extendedMethods;
50  }
51 
60  public function getMethod($name) {
61  $parentMethod = parent::getMethod($name);
62  if (!is_object($parentMethod)) {
63  return $parentMethod;
64  }
65  return new \TYPO3\CMS\Extbase\Reflection\MethodReflection($this->getName(), $parentMethod->getName());
66  }
67 
75  public function getConstructor() {
76  $parentConstructor = parent::getConstructor();
77  if (!is_object($parentConstructor)) {
78  return $parentConstructor;
79  }
80  return new \TYPO3\CMS\Extbase\Reflection\MethodReflection($this->getName(), $parentConstructor->getName());
81  }
82 
91  public function getProperties($filter = NULL) {
92  $extendedProperties = array();
93  $properties = $filter === NULL ? parent::getProperties() : parent::getProperties($filter);
94  foreach ($properties as $property) {
95  $extendedProperties[] = new \TYPO3\CMS\Extbase\Reflection\PropertyReflection($this->getName(), $property->getName());
96  }
97  return $extendedProperties;
98  }
99 
108  public function getProperty($name) {
109  return new \TYPO3\CMS\Extbase\Reflection\PropertyReflection($this->getName(), $name);
110  }
111 
119  public function getInterfaces() {
120  $extendedInterfaces = array();
121  $interfaces = parent::getInterfaces();
122  foreach ($interfaces as $interface) {
123  $extendedInterfaces[] = new \TYPO3\CMS\Extbase\Reflection\ClassReflection($interface->getName());
124  }
125  return $extendedInterfaces;
126  }
127 
135  public function getParentClass() {
136  $parentClass = parent::getParentClass();
137  return $parentClass === FALSE ? FALSE : new \TYPO3\CMS\Extbase\Reflection\ClassReflection($parentClass->getName());
138  }
139 
147  public function isTaggedWith($tag) {
148  $result = $this->getDocCommentParser()->isTaggedWith($tag);
149  return $result;
150  }
151 
157  public function getTagsValues() {
158  return $this->getDocCommentParser()->getTagsValues();
159  }
160 
167  public function getTagValues($tag) {
168  return $this->getDocCommentParser()->getTagValues($tag);
169  }
170 
177  protected function getDocCommentParser() {
178  if (!is_object($this->docCommentParser)) {
179  $this->docCommentParser = new \TYPO3\CMS\Extbase\Reflection\DocCommentParser();
180  $this->docCommentParser->parseDocComment($this->getDocComment());
181  }
183  }
184 }
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.