Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
FlashExtension
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobals
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3// ╔════════════════════════════════════════════════════════════╗
4// ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║
5// ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com>     ║
6// ╚════════════════════════════════════════════════════════════╝
7
8declare(strict_types=1);
9
10namespace AppDemo\Shared\Presentation\Twig;
11
12use AppDemo\Shared\Domain\Interface\SessionServiceInterface;
13use Override;
14use Twig\Extension\AbstractExtension;
15use Twig\Extension\GlobalsInterface;
16
17final class FlashExtension extends AbstractExtension implements GlobalsInterface
18{
19    public function __construct(private readonly SessionServiceInterface $sessionService) {}
20
21    #[Override]
22    public function getGlobals(): array
23    {
24        return [
25            'flash' => $this->sessionService->getFlash(),
26        ];
27    }
28}