You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.