Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the result as a file #20

Open
cavemanlu opened this issue Apr 14, 2023 · 2 comments
Open

Can't get the result as a file #20

cavemanlu opened this issue Apr 14, 2023 · 2 comments

Comments

@cavemanlu
Copy link

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.

@g105b
Copy link
Member

g105b commented Apr 14, 2023

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?

@cavemanlu
Copy link
Author

cavemanlu commented May 5, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants