GameDateExtension   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 33
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

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 OSS\CoreBundle\Twig;
4
5
use Doctrine\ORM\EntityManager;
6
use OSS\CoreBundle\Entity\GameDate;
7
8
class GameDateExtension extends \Twig_Extension
9
{
10
    /**
11
     * @var EntityManager
12
     */
13
    private $entityManager;
14
15
    /**
16
     * @param EntityManager $entityManager
17
     */
18
    public function __construct(EntityManager $entityManager)
19
    {
20
        $this->entityManager = $entityManager;
21
    }
22
23
    /**
24
     * @return array
25
     */
26
    public function getGlobals()
27
    {
28
        return array(
29
            'gameDate' => $this->entityManager->getRepository('CoreBundle:GameDate')->findOneBy(array()),
30
        );
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getName()
37
    {
38
        return 'oss.core.game_date';
39
    }
40
}
41