Initial commit
This commit is contained in:
42
DependencyInjection/Factory/ServiceAdapterFactory.php
Normal file
42
DependencyInjection/Factory/ServiceAdapterFactory.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
/**
|
||||
* Service adapter factory
|
||||
*
|
||||
* @author Antoine Hérault <antoine.herault@gmail.com>
|
||||
*/
|
||||
class ServiceAdapterFactory implements AdapterFactoryInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function create(ContainerBuilder $container, $id, array $config)
|
||||
{
|
||||
return $config['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
return 'service';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function addConfiguration(NodeDefinition $builder)
|
||||
{
|
||||
$builder
|
||||
->children()
|
||||
->scalarNode('id')->isRequired()->end()
|
||||
->end()
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user