-
Notifications
You must be signed in to change notification settings - Fork 19
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
PHPCS not enforcing space after parenthesis when args span multiple lines #76
Comments
In addition PHPCBF fixes this to the following, which I don't think is quite correct - certainly not enforced by PHPCS
Digging... There are a couple of related issues. Seems a combination of the fact that WPCS isn't enforcing proper multiline function calls, and that these checks are ignroed for PHPCS only and not PHPCBF. We ran into this issue on the a different project too and ended up ignoring this sniff for PHPCBF.
|
Needs refresh to see whether this is still an issue. |
I can confirm that the original issue is still present. |
Using the most recent version of the HM Coding Standards, this does get flagged, as expected. To reproduce, execute the following in some empty folder:
This results in the following output:
Both the missing space right after the open parenthesis and the one right before the closing parenthesis get flagged. Also, running <?php
-print('foo', [
+print( 'foo', [
42,
-], 'bar');
+], 'bar' ); Can you confirm this, @mattheu? Can we close? |
The following code is NOT flagged as an error, but I would expect it to be. Note missing space after the first
(
.However it is correctly enforced if the args are on a single line. e.g.
The text was updated successfully, but these errors were encountered: