Skip to content

Commit 6f4a5c9

Browse files
authored
Create ApiPostcodePostcodeExtension.php
1 parent 655ca1a commit 6f4a5c9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/*
3+
* (c) Api Postcode <info@api-postcode.nl>
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*/
8+
9+
namespace ApiPostcode\PostcodeBundle\DependencyInjection;
10+
11+
use Symfony\Component\DependencyInjection\ContainerBuilder;
12+
use Symfony\Component\Config\FileLocator;
13+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
14+
use Symfony\Component\DependencyInjection\Loader;
15+
16+
/**
17+
* Class UsoftPostcodeExtension
18+
*
19+
* (c) Api Postcode <info@api-postcode.nl>
20+
*/
21+
class ApiPostcodePostcodeExtension extends Extension
22+
{
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
public function load(array $configs, ContainerBuilder $container)
27+
{
28+
$configuration = new Configuration();
29+
$config = $this->processConfiguration($configuration, $configs);
30+
31+
$container->setParameter('postcode_api_key', $config['api_postcode']['token']);
32+
33+
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
34+
$loader->load('services.yml');
35+
}
36+
}

0 commit comments

Comments
 (0)