Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Notification |
||
8 | { |
||
9 | public function __construct( |
||
10 | protected string $message, |
||
11 | protected ?string $title, |
||
12 | protected ?string $type = null |
||
13 | ) { |
||
14 | $this->message = htmlspecialchars($message, ENT_QUOTES); |
||
15 | $this->title = $title ? htmlspecialchars($title, ENT_QUOTES) : ''; |
||
16 | $this->type = $type ?? NotificationType::$info; |
||
17 | } |
||
18 | |||
19 | protected function asArray(): array |
||
25 | ]; |
||
26 | } |
||
27 | |||
28 | public static function make( |
||
34 | } |
||
35 | |||
36 | public function push(): void |
||
39 | } |
||
40 | |||
41 | public function pushOnNextPage(): void |
||
46 |