Skip to content

Instantly share code, notes, and snippets.

@leopro
Created October 5, 2015 15:03
Show Gist options
  • Save leopro/2c09bbe9d54b3dc44f76 to your computer and use it in GitHub Desktop.
Save leopro/2c09bbe9d54b3dc44f76 to your computer and use it in GitHub Desktop.
<?php
class FactoryCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
$predisClientId = $container->getParameter('predis_client_id');
if (!$container->hasDefinition($predisClientId)) {
throw new ServiceNotFoundException($predisClientId);
}
$container->setAlias('predis_client', $predisClientId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment