private function getTransactionalAnnotation(RouteMatch $routeMatch) : ?Transactional
    {
        $method = $routeMatch->getControllerReflection();

        if ($method instanceof \ReflectionMethod) {
            $annotations = $this->annotationReader->getMethodAnnotations($method);

            foreach ($annotations as $annotation) {
                if ($annotation instanceof Transactional) {
                    return $annotation;
                }
            }
        }

        return null;
    }
private function getTransactionalAnnotation(RouteMatch $routeMatch) : ?Transactional
    {
        $method = $routeMatch->getControllerReflection();

        if ($method instanceof \ReflectionMethod) {
            $annotations = $this->annotationReader->getMethodAnnotations($method);

            foreach ($annotations as $annotation) {
                if ($annotation instanceof Transactional) {
                    return $annotation;
                }
            }
        }

        return null;
    }
private function getTransactionalAnnotation ( RouteMatch $ routeMatch ) : ? Transactional { $ method = $ routeMatch -> getControllerReflection ( ) ; if ( $ method instanceof \ ReflectionMethod ) { $ annotations = $ this -> annotationReader -> getMethodAnnotations ( $ method ) ; foreach ( $ annotations as $ annotation ) { if ( $ annotation instanceof Transactional ) { return $ annotation ; } } } return null ; }
Returns the Transactional annotation for the controller.

@param \Brick\App\RouteMatch $routeMatch

@return Transactional|null The annotation, or NULL if the controller is not transactional.

@todo add support for annotations on functions when Doctrine will handle them
Returns the Transactional annotation for the controller .