Completed
Push — master ( c60de4...0df068 )
by Peter
02:20
created

AnimeDbPaginationExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 1
c 2
b 0
f 2
lcom 0
cbo 5
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 1
1
<?php
2
/**
3
 * AnimeDb package
4
 *
5
 * @package   AnimeDb
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
9
 */
10
11
namespace AnimeDb\Bundle\PaginationBundle\DependencyInjection;
12
13
use Symfony\Component\DependencyInjection\ContainerBuilder;
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
16
use Symfony\Component\DependencyInjection\Loader;
17
18
/**
19
 * DependencyInjection
20
 *
21
 * @package AnimeDb\Bundle\PaginationBundle\DependencyInjection
22
 * @author  Peter Gribanov <[email protected]>
23
 */
24
class AnimeDbPaginationExtension extends Extension
25
{
26
    /**
27
     * @param array $configs
28
     * @param ContainerBuilder $container
29
     */
30 1
    public function load(array $configs, ContainerBuilder $container)
31
    {
32 1
        $config = $this->processConfiguration(new Configuration(), $configs);
33
34 1
        $container->setParameter('pagination.max_navigate', $config['max_navigate']);
35 1
        $container->setParameter('pagination.template', $config['template']);
36
37 1
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
38 1
        $loader->load('services.yml');
39 1
    }
40
}
41