public function onCoreController(FilterControllerEvent $event)
    {
        if (!is_array($controller = $event->getController())) {
            return;
        }

        $class  = new \ReflectionClass($controller[0]);
        $method = $class->getMethod($controller[1]);

        if ($classAnnotations = $this->reader->getClassAnnotations($class)) {
            foreach ($classAnnotations as $classAnnotation) {
                if ($classAnnotation instanceof Firewall) {
                    if (is_array($classAnnotation->actions) && in_array($method->name, $classAnnotation->actions)) {
                        $this->loadFirewall($classAnnotation);
                    } elseif ($classAnnotation->actions === null) {
                        $this->loadFirewall($classAnnotation);
                    }
                }
            }
        }

        if ($methodAnnotation = $this->reader->getMethodAnnotation($method, 'M6Web\Bundle\FirewallBundle\Annotation\Firewall')) {
            $this->loadFirewall($methodAnnotation);
        }
    }
public function onCoreController(FilterControllerEvent $event)
    {
        if (!is_array($controller = $event->getController())) {
            return;
        }

        $class  = new \ReflectionClass($controller[0]);
        $method = $class->getMethod($controller[1]);

        if ($classAnnotations = $this->reader->getClassAnnotations($class)) {
            foreach ($classAnnotations as $classAnnotation) {
                if ($classAnnotation instanceof Firewall) {
                    if (is_array($classAnnotation->actions) && in_array($method->name, $classAnnotation->actions)) {
                        $this->loadFirewall($classAnnotation);
                    } elseif ($classAnnotation->actions === null) {
                        $this->loadFirewall($classAnnotation);
                    }
                }
            }
        }

        if ($methodAnnotation = $this->reader->getMethodAnnotation($method, 'M6Web\Bundle\FirewallBundle\Annotation\Firewall')) {
            $this->loadFirewall($methodAnnotation);
        }
    }
public function onCoreController ( FilterControllerEvent $ event ) { if ( ! is_array ( $ controller = $ event -> getController ( ) ) ) { return ; } $ class = new \ ReflectionClass ( $ controller [ 0 ] ) ; $ method = $ class -> getMethod ( $ controller [ 1 ] ) ; if ( $ classAnnotations = $ this -> reader -> getClassAnnotations ( $ class ) ) { foreach ( $ classAnnotations as $ classAnnotation ) { if ( $ classAnnotation instanceof Firewall ) { if ( is_array ( $ classAnnotation -> actions ) && in_array ( $ method -> name , $ classAnnotation -> actions ) ) { $ this -> loadFirewall ( $ classAnnotation ) ; } elseif ( $ classAnnotation -> actions === null ) { $ this -> loadFirewall ( $ classAnnotation ) ; } } } } if ( $ methodAnnotation = $ this -> reader -> getMethodAnnotation ( $ method , 'M6Web\Bundle\FirewallBundle\Annotation\Firewall' ) ) { $ this -> loadFirewall ( $ methodAnnotation ) ; } }
Event before action execution

@param FilterControllerEvent $event Symfony trigger event
Event before action execution