1 | <?php |
||
18 | class ThrowableProxy |
||
19 | { |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $class; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $message; |
||
29 | |||
30 | /** |
||
31 | * @var \Error|\Exception|ThrowableProxy|null |
||
32 | */ |
||
33 | protected $prev; |
||
34 | |||
35 | /** |
||
36 | * @var mixed[] |
||
37 | */ |
||
38 | protected $context; |
||
39 | |||
40 | /** |
||
41 | * @param \Error|\Exception|string[]|string $throwableOrMessage |
||
42 | */ |
||
43 | 16 | public function __construct($throwableOrMessage) |
|
66 | |||
67 | /** |
||
68 | * |
||
69 | */ |
||
70 | 21 | public function __destruct() |
|
76 | |||
77 | /** |
||
78 | * @param mixed[] $context |
||
79 | */ |
||
80 | 2 | public function setContext(array $context = []) |
|
81 | { |
||
82 | 2 | $this->context = $context; |
|
83 | 2 | } |
|
84 | |||
85 | /** |
||
86 | * @return mixed[] |
||
87 | */ |
||
88 | 1 | public function getContext() |
|
89 | { |
||
90 | 1 | return $this->context; |
|
91 | } |
||
92 | |||
93 | /** |
||
94 | * Format proxied Throwable as string. |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | 1 | public function __toString() |
|
102 | |||
103 | /** |
||
104 | * Return proxied Throwable. |
||
105 | * |
||
106 | * @return \Error|\Exception |
||
107 | */ |
||
108 | 10 | public function toThrowable() |
|
115 | |||
116 | /** |
||
117 | * Return proxied Throwable message. |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | 1 | final public function getMessage() |
|
125 | |||
126 | /** |
||
127 | * Return proxied Throwable code. |
||
128 | * |
||
129 | * @return int |
||
130 | */ |
||
131 | 1 | final public function getCode() |
|
135 | |||
136 | /** |
||
137 | * Return proxied Throwable file. |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | 1 | final public function getFile() |
|
145 | |||
146 | /** |
||
147 | * Return proxied Throwable code. |
||
148 | * |
||
149 | * @return int |
||
150 | */ |
||
151 | 1 | final public function getLine() |
|
155 | |||
156 | /** |
||
157 | * Return proxied Throwable trace. |
||
158 | * |
||
159 | * @return array |
||
160 | */ |
||
161 | 1 | final public function getTrace() |
|
165 | |||
166 | /** |
||
167 | * Return proxied Throwable previous element. |
||
168 | * |
||
169 | * @return \Error|\Exception|null |
||
170 | */ |
||
171 | 2 | final public function getPrevious() |
|
175 | |||
176 | /** |
||
177 | * Return proxied Throwable trace in string format. |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | 1 | final public function getTraceAsString() |
|
185 | } |
||
186 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.