ShariffExtension   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getGlobals() 0 4 1
A getName() 0 4 1
1
<?php
2
3
namespace CedricZiel\ShariffBundle\Twig;
4
5
use CedricZiel\ShariffBundle\Model\ShariffConfig;
6
7
/**
8
 * @package CedricZiel\ShariffBundle\Twig
9
 */
10
class ShariffExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
11
{
12
    /**
13
     * @var ShariffConfig
14
     */
15
    protected $shariffConfig;
16
17
    /**
18
     * @param ShariffConfig $shariffConfig
19
     */
20
    public function __construct(ShariffConfig $shariffConfig)
21
    {
22
        $this->shariffConfig = $shariffConfig;
23
    }
24
25
    /**
26
     * @return array
27
     */
28
    public function getGlobals()
29
    {
30
        return ['shariffConfig' => $this->shariffConfig];
31
    }
32
33
    /**
34
     * Returns the name of the extension.
35
     *
36
     * @return string The extension name
37
     */
38
    public function getName()
39
    {
40
        return 'shariff';
41
    }
42
}
43