Setono /
DAOBundle
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Setono\DAOBundle\DependencyInjection; |
||
| 6 | |||
| 7 | use Symfony\Component\Config\FileLocator; |
||
| 8 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
| 9 | use Symfony\Component\DependencyInjection\Extension\Extension; |
||
| 10 | use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; |
||
| 11 | |||
| 12 | final class SetonoDAOExtension extends Extension |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * {@inheritdoc} |
||
| 16 | * |
||
| 17 | * @throws \Exception |
||
| 18 | */ |
||
| 19 | public function load(array $config, ContainerBuilder $container): void |
||
| 20 | { |
||
| 21 | $config = $this->processConfiguration($this->getConfiguration([], $container), $config); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 22 | $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
||
| 23 | |||
| 24 | $container->setParameter('setono_dao.customer_id', $config['customer_id']); |
||
| 25 | $container->setParameter('setono_dao.password', $config['password']); |
||
| 26 | $container->setParameter('setono_dao.base_url', $config['base_url']); |
||
| 27 | |||
| 28 | if (isset($config['http_client'])) { |
||
| 29 | $container->setParameter('setono_dao.http_client', $config['http_client']); |
||
| 30 | } |
||
| 31 | |||
| 32 | if (isset($config['request_factory'])) { |
||
| 33 | $container->setParameter('setono_dao.request_factory', $config['request_factory']); |
||
| 34 | } |
||
| 35 | |||
| 36 | if (isset($config['stream_factory'])) { |
||
| 37 | $container->setParameter('setono_dao.stream_factory', $config['stream_factory']); |
||
| 38 | } |
||
| 39 | |||
| 40 | $loader->load('services.xml'); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |