forked from jasny/session-middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlash.php
More file actions
39 lines (34 loc) · 766 Bytes
/
Copy pathFlash.php
File metadata and controls
39 lines (34 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
namespace Jasny\Session\Flash;
/**
* Flash message.
*/
class Flash
{
public string $type;
public string $message;
public string $contentType;
/**
* Flash constructor.
*/
public function __construct(string $type, string $message, string $contentType)
{
$this->type = $type;
$this->message = $message;
$this->contentType = $contentType;
}
/**
* Cast to associative array.
*
* @return array{type:string,message:string,contentType:string}
*/
public function toAssoc(): array
{
return [
'type' => $this->type,
'message' => $this->message,
'contentType' => $this->contentType,
];
}
}