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() |
||
59 | |||
60 | /** |
||
61 | * Returns a url to the php-manual related to the underlying error - when available. |
||
62 | * |
||
63 | * @return string|null |
||
64 | */ |
||
65 | public function getExceptionDocrefUrl() |
||
69 | |||
70 | private function extractDocrefUrl($message) { |
||
91 | |||
92 | /** |
||
93 | * Does the wrapped Exception has a previous Exception? |
||
94 | * @return bool |
||
95 | */ |
||
96 | 2 | public function hasPreviousException() |
|
100 | |||
101 | /** |
||
102 | * Returns an Inspector for a previous Exception, if any. |
||
103 | * @todo Clean this up a bit, cache stuff a bit better. |
||
104 | * @return Inspector |
||
105 | */ |
||
106 | 2 | public function getPreviousExceptionInspector() |
|
118 | |||
119 | /** |
||
120 | * Returns an iterator for the inspected exception's |
||
121 | * frames. |
||
122 | * @return \Whoops\Exception\FrameCollection |
||
123 | */ |
||
124 | 3 | public function getFrames() |
|
186 | |||
187 | /** |
||
188 | * Gets the backtrace from an exception. |
||
189 | * |
||
190 | * If xdebug is installed |
||
191 | * |
||
192 | * @param \Throwable $exception |
||
193 | * @return array |
||
194 | */ |
||
195 | 1 | protected function getTrace($e) |
|
219 | |||
220 | /** |
||
221 | * Given an exception, generates an array in the format |
||
222 | * generated by Exception::getTrace() |
||
223 | * @param \Throwable $exception |
||
224 | * @return array |
||
225 | */ |
||
226 | 1 | protected function getFrameFromException($exception) |
|
237 | |||
238 | /** |
||
239 | * Given an error, generates an array in the format |
||
240 | * generated by ErrorException |
||
241 | * @param ErrorException $exception |
||
242 | * @return array |
||
243 | */ |
||
244 | protected function getFrameFromError(ErrorException $exception) |
||
253 | |||
254 | /** |
||
255 | * Determine if the frame can be used to fill in previous frame's missing info |
||
256 | * happens for call_user_func and call_user_func_array usages (PHP Bug #44428) |
||
257 | * |
||
258 | * @param array $frame |
||
259 | * @return bool |
||
260 | */ |
||
261 | 1 | protected function isValidNextFrame(array $frame) |
|
277 | } |
||
278 |
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: