-
-
Notifications
You must be signed in to change notification settings - Fork 82
[4.0] Fix exit code when phpcbf is processing STDIN #1175
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
[4.0] Fix exit code when phpcbf is processing STDIN #1175
Conversation
@jrfnl how would you like to cover this change with tests? |
I imagine it may be difficult to cover this change via the PHPUnit setup as it would require mocking |
@fredden Just checking - will you have time over the next few days to add a few bashunit tests for STDIN handling ? Or would you like me to add something ? |
I'm happy to update this, but I'm away at the moment. Earliest that I can pick this up again would be Wednesday/Thursday this week. I do have a bash script that I used for local development which will be trivial to convert into the format needed for bashunit. If you want to land this before Friday, feel free to add some tests. |
This also includes tests for when files are supplied via STDIN.
4fed094
to
7bfebcc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fredden Thanks for adding the tests! I've had a play with this and left some feedback inline. Not necessarily blocking. We could decide to merge this now and iterate on organizing the bashunit tests in a future PR.
…-when-fixing-stdin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fredden Thank you for working on this and the updates! Glad that this will be sorted before the release. 👍🏻
Description
When running
phpcbf
with a PHP file as input (eg,phpcbf < test.php
), the exit code was not reported correctly. This pull request fixes that bug. For more details, see #1082.Suggested changelog entry
Fixed exit code when phpcbf is processing STDIN
Related issues/external references
Fixes #1082
Types of changes
PR checklist