Completed
Push — development ( 8ef386...754cf1 )
by Thomas
19s
created

KitchenSinkDataProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTemplateVars() 0 11 1
A getNavigationDummies() 0 9 1
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
 * @package OcDev\KitchenSink\DataProvider
12
 */
13
class KitchenSinkDataProvider implements DataProviderInterface
14
{
15
    /**
16
     * @var Session
17
     */
18
    private $session;
19
20
    /**
21
     * KitchenSinkDataProvider constructor.
22
     *
23
     * @param Session $session
24
     */
25
    public function __construct(Session $session)
26
    {
27
        $this->session = $session;
28
    }
29
30
    /**
31
     * Returns an array with template vars (and optional their getters) to fill the kitchensink template.
32
     *
33
     * @return array
34
     */
35
    public function getTemplateVars()
36
    {
37
        $this->session->getFlashBag()->add('success', 'Erfolgreiche Meldung 1!');
38
        $this->session->getFlashBag()->add('success', 'Erfolgreiche Meldung 2!');
39
        $this->session->getFlashBag()->add('info', 'Informative Meldung!');
40
        $this->session->getFlashBag()->add('error', 'Fehlerhafte Meldung!');
41
42
        return [
43
            'navigation' => 'getNavigationDummies'
44
        ];
45
    }
46
47
    /**
48
     * @return string[]
49
     */
50
    public function getNavigationDummies()
51
    {
52
        return [
53
            'Home',
54
            'Home1',
55
            'Home2',
56
            'Home3',
57
        ];
58
    }
59
}
60