Passed
Branch master (bdaefa)
by Gary
08:54
created

GhoubreFirebaseServiceExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 15
ccs 0
cts 13
cp 0
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
    public function load(array $configs, ContainerBuilder $container)
22
    {
23
        $loader = new XmlFileLoader(
24
            $container,
25
            new FileLocator(__DIR__.'/../Resources/config')
26
        );
27
        $loader->load('services.xml');
28
        $configuration = new Configuration();
29
        $config = $this->processConfiguration($configuration, $configs);
30
        $definition = $container->getDefinition('ghoubre.firebase_notification_service');
31
        $definition->replaceArgument(0, $config['serverKey']);
32
        $definition->replaceArgument(1, $config['content_available']);
33
        $definition->replaceArgument(2, $config['time_to_live']);
34
    }
35
}
36