GhoubreFirebaseServiceExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 10
nc 1
nop 2
dl 0
loc 13
ccs 11
cts 11
cp 1
crap 1
rs 9.9332
c 0
b 0
f 0
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