Created
September 4, 2026 09:46
-
-
Save cs278/efa30a8d29102580449af5d4672e52aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| use Symfony\Component\Yaml\Yaml; | |
| require 'vendor/autoload.php'; | |
| $baseline = Yaml::parseFile('.phpstan-baseline.neon'); | |
| $errorFrequency = []; | |
| foreach ($baseline['parameters']['ignoreErrors'] as $i => $ignoredError) { | |
| $errorFrequency[$ignoredError['identifier']] = ($errorFrequency[$ignoredError['identifier']] ?? 0) + $ignoredError['count']; | |
| if ($ignoredError['identifier'] === 'instanceof.alwaysTrue') { | |
| unset($baseline['parameters']['ignoreErrors'][$i]); | |
| } | |
| } | |
| $baseline['parameters']['ignoreErrors'] = array_values($baseline['parameters']['ignoreErrors']); | |
| asort($errorFrequency, SORT_NUMERIC); | |
| dump($errorFrequency); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment