31
31
use const E_NOTICE ;
32
32
use const E_PARSE ;
33
33
use const E_STRICT ;
34
+ use const E_USER_DEPRECATED ;
34
35
use const E_USER_ERROR ;
35
36
use const E_USER_NOTICE ;
36
37
use const E_USER_WARNING ;
@@ -322,7 +323,7 @@ private function collectErrors(array $analysedFiles): void
322
323
323
324
$ errorMessage = sprintf ('%s: %s ' , $ this ->getErrorLabel ($ errno ), $ errstr );
324
325
325
- $ this ->allPhpErrors [] = (new Error ($ errorMessage , $ errfile , $ errline , true ))->withIdentifier ('phpstan.php ' );
326
+ $ this ->allPhpErrors [] = (new Error ($ errorMessage , $ errfile , $ errline , false ))->withIdentifier ('phpstan.php ' );
326
327
327
328
if ($ errno === E_DEPRECATED ) {
328
329
return true ;
@@ -332,7 +333,7 @@ private function collectErrors(array $analysedFiles): void
332
333
return true ;
333
334
}
334
335
335
- $ this ->filteredPhpErrors [] = (new Error ($ errorMessage , $ errfile , $ errline , true ))->withIdentifier ('phpstan.php ' );
336
+ $ this ->filteredPhpErrors [] = (new Error ($ errorMessage , $ errfile , $ errline , $ errno === E_USER_DEPRECATED ))->withIdentifier ('phpstan.php ' );
336
337
337
338
return true ;
338
339
});
@@ -354,12 +355,16 @@ private function getErrorLabel(int $errno): string
354
355
return 'Parse error ' ;
355
356
case E_NOTICE :
356
357
return 'Notice ' ;
358
+ case E_DEPRECATED :
359
+ return 'Deprecated ' ;
357
360
case E_USER_ERROR :
358
361
return 'User error (E_USER_ERROR) ' ;
359
362
case E_USER_WARNING :
360
363
return 'User warning (E_USER_WARNING) ' ;
361
364
case E_USER_NOTICE :
362
365
return 'User notice (E_USER_NOTICE) ' ;
366
+ case E_USER_DEPRECATED :
367
+ return 'Deprecated (E_USER_DEPRECATED) ' ;
363
368
case E_STRICT :
364
369
return 'Strict error (E_STRICT) ' ;
365
370
}
0 commit comments