Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
6 / 6
CRAP
100.00% covered (success)
100.00%
1 / 1
OdanFlash
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
6 / 6
6
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
 add
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 get
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 all
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 has
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 clear
100.00% covered (success)
100.00%
1 / 1
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 Phexium\Plugin\Session\Adapter;
11
12use Odan\Session\FlashInterface as OdanFlashInterface;
13use Override;
14use Phexium\Plugin\Session\Port\FlashInterface;
15
16final readonly class OdanFlash implements FlashInterface
17{
18    public function __construct(private OdanFlashInterface $flash) {}
19
20    #[Override]
21    public function add(string $level, string $message): void
22    {
23        $this->flash->add($level, $message);
24    }
25
26    #[Override]
27    public function get(string $level): array
28    {
29        return $this->flash->get($level);
30    }
31
32    #[Override]
33    public function all(): array
34    {
35        return $this->flash->all();
36    }
37
38    #[Override]
39    public function has(string $level): bool
40    {
41        return $this->flash->has($level);
42    }
43
44    #[Override]
45    public function clear(): void
46    {
47        $this->flash->clear();
48    }
49}