Completed
Push — master ( 03a8c3...2d8113 )
by Peter
02:49
created

AnimeDbPaginationExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

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