GhoubreFirebaseServiceExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 15
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 13 1
1
<?php
2
3
/*
4
 * This file is part of the Firebase Service Bundle.
5
 *
6
 * (c) Gary HOUBRE <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ghoubre\FirebaseServiceBundle\DependencyInjection;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Extension\Extension;
16
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
17
use Symfony\Component\Config\FileLocator;
18
19
class GhoubreFirebaseServiceExtension extends Extension
20
{
21 2
    public function load(array $configs, ContainerBuilder $container)
22
    {
23 2
        $loader = new XmlFileLoader(
24 2
            $container,
25 2
            new FileLocator(__DIR__.'/../Resources/config')
26
        );
27 2
        $loader->load('services.xml');
28 2
        $configuration = new Configuration();
29 2
        $config = $this->processConfiguration($configuration, $configs);
30 1
        $definition = $container->getDefinition('ghoubre.firebase_notification_service');
31 1
        $definition->replaceArgument(0, $config['serverKey']);
32 1
        $definition->replaceArgument(1, $config['content_available']);
33 1
        $definition->replaceArgument(2, $config['time_to_live']);
34 1
    }
35
}
36