EventListener/SerializerListener.php
private function isHydraOperation(\ReflectionMethod $method)
    {
        $annotation = $this->annotationReader->getMethodAnnotation(
            $method,
            'ML\HydraBundle\Mapping\Operation'
        );

        return null !== $annotation;
    }
private function isHydraOperation(\ReflectionMethod $method)
    {
        $annotation = $this->annotationReader->getMethodAnnotation(
            $method,
            'ML\HydraBundle\Mapping\Operation'
        );

        return null !== $annotation;
    }
Does the specified method represent a Hydra Operation?

This information is used to determine whether it's return value
should be serialized by the Hydra serializer.

Currently annotations are the only way to specify a method to be a
Hydra operation.

@param \ReflectionMethod $method The controller method.

@return boolean True if the method represents a Hydra Operation,
false otherwise