TwitterBootstrapExtension   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getGlobals() 0 6 1
A getName() 0 4 1
1
<?php
2
3
namespace Evheniy\TwitterBootstrapBundle\Twig;
4
5
use Symfony\Component\DependencyInjection\ContainerInterface;
6
7
/**
8
 * Class TwitterBootstrapExtension
9
 *
10
 * @package Evheniy\TwitterBootstrapBundle\Twig
11
 */
12
class TwitterBootstrapExtension extends \Twig_Extension
13
{
14
    /**
15
     * @var \Symfony\Component\DependencyInjection\ContainerInterface
16
     */
17
    protected $container;
18
19
    /**
20
     * @param ContainerInterface $container
21
     */
22
    public function __construct(ContainerInterface $container)
23
    {
24
        $this->container = $container;
25
    }
26
27
    /**
28
     * @return array
29
     */
30
    public function getGlobals()
31
    {
32
        return array(
33
            'twitter_bootstrap' => $this->container->getParameter('twitter_bootstrap')
34
        );
35
    }
36
37
    /**
38
     * Returns the name of the extension.
39
     *
40
     * @return string The extension name
41
     */
42
    public function getName()
43
    {
44
        return 'twitter_bootstrap';
45
    }
46
}
47