Sulu\Bundle\HttpCacheBundle\DependencyInjection\Compiler\HandlerPass::validateHandler PHP Method

validateHandler() private method

Ensure that the handler implements the HandlerInterface (if it does not then someone has added a tag in the wrong place).
private validateHandler ( ContainerBuilder $container, mixed $id )
$container Symfony\Component\DependencyInjection\ContainerBuilder
$id mixed
    private function validateHandler(ContainerBuilder $container, $id)
    {
        /* @var Definition */
        $definition = $container->getDefinition($id);
        $reflection = new \ReflectionClass($container->getParameterBag()->resolveValue($definition->getClass()));
        if (!$reflection->implementsInterface('Sulu\\Component\\HttpCache\\HandlerInterface')) {
            throw new \InvalidArgumentException(sprintf('Service ID "%s" was tagged as a cache handler, but it does not implement the "HandlerInterface"', $id));
        }
    }