When starting to use PHPStan on an existing project there might be thousands of errors.
In this case I find useful to group the errors by error type to be able to handle similar errors together and to have an overview which errors need attention first.
The challenge is there is no errorType property in AnalysisResult
I wrote a custom formatter, which uses regular expressions on the error messages as a workaround, but it is nasty and not reliable solution
The desired output
List of errors grouped by error type

A compact summary of error types and counts as an overview

I did get this compact report by commenting out one line in my custom formatter. This would need to be a second formater or there needs to be a possibility to pass a parameter to the formater from the command line.
When starting to use PHPStan on an existing project there might be thousands of errors.
In this case I find useful to group the errors by error type to be able to handle similar errors together and to have an overview which errors need attention first.
The challenge is there is no errorType property in AnalysisResult
I wrote a custom formatter, which uses regular expressions on the error messages as a workaround, but it is nasty and not reliable solution
The desired output
List of errors grouped by error type

A compact summary of error types and counts as an overview

I did get this compact report by commenting out one line in my custom formatter. This would need to be a second formater or there needs to be a possibility to pass a parameter to the formater from the command line.