1 | <?php |
||
12 | final class JSendError implements JSendInterface |
||
13 | { |
||
14 | use JSendStatusTrait; |
||
15 | use JSendResponseTrait; |
||
16 | use JSendJsonTrait; |
||
17 | use ResponseDataTrait; |
||
18 | |||
19 | /** |
||
20 | * JSendError constructor. |
||
21 | * |
||
22 | * @param string $message |
||
23 | * @param int|null $code |
||
24 | */ |
||
25 | public function __construct(string $message, int $code = null) |
||
33 | |||
34 | /** |
||
35 | * @return int |
||
36 | */ |
||
37 | public function getDefaultHttpStatusCode(): int |
||
41 | |||
42 | /** |
||
43 | * @return int|null |
||
44 | */ |
||
45 | public function getCode(): ?int |
||
49 | |||
50 | /** |
||
51 | * @return null|string |
||
52 | */ |
||
53 | public function getMessage(): ?string |
||
57 | |||
58 | /** |
||
59 | * @return array |
||
60 | */ |
||
61 | public function asArray(): array |
||
71 | |||
72 | /** |
||
73 | * @param string $json |
||
74 | * |
||
75 | * @return JSendError |
||
76 | * @throws InvalidJsonException |
||
77 | */ |
||
78 | public static function decode(string $json): self |
||
84 | |||
85 | /** |
||
86 | * @param array $decoded |
||
87 | * |
||
88 | * @return JSendError |
||
89 | */ |
||
90 | public static function from(array $decoded): self |
||
101 | |||
102 | /** |
||
103 | * @param string|null $key |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | public function hasData(string $key = null): bool |
||
111 | |||
112 | /** |
||
113 | * @param string|null $key |
||
114 | * @param mixed|null $default |
||
115 | * |
||
116 | * @return array|mixed|null |
||
117 | */ |
||
118 | public function getData(string $key = null, $default = null) |
||
122 | } |
||
123 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..