Skip to content

PEAR.Functions.FunctionCallSignatureSniff throws error for blank comment lines #1344

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

Closed
uniquexor opened this issue Feb 13, 2017 · 1 comment

Comments

@uniquexor
Copy link
Contributor

There is a problem when there is an empty line in T_COMMENT within a function call with function parameters being multiline. Consider this code for an example:

foo(
    $a,
    /*
    $c,

    $d,
    */
    $e
);

I would expect the sniff to leave the empty line intact, however, it removes the empty line and even indents the code incorrectly after doing so. So, the code after running the sniff would look like this:

foo(
    $a,
    /*
    $c,
        $d,
    */
    $e
);

I can fix this problem, if someone can confirm that this is in fact a bug and not a "feature" :)

@gsherwood gsherwood changed the title PEAR.Functions.FunctionCallSignatureSniff with multiline T_COMMENT and empty lines PEAR.Functions.FunctionCallSignatureSniff throws error for blank comment lines Feb 13, 2017
gsherwood added a commit that referenced this issue Feb 13, 2017
@gsherwood
Copy link
Member

Looked like a bug to me.

I though it was best for this sniff to ignore empty comment lines because indenting them is a bit silly, and throwing an error (as it does for empty non-comment lines) seems excessive for comments.

I've fixed it up now. Thanks for reporting it.

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