File tree Expand file tree Collapse file tree 1 file changed +28
-10
lines changed Expand file tree Collapse file tree 1 file changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -218,16 +218,9 @@ protected function parseTrace($index, array $trace)
218
218
return $ frame ;
219
219
}
220
220
221
- if (isset ($ trace ['class ' ]) && isset ($ trace ['file ' ]) && strpos (
222
- $ trace ['file ' ],
223
- DIRECTORY_SEPARATOR . 'vendor ' . DIRECTORY_SEPARATOR . 'laravel ' . DIRECTORY_SEPARATOR . 'framework/src/Illuminate/Database '
224
- ) === false && strpos (
225
- $ trace ['file ' ],
226
- DIRECTORY_SEPARATOR . 'vendor ' . DIRECTORY_SEPARATOR . 'laravel ' . DIRECTORY_SEPARATOR . 'framework/src/Illuminate/Events '
227
- ) === false && strpos (
228
- $ trace ['file ' ],
229
- DIRECTORY_SEPARATOR . 'vendor ' . DIRECTORY_SEPARATOR . 'barryvdh ' . DIRECTORY_SEPARATOR . 'laravel-debugbar '
230
- ) === false
221
+ if (isset ($ trace ['class ' ]) &&
222
+ isset ($ trace ['file ' ]) &&
223
+ !$ this ->fileIsInExcludedPath ($ trace ['file ' ])
231
224
) {
232
225
$ file = $ trace ['file ' ];
233
226
@@ -264,6 +257,31 @@ protected function parseTrace($index, array $trace)
264
257
return false ;
265
258
}
266
259
260
+ /**
261
+ * Check if the given file is to be excluded from analysis
262
+ *
263
+ * @param string $file
264
+ * @return bool
265
+ */
266
+ protected function fileIsInExcludedPath ($ file )
267
+ {
268
+ $ excludedPaths = [
269
+ '/vendor/laravel/framework/src/Illuminate/Database ' ,
270
+ '/vendor/laravel/framework/src/Illuminate/Events ' ,
271
+ '/vendor/barryvdh/laravel-debugbar ' ,
272
+ ];
273
+
274
+ $ normalizedPath = str_replace ('\\' , '/ ' , $ file );
275
+
276
+ foreach ($ excludedPaths as $ excludedPath ) {
277
+ if (strpos ($ normalizedPath , $ excludedPath ) !== false ) {
278
+ return true ;
279
+ }
280
+ }
281
+
282
+ return false ;
283
+ }
284
+
267
285
/**
268
286
* Find the middleware alias from the file.
269
287
*
You can’t perform that action at this time.
0 commit comments