ShariffExtension::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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