Skip to content

CakePHP.WhiteSpace.FunctionSpacing should recognize comments #409

@utdrmac

Description

@utdrmac
1 public function foo(): void {
2  //blah
3 }
4
5 // here's a comment
6 public function bar(): void {
7  //blah
8 }

The above produces an error:
6 | ERROR | [x] Every function/method needs a newline before (CakePHP.WhiteSpace.FunctionSpacing.Concrete)

Line 4 is a newline, which, IMO, satisfies the sniff requirement. The sniff is not paying attention to the fact that just above is a comment, and above that comment is a new line.

Changing line 5 to this /** here's a comment */ passes the sniff. Why does one comment style pass and the other does not? Both are perfectly valid php comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions