Skip to content

Squiz.WhiteSpace.MemberVarSpacing - inconsistent checking of member vars with comment #414

@VasekPurchart

Description

@VasekPurchart

After upgrading to 2.x I have found this strange error, that was not reported in 1.5.x versions.

This code works fine obviously:

class Foo { private $foo; private $bar; }

but when you add an inline comment, it starts to throw an Squiz.WhiteSpace.MemberVarSpacing.AfterComment for the line with the comment:

class Foo { private $foo; // comment private $bar; }

This was not checked in previous versions, but is understandable - which one is correct behavior according to Squiz?

Strange is, that this situation is not reported consistently, because the following example produces no errors at all:

class Foo { private $foo; // comment /**  * @var type  */ private $bar; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions