src/DependencyInjection/Compiler/RegisterPagerPersistersPass.php
private function assertClassImplementsPagerPersisterInterface($persisterId, $persisterClass)
    {
        $rc = new \ReflectionClass($persisterClass);

        if (!$rc->implementsInterface(PagerPersisterInterface::class)) {
            throw new \InvalidArgumentException(sprintf(
                'Elastica pager persister "%s" with class "%s" must implement "%s".',
                $persisterId,
                $persisterClass,
                PagerPersisterInterface::class
            ));
        }
    }
private function assertClassImplementsPagerPersisterInterface($persisterId, $persisterClass)
    {
        $rc = new \ReflectionClass($persisterClass);

        if (!$rc->implementsInterface(PagerPersisterInterface::class)) {
            throw new \InvalidArgumentException(sprintf(
                'Elastica pager persister "%s" with class "%s" must implement "%s".',
                $persisterId,
                $persisterClass,
                PagerPersisterInterface::class
            ));
        }
    }
@param $persisterId
@param $persisterClass

@throws \InvalidArgumentException if persister service does not implement ObjectPersisterInterface