Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| FlashExtension | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getGlobals | |
100.00% |
3 / 3 |
|
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 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace AppDemo\Shared\Presentation\Twig; |
| 11 | |
| 12 | use AppDemo\Shared\Domain\Interface\SessionServiceInterface; |
| 13 | use Override; |
| 14 | use Twig\Extension\AbstractExtension; |
| 15 | use Twig\Extension\GlobalsInterface; |
| 16 | |
| 17 | final 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 | } |