| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * This file is part of the bugloos/api-versioning-bundle project. |
||
| 5 | * (c) Bugloos <https://bugloos.com/> |
||
| 6 | * For the full copyright and license information, please view |
||
| 7 | * the LICENSE file that was distributed with this source code. |
||
| 8 | */ |
||
| 9 | |||
| 10 | namespace Bugloos\ApiVersioningBundle\DependencyInjection; |
||
| 11 | |||
| 12 | use Symfony\Component\Config\FileLocator; |
||
| 13 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
| 14 | use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; |
||
| 15 | use Symfony\Component\HttpKernel\DependencyInjection\Extension; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @author Mojtaba Gheytasi <[email protected]> |
||
| 19 | */ |
||
| 20 | class ApiVersioningExtension extends Extension |
||
| 21 | { |
||
| 22 | public function load(array $configs, ContainerBuilder $container) |
||
| 23 | { |
||
| 24 | $configuration = $this->getConfiguration($configs, $container); |
||
| 25 | $config = $this->processConfiguration($configuration, $configs); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 26 | |||
| 27 | $container->setParameter('base_version', $config['base_version']); |
||
| 28 | $container->setParameter('next_versions', $config['next_versions']); |
||
| 29 | $container->setParameter('deleted_routes', $config['deleted_routes']); |
||
| 30 | |||
| 31 | $loader = new YamlFileLoader( |
||
| 32 | $container, |
||
| 33 | new FileLocator(__DIR__.'/../Resources/config') |
||
| 34 | ); |
||
| 35 | |||
| 36 | $loader->load('services.yaml'); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getAlias(): string |
||
| 40 | { |
||
| 41 | return 'bugloos_api_versioning'; |
||
| 42 | } |
||
| 43 | } |
||
| 44 |