@@ -123,10 +123,20 @@ public function analyseFile(
123
123
]);
124
124
continue ;
125
125
} catch (IdentifierNotFound $ e ) {
126
- $ fileErrors [] = (new Error (sprintf ('Reflection error: %s not found. ' , $ e ->getIdentifier ()->getName ()), $ file , $ node ->getStartLine (), $ e , null , null , 'Learn more at https://phpstan.org/user-guide/discovering-symbols ' ))->withIdentifier ('phpstan.reflection ' );
126
+ $ fileErrors [] = (new Error (sprintf ('Reflection error: %s not found. ' , $ e ->getIdentifier ()->getName ()), $ file , $ node ->getStartLine (), $ e , null , null , 'Learn more at https://phpstan.org/user-guide/discovering-symbols ' ))
127
+ ->withIdentifier ('phpstan.reflection ' )
128
+ ->withMetadata ([
129
+ InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace ($ e ),
130
+ InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $ e ->getTraceAsString (),
131
+ ]);
127
132
continue ;
128
133
} catch (UnableToCompileNode | CircularReference $ e ) {
129
- $ fileErrors [] = (new Error (sprintf ('Reflection error: %s ' , $ e ->getMessage ()), $ file , $ node ->getStartLine (), $ e ))->withIdentifier ('phpstan.reflection ' );
134
+ $ fileErrors [] = (new Error (sprintf ('Reflection error: %s ' , $ e ->getMessage ()), $ file , $ node ->getStartLine (), $ e ))
135
+ ->withIdentifier ('phpstan.reflection ' )
136
+ ->withMetadata ([
137
+ InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace ($ e ),
138
+ InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $ e ->getTraceAsString (),
139
+ ]);
130
140
continue ;
131
141
}
132
142
@@ -152,10 +162,20 @@ public function analyseFile(
152
162
]);
153
163
continue ;
154
164
} catch (IdentifierNotFound $ e ) {
155
- $ fileErrors [] = (new Error (sprintf ('Reflection error: %s not found. ' , $ e ->getIdentifier ()->getName ()), $ file , $ node ->getStartLine (), $ e , null , null , 'Learn more at https://phpstan.org/user-guide/discovering-symbols ' ))->withIdentifier ('phpstan.reflection ' );
165
+ $ fileErrors [] = (new Error (sprintf ('Reflection error: %s not found. ' , $ e ->getIdentifier ()->getName ()), $ file , $ node ->getStartLine (), $ e , null , null , 'Learn more at https://phpstan.org/user-guide/discovering-symbols ' ))
166
+ ->withIdentifier ('phpstan.reflection ' )
167
+ ->withMetadata ([
168
+ InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace ($ e ),
169
+ InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $ e ->getTraceAsString (),
170
+ ]);
156
171
continue ;
157
172
} catch (UnableToCompileNode | CircularReference $ e ) {
158
- $ fileErrors [] = (new Error (sprintf ('Reflection error: %s ' , $ e ->getMessage ()), $ file , $ node ->getStartLine (), $ e ))->withIdentifier ('phpstan.reflection ' );
173
+ $ fileErrors [] = (new Error (sprintf ('Reflection error: %s ' , $ e ->getMessage ()), $ file , $ node ->getStartLine (), $ e ))
174
+ ->withIdentifier ('phpstan.reflection ' )
175
+ ->withMetadata ([
176
+ InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace ($ e ),
177
+ InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $ e ->getTraceAsString (),
178
+ ]);
159
179
continue ;
160
180
}
161
181
@@ -222,9 +242,19 @@ public function analyseFile(
222
242
InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $ e ->getTraceAsString (),
223
243
]);
224
244
} catch (IdentifierNotFound $ e ) {
225
- $ fileErrors [] = (new Error (sprintf ('Reflection error: %s not found. ' , $ e ->getIdentifier ()->getName ()), $ file , null , $ e , null , null , 'Learn more at https://phpstan.org/user-guide/discovering-symbols ' ))->withIdentifier ('phpstan.reflection ' );
245
+ $ fileErrors [] = (new Error (sprintf ('Reflection error: %s not found. ' , $ e ->getIdentifier ()->getName ()), $ file , null , $ e , null , null , 'Learn more at https://phpstan.org/user-guide/discovering-symbols ' ))
246
+ ->withIdentifier ('phpstan.reflection ' )
247
+ ->withMetadata ([
248
+ InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace ($ e ),
249
+ InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $ e ->getTraceAsString (),
250
+ ]);
226
251
} catch (UnableToCompileNode | CircularReference $ e ) {
227
- $ fileErrors [] = (new Error (sprintf ('Reflection error: %s ' , $ e ->getMessage ()), $ file , null , $ e ))->withIdentifier ('phpstan.reflection ' );
252
+ $ fileErrors [] = (new Error (sprintf ('Reflection error: %s ' , $ e ->getMessage ()), $ file , null , $ e ))
253
+ ->withIdentifier ('phpstan.reflection ' )
254
+ ->withMetadata ([
255
+ InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace ($ e ),
256
+ InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $ e ->getTraceAsString (),
257
+ ]);
228
258
}
229
259
} elseif (is_dir ($ file )) {
230
260
$ fileErrors [] = (new Error (sprintf ('File %s is a directory. ' , $ file ), $ file , null , false ))->withIdentifier ('phpstan.path ' );
0 commit comments