File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
Inpsyde/Sniffs/CodeQuality Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ private function checkBodyStart(
86
86
87
87
$ error =
88
88
($ isMultiLineDeclare || $ isSingleLineSignature ) && $ bodyLine !== ($ openerLine + 2 )
89
- || $ isSingleLineDeclare && $ bodyLine !== ($ openerLine + 1 );
89
+ || $ isSingleLineDeclare && $ bodyLine > ($ openerLine + 2 );
90
90
91
91
if (!$ error ) {
92
92
return [null , null , null ];
Original file line number Diff line number Diff line change @@ -8,13 +8,21 @@ function foo()
8
8
return 'foo ' ;
9
9
}
10
10
11
- // @phpcsWarningCodeOnNextLine WrongForSingleLineDeclaration
11
+ // tolerate this as PHPStorm code styler cannot distinguish between
12
+ // single line and multiline function declarations. See issue #32
12
13
function bar ()
13
14
{
14
15
15
16
return 'bar ' ;
16
17
}
17
18
19
+ // @phpcsWarningCodeOnNextLine WrongForSingleLineSignature
20
+ function lorem () {
21
+
22
+
23
+ return 'ipsum ' ;
24
+ }
25
+
18
26
// @phpcsWarningCodeOnNextLine WrongForMultiLineDeclaration
19
27
function fooFoo (
20
28
string $ foo ,
@@ -66,13 +74,19 @@ public function foo()
66
74
return 'foo ' ;
67
75
}
68
76
69
- // @phpcsWarningCodeOnNextLine WrongForSingleLineDeclaration
70
77
private function bar ()
71
78
{
72
79
73
80
return 'bar ' ;
74
81
}
75
82
83
+ // @phpcsWarningCodeOnNextLine WrongForSingleLineSignature
84
+ public function lorem () {
85
+
86
+
87
+ return 'ipsum ' ;
88
+ }
89
+
76
90
// @phpcsWarningCodeOnNextLine WrongForMultiLineDeclaration
77
91
protected function fooFoo (
78
92
string $ foo ,
You can’t perform that action at this time.
0 commit comments