@@ -57,7 +57,18 @@ function g(): bool
5757 return false ;
5858}
5959
60- function gen (string $ content ): \Generator {
60+ // @phpcsErrorCodeOnNextLine IncorrectVoidReturnType
61+ function h (): void
62+ {
63+ return null === true ;
64+ }
65+
66+ function hh (): void {
67+ return null ;
68+ }
69+
70+ function gen (string $ content ): \Generator
71+ {
6172 $ line = strtok ($ content , "\n" );
6273 while ($ line !== false ) {
6374 $ line = strtok ("\n" );
@@ -66,7 +77,8 @@ function gen(string $content): \Generator {
6677}
6778
6879// @phpcsErrorCodeOnNextLine GeneratorReturnTypeWithoutYield
69- function genNoYield (string $ content ): \Generator {
80+ function genNoYield (string $ content ): \Generator
81+ {
7082 $ line = strtok ($ content , "\n" );
7183 while ($ line !== false ) {
7284 $ line = strtok ("\n" );
@@ -77,7 +89,8 @@ function genNoYield(string $content): \Generator {
7789}
7890
7991// @phpcsWarningCodeOnNextLine NoGeneratorReturnType
80- function yieldNoGen (string $ content ) {
92+ function yieldNoGen (string $ content )
93+ {
8194 $ line = strtok ($ content , "\n" );
8295 while ($ line !== false ) {
8396 $ line = strtok ("\n" );
@@ -86,7 +99,8 @@ function yieldNoGen(string $content) {
8699}
87100
88101// @phpcsErrorCodeOnNextLine IncorrectReturnTypeForGenerator
89- function yieldWrongReturn (string $ content ): int {
102+ function yieldWrongReturn (string $ content ): int
103+ {
90104 $ line = strtok ($ content , "\n" );
91105 while ($ line !== false ) {
92106 $ line = strtok ("\n" );
@@ -96,7 +110,8 @@ function yieldWrongReturn(string $content): int {
96110 return 1 ;
97111}
98112
99- function yieldIteratorReturn (string $ content ): \Iterator {
113+ function yieldIteratorReturn (string $ content ): \Iterator
114+ {
100115 $ line = strtok ($ content , "\n" );
101116 while ($ line !== false ) {
102117 $ line = strtok ("\n" );
@@ -107,9 +122,10 @@ function yieldIteratorReturn(string $content): \Iterator {
107122}
108123
109124
110- function genFrom (): \Generator {
125+ function genFrom (): \Generator
126+ {
111127
112- $ gen = function (int $ x ): int {
128+ $ gen = function (int $ x ): int {
113129 if ($ x < 0 ) {
114130 return 0 ;
115131 }
@@ -126,12 +142,13 @@ function genFrom(): \Generator {
126142}
127143
128144// @phpcsWarningCodeOnNextLine InvalidGeneratorManyReturns
129- function genMultiReturn (): \Generator {
145+ function genMultiReturn (): \Generator
146+ {
130147 if (defined ('MEH_MEH ' )) {
131148 return 1 ;
132149 }
133150
134- yield from [1 ,2 ];
151+ yield from [1 , 2 ];
135152
136153 if (defined ('MEH ' )) {
137154 return 1 ;
@@ -369,7 +386,7 @@ public function iReturnALotOfStuff() // @phpcsWarningCodeOnThisLine NoReturnType
369386 }
370387
371388 // @phpcsErrorCodeOnNextLine IncorrectVoidReturn
372- public function iReturnWrongNull () : \ArrayAccess
389+ public function iReturnWrongNull (): \ArrayAccess
373390 {
374391 if (rand (1 , 4 ) > 2 ) {
375392 return null ;
0 commit comments