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(
8686
8787 $ error =
8888 ($ isMultiLineDeclare || $ isSingleLineSignature ) && $ bodyLine !== ($ openerLine + 2 )
89- || $ isSingleLineDeclare && $ bodyLine !== ($ openerLine + 1 );
89+ || $ isSingleLineDeclare && $ bodyLine > ($ openerLine + 2 );
9090
9191 if (!$ error ) {
9292 return [null , null , null ];
Original file line number Diff line number Diff line change @@ -8,13 +8,21 @@ function foo()
88 return 'foo ' ;
99}
1010
11- // @phpcsWarningCodeOnNextLine WrongForSingleLineDeclaration
11+ // tolerate this as PHPStorm code styler cannot distinguish between
12+ // single line and multiline function declarations. See issue #32
1213function bar ()
1314{
1415
1516 return 'bar ' ;
1617}
1718
19+ // @phpcsWarningCodeOnNextLine WrongForSingleLineSignature
20+ function lorem () {
21+
22+
23+ return 'ipsum ' ;
24+ }
25+
1826// @phpcsWarningCodeOnNextLine WrongForMultiLineDeclaration
1927function fooFoo (
2028 string $ foo ,
@@ -66,13 +74,19 @@ public function foo()
6674 return 'foo ' ;
6775 }
6876
69- // @phpcsWarningCodeOnNextLine WrongForSingleLineDeclaration
7077 private function bar ()
7178 {
7279
7380 return 'bar ' ;
7481 }
7582
83+ // @phpcsWarningCodeOnNextLine WrongForSingleLineSignature
84+ public function lorem () {
85+
86+
87+ return 'ipsum ' ;
88+ }
89+
7690 // @phpcsWarningCodeOnNextLine WrongForMultiLineDeclaration
7791 protected function fooFoo (
7892 string $ foo ,
You can’t perform that action at this time.
0 commit comments