@@ -57,7 +57,14 @@ 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 gen (string $ content ): \Generator
67+ {
6168 $ line = strtok ($ content , "\n" );
6269 while ($ line !== false ) {
6370 $ line = strtok ("\n" );
@@ -66,7 +73,8 @@ function gen(string $content): \Generator {
6673}
6774
6875// @phpcsErrorCodeOnNextLine GeneratorReturnTypeWithoutYield
69- function genNoYield (string $ content ): \Generator {
76+ function genNoYield (string $ content ): \Generator
77+ {
7078 $ line = strtok ($ content , "\n" );
7179 while ($ line !== false ) {
7280 $ line = strtok ("\n" );
@@ -77,7 +85,8 @@ function genNoYield(string $content): \Generator {
7785}
7886
7987// @phpcsWarningCodeOnNextLine NoGeneratorReturnType
80- function yieldNoGen (string $ content ) {
88+ function yieldNoGen (string $ content )
89+ {
8190 $ line = strtok ($ content , "\n" );
8291 while ($ line !== false ) {
8392 $ line = strtok ("\n" );
@@ -86,7 +95,8 @@ function yieldNoGen(string $content) {
8695}
8796
8897// @phpcsErrorCodeOnNextLine IncorrectReturnTypeForGenerator
89- function yieldWrongReturn (string $ content ): int {
98+ function yieldWrongReturn (string $ content ): int
99+ {
90100 $ line = strtok ($ content , "\n" );
91101 while ($ line !== false ) {
92102 $ line = strtok ("\n" );
@@ -96,7 +106,8 @@ function yieldWrongReturn(string $content): int {
96106 return 1 ;
97107}
98108
99- function yieldIteratorReturn (string $ content ): \Iterator {
109+ function yieldIteratorReturn (string $ content ): \Iterator
110+ {
100111 $ line = strtok ($ content , "\n" );
101112 while ($ line !== false ) {
102113 $ line = strtok ("\n" );
@@ -107,9 +118,10 @@ function yieldIteratorReturn(string $content): \Iterator {
107118}
108119
109120
110- function genFrom (): \Generator {
121+ function genFrom (): \Generator
122+ {
111123
112- $ gen = function (int $ x ): int {
124+ $ gen = function (int $ x ): int {
113125 if ($ x < 0 ) {
114126 return 0 ;
115127 }
@@ -126,12 +138,13 @@ function genFrom(): \Generator {
126138}
127139
128140// @phpcsWarningCodeOnNextLine InvalidGeneratorManyReturns
129- function genMultiReturn (): \Generator {
141+ function genMultiReturn (): \Generator
142+ {
130143 if (defined ('MEH_MEH ' )) {
131144 return 1 ;
132145 }
133146
134- yield from [1 ,2 ];
147+ yield from [1 , 2 ];
135148
136149 if (defined ('MEH ' )) {
137150 return 1 ;
@@ -369,7 +382,7 @@ public function iReturnALotOfStuff() // @phpcsWarningCodeOnThisLine NoReturnType
369382 }
370383
371384 // @phpcsErrorCodeOnNextLine IncorrectVoidReturn
372- public function iReturnWrongNull () : \ArrayAccess
385+ public function iReturnWrongNull (): \ArrayAccess
373386 {
374387 if (rand (1 , 4 ) > 2 ) {
375388 return null ;
0 commit comments