GameDateExtension::getGlobals()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
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