We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using the following example:
<?php declare(strict_types=1); $foo = false; $fn = static fn () => ', World!'; echo 'Hello' . ($foo ? ' There' : $fn()); echo "\n"; echo 'Hello' . ($foo) ? ' There' : $fn(); echo "\n"; echo 'Hello' . (($foo) ? ' There' : $fn()); echo "\n";
Running phpcs using the Doctrine Coding Standard against this file produces the following:
$ phpcs --standard=Doctrine test.php ---------------------------------------------------------------------- FOUND 3 ERRORS AFFECTING 2 LINES ---------------------------------------------------------------------- 10 | ERROR | [x] Useless parentheses. 12 | ERROR | [x] Useless parentheses. 12 | ERROR | [x] Useless parentheses. ----------------------------------------------------------------------
As you can see, the first block was not flagged as violating the standard while the second and third were.
phpcbf modifies the file in the following way:
phpcbf
<?php declare(strict_types=1); $foo = false; $fn = static fn () => ', World!'; echo 'Hello' . ($foo ? ' There' : $fn()); echo "\n"; echo 'Hello' . $foo ? ' There' : $fn(); echo "\n"; echo 'Hello' . $foo ? ' There' : $fn(); echo "\n";
Which does not make it syntactically invalid, but does drastically change the meaning of the code.
Before running phpcbf it outputs:
Hello, World! There Hello, World!
After running phpcbf it outputs:
Hello, World! There There
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using the following example:
Running phpcs using the Doctrine Coding Standard against this file produces the following:
As you can see, the first block was not flagged as violating the standard while the second and third were.
phpcbf
modifies the file in the following way:Which does not make it syntactically invalid, but does drastically change the meaning of the code.
Before running
phpcbf
it outputs:After running
phpcbf
it outputs:The text was updated successfully, but these errors were encountered: