<?php

namespace DCS\User\CoreBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;

class RepositoryCompilerPass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container)
    {
        $repositoryService = $container->getParameter('dcs_user.core.repository_service');

        if (!$container->has($repositoryService)) {
            throw new ServiceNotFoundException($repositoryService);
        }

        $container->setAlias('dcs_user.repository', $repositoryService);
    }
}

{'avg_line_length': 32.36363636363637, 'max_line_length': 90, 'alphanum_fraction': 0.7752808988764045, 'licenses': ['MIT'], 'repository_name': 'damianociarla/DCSUserCoreBundle', 'path': 'src/DependencyInjection/Compiler/RepositoryCompilerPass.php', 'size': 712, 'lang': 'PHP'}