Completed
Push — next ( 8ef386...43bb99 )
by Thomas
11:01 queued 05:16
created

KitchenSinkDataProvider::getTemplateVars()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 9.4285
1
<?php
2
3
namespace OcDev\KitchenSink\DataProvider;
4
5
use BestIt\KitchensinkBundle\DataProviderInterface;
6
use Symfony\Component\HttpFoundation\Session\Session;
7
8
/**
9
 * Class KitchenSinkDataProvider
10
 */
11
class KitchenSinkDataProvider implements DataProviderInterface
12
{
13
    /**
14
     * @var Session
15
     */
16
    private $session;
17
18
    /**
19
     * KitchenSinkDataProvider constructor.
20
     *
21
     * @param Session $session
22
     */
23
    public function __construct(Session $session)
24
    {
25
        $this->session = $session;
26
    }
27
28
    /**
29
     * Returns an array with template vars (and optional their getters) to fill the kitchensink template.
30
     *
31
     * @return array
32
     */
33
    public function getTemplateVars()
34
    {
35
        $this->session->getFlashBag()->add('success', 'Erfolgreiche Meldung 1!');
36
        $this->session->getFlashBag()->add('success', 'Erfolgreiche Meldung 2!');
37
        $this->session->getFlashBag()->add('info', 'Informative Meldung!');
38
        $this->session->getFlashBag()->add('error', 'Fehlerhafte Meldung!');
39
40
        return [
41
            'navigation' => 'getNavigationDummies',
42
        ];
43
    }
44
45
    /**
46
     * @return string[]
47
     */
48
    public function getNavigationDummies()
49
    {
50
        return [
51
            'Home',
52
            'Home1',
53
            'Home2',
54
            'Home3',
55
        ];
56
    }
57
}
58