Total Complexity | 9 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class AlertManager implements AlertManagerInterface |
||
8 | { |
||
9 | private $session; |
||
10 | |||
11 | public function __construct(Session $session) |
||
12 | { |
||
13 | if (!$session->isStarted()) { |
||
14 | $session->start(); |
||
15 | } |
||
16 | $this->session = $session; |
||
17 | } |
||
18 | |||
19 | public function addAlert(AlertInterface $alert) |
||
20 | { |
||
21 | $this->session->getFlashBag()->add($alert->getType(), $alert->getMessage()); |
||
22 | } |
||
23 | |||
24 | public function getAlerts() |
||
35 | } |
||
36 | |||
37 | private function createAlertsForType($type, array $messages) |
||
45 | } |
||
46 | |||
47 | public static function getAlertTypes() |
||
54 | ]; |
||
55 | } |
||
56 | } |
||
57 |