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

Squiz.Functions.FunctionDeclarationArgumentSpacing removing type hint during fixing #2284

Closed
michalbundyra opened this issue Dec 3, 2018 · 1 comment
Milestone

Comments

@michalbundyra
Copy link
Contributor

The FunctionDeclarationArgumentSpacingSniff works incorrectly for more complex type hints like:

function (
    ?array    $arr,
    \My\Name    $name
) {}

It should be easy fix, but I don't have time to do it now...

@michalbundyra michalbundyra changed the title FunctionDeclarationArgumentSpacingSniff works space after type hint FunctionDeclarationArgumentSpacingSniff - space after type hint Dec 4, 2018
@michalbundyra
Copy link
Contributor Author

I was mistaken here, the problem is because PSR-2 has:

<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint">
  <severity>0</severity>
 </rule>

but I have found the other problem with above code, it was fixed as:

function (
    ? $arr,
    \My\Name $name
) {}

so array has been removed.

I'm going to submit PR in a minute.

michalbundyra added a commit to michalbundyra/Squizlabs_PHP_CodeSniffer that referenced this issue Dec 9, 2018
@gsherwood gsherwood added this to the 3.4.0 milestone Dec 10, 2018
@gsherwood gsherwood changed the title FunctionDeclarationArgumentSpacingSniff - space after type hint Squiz.Functions.FunctionDeclarationArgumentSpacing removing type hint during fixing Dec 10, 2018
gsherwood added a commit that referenced this issue Dec 10, 2018
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