Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class PsrMessage |
||
12 | { |
||
13 | /** @var string */ |
||
14 | private $message; |
||
15 | |||
16 | /** @var array */ |
||
17 | private $context = []; |
||
18 | |||
19 | public function __construct($message, $context = []) |
||
20 | { |
||
21 | $this->message = (string) $message; |
||
22 | $this->context = is_array($context) ? $context : [$context]; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return string |
||
27 | */ |
||
28 | public function getMessage() |
||
29 | { |
||
30 | return $this->message; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @return array |
||
35 | */ |
||
36 | public function getContext() |
||
37 | { |
||
38 | return $this->context; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * PSR3 compatibility |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public function __toString() |
||
49 | } |
||
50 | |||
51 | } |