1 | <?php |
||
9 | class Inspector |
||
10 | { |
||
11 | /** |
||
12 | * @var \Exception | \Throwable |
||
13 | */ |
||
14 | private $exception; |
||
15 | |||
16 | /** |
||
17 | * @var \Whoops\Exception\FrameCollection |
||
18 | */ |
||
19 | private $frames; |
||
20 | |||
21 | /** |
||
22 | * @var \Whoops\Exception\Inspector |
||
23 | */ |
||
24 | private $previousExceptionInspector; |
||
25 | |||
26 | /** |
||
27 | * @param \Exception | \Throwable $exception The exception to inspect |
||
28 | */ |
||
29 | 4 | public function __construct($exception) |
|
33 | |||
34 | /** |
||
35 | * @return \Exception | \Throwable |
||
36 | */ |
||
37 | 3 | public function getException() |
|
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | 2 | public function getExceptionName() |
|
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getExceptionMessage() |
||
57 | |||
58 | /** |
||
59 | * Does the wrapped Exception have a previous Exception? |
||
60 | * @return bool |
||
61 | */ |
||
62 | 2 | public function hasPreviousException() |
|
66 | |||
67 | /** |
||
68 | * Returns an Inspector for a previous Exception, if any. |
||
69 | * @todo Clean this up a bit, cache stuff a bit better. |
||
70 | * @return Inspector |
||
71 | */ |
||
72 | 2 | public function getPreviousExceptionInspector() |
|
84 | |||
85 | /** |
||
86 | * Returns an iterator for the inspected exception's |
||
87 | * frames. |
||
88 | * @return \Whoops\Exception\FrameCollection |
||
89 | */ |
||
90 | 3 | public function getFrames() |
|
125 | |||
126 | /** |
||
127 | * Given an exception, generates an array in the format |
||
128 | * generated by Throwable::getTrace() |
||
129 | * @param \Exception | \Throwable $exception |
||
130 | * @return array |
||
131 | */ |
||
132 | 1 | protected function getFrameFromException($exception) |
|
143 | |||
144 | /** |
||
145 | * Given an error, generates an array in the format |
||
146 | * generated by ErrorException |
||
147 | * @param ErrorException $exception |
||
148 | * @return array |
||
149 | */ |
||
150 | protected function getFrameFromError(ErrorException $exception) |
||
159 | } |
||
160 |
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: