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

PSR12.Functions.NullableTypeDeclaration false positive when ternary operator used with instanceof #2791

Closed
asika32764 opened this issue Jan 1, 2020 · 2 comments · Fixed by #2794
Milestone

Comments

@asika32764
Copy link

This code will return There must not be a space between the question mark and the type in nullable type declarations

return $value instanceof static ? '(' . $value . ')' : $value;

8E7EEA1A-7EEF-45E7-8612-51C7869F6D9E

Snuffer version: 3.5.3

@jrfnl
Copy link
Contributor

jrfnl commented Jan 1, 2020

@asika32764 Tested & confirmed as a tokenizer bug.

@gsherwood gsherwood changed the title [PSR-12] Ternary operator with instanceof is wrong PSR12.Functions.NullableTypeDeclaration false positive when ternary operator used with instanceof Jan 5, 2020
@gsherwood gsherwood added this to the 3.5.4 milestone Jan 5, 2020
gsherwood added a commit that referenced this issue Jan 5, 2020
@gsherwood
Copy link
Member

Thanks for reporting this. Fix will be in 3.5.4.

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

Successfully merging a pull request may close this issue.

3 participants