1 | <?php |
||
11 | class Inspector |
||
12 | { |
||
13 | /** |
||
14 | * @var \Throwable |
||
15 | */ |
||
16 | private $exception; |
||
17 | |||
18 | /** |
||
19 | * @var \Whoops\Exception\FrameCollection |
||
20 | */ |
||
21 | private $frames; |
||
22 | |||
23 | /** |
||
24 | * @var \Whoops\Exception\Inspector |
||
25 | */ |
||
26 | private $previousExceptionInspector; |
||
27 | |||
28 | /** |
||
29 | * @param \Throwable $exception The exception to inspect |
||
30 | */ |
||
31 | 3 | public function __construct($exception) |
|
32 | { |
||
33 | 3 | $this->exception = $exception; |
|
34 | 3 | } |
|
35 | |||
36 | /** |
||
37 | * @return \Throwable |
||
38 | */ |
||
39 | 3 | public function getException() |
|
40 | { |
||
41 | 3 | return $this->exception; |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return string |
||
46 | */ |
||
47 | 2 | public function getExceptionName() |
|
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getExceptionMessage() |
||
68 | |||
69 | /** |
||
70 | * Returns a url to the php-manual related to the underlying error - when available. |
||
71 | * |
||
72 | * @return string|null |
||
73 | */ |
||
74 | public function getExceptionDocrefUrl() |
||
88 | |||
89 | /** |
||
90 | * Does the wrapped Exception has a previous Exception? |
||
91 | * @return bool |
||
92 | */ |
||
93 | 2 | public function hasPreviousException() |
|
97 | |||
98 | /** |
||
99 | * Returns an Inspector for a previous Exception, if any. |
||
100 | * @todo Clean this up a bit, cache stuff a bit better. |
||
101 | * @return Inspector |
||
102 | */ |
||
103 | 2 | public function getPreviousExceptionInspector() |
|
115 | |||
116 | /** |
||
117 | * Returns an iterator for the inspected exception's |
||
118 | * frames. |
||
119 | * @return \Whoops\Exception\FrameCollection |
||
120 | */ |
||
121 | 3 | public function getFrames() |
|
183 | |||
184 | /** |
||
185 | * Gets the backtrace from an exception. |
||
186 | * |
||
187 | * If xdebug is installed |
||
188 | * |
||
189 | * @param \Throwable $exception |
||
190 | * @return array |
||
191 | */ |
||
192 | 1 | protected function getTrace($e) |
|
216 | |||
217 | /** |
||
218 | * Given an exception, generates an array in the format |
||
219 | * generated by Exception::getTrace() |
||
220 | * @param \Throwable $exception |
||
221 | * @return array |
||
222 | */ |
||
223 | 1 | protected function getFrameFromException($exception) |
|
234 | |||
235 | /** |
||
236 | * Given an error, generates an array in the format |
||
237 | * generated by ErrorException |
||
238 | * @param ErrorException $exception |
||
239 | * @return array |
||
240 | */ |
||
241 | protected function getFrameFromError(ErrorException $exception) |
||
250 | |||
251 | /** |
||
252 | * Determine if the frame can be used to fill in previous frame's missing info |
||
253 | * happens for call_user_func and call_user_func_array usages (PHP Bug #44428) |
||
254 | * |
||
255 | * @param array $frame |
||
256 | * @return bool |
||
257 | */ |
||
258 | 1 | protected function isValidNextFrame(array $frame) |
|
274 | } |
||
275 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: