getMethodAnnotation() публичный Метод

{@inheritDoc}
public getMethodAnnotation ( ReflectionMethod $method, $annotationName )
$method ReflectionMethod
Пример #1
0
 /**
  * Listen kernel.controller event for find assigned annotation
  * 
  * @param FilterControllerEvent $event
  * @return null
  */
 public function onKernelController(FilterControllerEvent $event)
 {
     $controller = $event->getController();
     if (!is_array($controller)) {
         return;
     }
     $action = new ReflectionMethod($controller[0], $controller[1]);
     $annotation = $this->annotationReader->getMethodAnnotation($action, $this->annotationClass);
     if (get_class($annotation) != $this->annotationClass) {
         return;
     }
     $newController = $this->resolver->resolve($annotation);
     if (!empty($newController)) {
         $event->setController($newController);
     }
 }