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.WhiteSpace.ScopeKeywordSpacing removes member var name while fixing if no space after scope keyword #1803

Closed
mikeburg opened this issue Dec 21, 2017 · 1 comment
Milestone

Comments

@mikeburg
Copy link

This bug exists phpcbf with version 3.2.2 as well as version 2.7.

phpcbf will remove a method variable name assignment when there is no space between the name and the variable properties.

The following code:

class Foo {
// note the lack of space between static and $BAR
public static$BAR = array(1,2,3);
}

will be reformatted as:

class Foo {
public static = array(1,2,3);
}

If phpcbf is run against the reformat, the statement "public static = array(1,2,3);" will be considered as valid php.

@gsherwood gsherwood added this to the 3.2.3 milestone Dec 21, 2017
@gsherwood gsherwood changed the title Removal of method variable name Squiz.WhiteSpace.ScopeKeywordSpacing removes member var name while fixing if no space after scope keyword Dec 21, 2017
gsherwood added a commit that referenced this issue Dec 21, 2017
… var name while fixing if no space after scope keyword
@gsherwood
Copy link
Member

Thanks for reporting this. The sniff now fixes this case properly.

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