nunomaduro / phpinsights

🔰 Instant PHP quality checks from your console
https://phpinsights.com
MIT License
5.28k stars 281 forks source link

Adding a bootstrap option will help to load external resources and fix an issue #684

Closed llaville closed 2 months ago

llaville commented 3 months ago
Q A
Bug report? yes
Feature request? yes
Library version 2.11.0

I consider it both as a feature, because it does exists yet, and an issue because we cannot use External Formatter (even if code allow it).

See https://github.com/nunomaduro/phpinsights/blob/v2.11.0/src/Application/Console/Formatters/FormatResolver.php#L75-L77

Trying on one of my project (still in dev, but no source yet online)

../../vendor/bin/phpinsights analyse --format='\Bartlett\Sarif\Converter\Reporter\PhpInsightsFormatter'

I got following response from PHP Insights

Could not find requested format [\Bartlett\Sarif\Converter\Reporter\PhpInsightsFormatter].
No requested formats were found, using fallback [console] instead.

But If I modify the binary launcher and register my project autoloader, then I got results expected !