for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the xAPI package.
*
* (c) Christian Flothmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Xabbuh\XApi\Bundle\ClientBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
/**
* Compiler pass adding all configured xAPI clients to the xAPI client manager.
* @author Christian Flothmann <[email protected]>
class RegisterClientsPass implements CompilerPassInterface
{
* {@inheritDoc}
public function process(ContainerBuilder $container)
$definition = $container->getDefinition('xabbuh_xapi_client.client_manager');
$clients = array();
foreach ($container->getParameter('xabbuh_xapi_client.clients') as $name => $id) {
$clients[$name] = new Reference($id);
}
$definition->setArguments(array($clients));