Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. /**
  2. * {@inheritDoc}
  3. */
  4. public function getClassAnnotations(ReflectionClass $class)
  5. {
  6. $this->parser->setTarget(Target::TARGET_CLASS);
  7. $this->parser->setImports($this->getClassImports($class));
  8. $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
  9.  
  10. $annotations = $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());
  11.  
  12. if (!method_exists($class, 'getTraits')) {
  13. return $annotations;
  14. }
  15.  
  16. foreach (class_uses($class->getName()) as $traitClassName) {
  17. $annotations = array_merge($annotations, $this->getClassAnnotations(new \ReflectionClass($traitClassName)));
  18. }
  19.  
  20. return $annotations;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement