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

FunctionCallArgumentSpacing sniff complains about more than one space before comment in multi-line function call #825

Closed
bskendig opened this issue Dec 17, 2015 · 1 comment

Comments

@bskendig
Copy link

If you have a multi-line function call and you put a comment after one of the arguments, the Zend sniff standard will complain if you have more than one space between the comma and the comment. It should not complain about this.

With a multi-line array, it accepts more than one space.

$ cat test.php
<?php
$a = array(
    "1",
    "2",  // this is a comment
    "3"
);
$b = foo(
    "1",
    "2",  // this is a comment
    "3"
);
main $ phpcs25 test.php

FILE: test.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 2 | ERROR | Missing file doc comment
----------------------------------------------------------------------

Time: 19ms; Memory: 3.75Mb

main $ phpcs25 --standard=Zend test.php

FILE: test.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 9 | ERROR | [x] Expected 1 space after comma in function call; 2
   |       |     found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 14ms; Memory: 3Mb
@gsherwood gsherwood changed the title "Zend" standard complains about more than one space before comment in multi-line function call FunctionCallArgumentSpacing sniff complains about more than one space before comment in multi-line function call Dec 20, 2015
gsherwood added a commit that referenced this issue Dec 20, 2015
…re than one space before comment in multi-line function call
@gsherwood
Copy link
Member

Thanks for reporting.

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

No branches or pull requests

2 participants