phpstan icon indicating copy to clipboard operation
phpstan copied to clipboard

Can't get the result as a file

Open cavemanlu opened this issue 1 year ago • 2 comments

To integrate phpstan and sonarcloud we have to create a file containing json with the phpstan result. PhpStan itself doesn't have an option to save the result directly to a file, and so the action doesn't. As a result, it's impossible to use the action for such integration (have to use a more talkative action). I suggest adding an option to save the output to a defined (via the option) file.

cavemanlu avatar Apr 14 '23 09:04 cavemanlu

Hi @cavemanlu ,

I'm happy to add this as a feature so it works in your workflow. Can you help me understand exactly what the contents of the file should be?

g105b avatar Apr 14 '23 12:04 g105b

Hi @cavemanlu ,

I'm happy to add this as a feature so it works in your workflow. Can you help me understand exactly what the contents of the file should be?

Hi @g105b ,

The content is the result (stdout) of phpstan execution. The exact result depends on the command arguments, but we are talking about automatization, so we use the argument '--error-format=json' and then get a json string. Example of the raw command: 'php vendor/bin/phpstan analyse --no-progress --error-format=json > phpstan-report.json'

Thanks!

cavemanlu avatar May 05 '23 08:05 cavemanlu