GpsLabPaginationExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 8
cts 8
cp 1
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * GpsLab component.
5
 *
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/MIT
9
 */
10
11
namespace GpsLab\Bundle\PaginationBundle\DependencyInjection;
12
13
use Symfony\Component\Config\FileLocator;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Loader;
16
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
17
18
class GpsLabPaginationExtension extends Extension
19
{
20
    /**
21
     * @param array            $configs
22
     * @param ContainerBuilder $container
23
     */
24 1
    public function load(array $configs, ContainerBuilder $container)
25
    {
26 1
        $config = $this->processConfiguration(new Configuration(), $configs);
27
28 1
        $container->setParameter('pagination.max_navigate', $config['max_navigate']);
29 1
        $container->setParameter('pagination.parameter_name', $config['parameter_name']);
30 1
        $container->setParameter('pagination.template', $config['template']);
31
32 1
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
33 1
        $loader->load('services.yml');
34 1
    }
35
36
    /**
37
     * @return string
38
     */
39 1
    public function getAlias()
40
    {
41 1
        return 'gpslab_pagination';
42
    }
43
}
44