| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class FlashAlertsHelper extends Helper |
||
| 10 | { |
||
| 11 | const TEMPLATE = 'SludioHelperBundle:Flash:layout.html.twig'; |
||
| 12 | |||
| 13 | private $templating; |
||
| 14 | private $alertPublisher; |
||
| 15 | private $options = []; |
||
| 16 | |||
| 17 | public function __construct(EngineInterface $templating, AlertPublisher $alertPublisher, $template, $styles, $scripts) |
||
| 18 | { |
||
| 19 | $this->templating = $templating; |
||
| 20 | $this->alertPublisher = $alertPublisher; |
||
| 21 | $this->options = [ |
||
| 22 | 'alert_use_styles' => $styles, |
||
| 23 | 'alert_use_scripts' => $scripts, |
||
| 24 | 'template' => $template |
||
| 25 | ]; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function renderFlashAlerts(array $options = []) |
||
| 29 | { |
||
| 30 | $options = $this->resolveOptions($options); |
||
| 31 | |||
| 32 | return $this->templating->render($options['template'], $options); |
||
| 33 | } |
||
| 34 | |||
| 35 | private function resolveOptions(array $options = []) |
||
| 40 | } |
||
| 41 | |||
| 42 | public function getName() |
||
| 47 |