@@ -57,7 +57,18 @@ function g(): bool
57
57
return false ;
58
58
}
59
59
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
+ {
61
72
$ line = strtok ($ content , "\n" );
62
73
while ($ line !== false ) {
63
74
$ line = strtok ("\n" );
@@ -66,7 +77,8 @@ function gen(string $content): \Generator {
66
77
}
67
78
68
79
// @phpcsErrorCodeOnNextLine GeneratorReturnTypeWithoutYield
69
- function genNoYield (string $ content ): \Generator {
80
+ function genNoYield (string $ content ): \Generator
81
+ {
70
82
$ line = strtok ($ content , "\n" );
71
83
while ($ line !== false ) {
72
84
$ line = strtok ("\n" );
@@ -77,7 +89,8 @@ function genNoYield(string $content): \Generator {
77
89
}
78
90
79
91
// @phpcsWarningCodeOnNextLine NoGeneratorReturnType
80
- function yieldNoGen (string $ content ) {
92
+ function yieldNoGen (string $ content )
93
+ {
81
94
$ line = strtok ($ content , "\n" );
82
95
while ($ line !== false ) {
83
96
$ line = strtok ("\n" );
@@ -86,7 +99,8 @@ function yieldNoGen(string $content) {
86
99
}
87
100
88
101
// @phpcsErrorCodeOnNextLine IncorrectReturnTypeForGenerator
89
- function yieldWrongReturn (string $ content ): int {
102
+ function yieldWrongReturn (string $ content ): int
103
+ {
90
104
$ line = strtok ($ content , "\n" );
91
105
while ($ line !== false ) {
92
106
$ line = strtok ("\n" );
@@ -96,7 +110,8 @@ function yieldWrongReturn(string $content): int {
96
110
return 1 ;
97
111
}
98
112
99
- function yieldIteratorReturn (string $ content ): \Iterator {
113
+ function yieldIteratorReturn (string $ content ): \Iterator
114
+ {
100
115
$ line = strtok ($ content , "\n" );
101
116
while ($ line !== false ) {
102
117
$ line = strtok ("\n" );
@@ -107,9 +122,10 @@ function yieldIteratorReturn(string $content): \Iterator {
107
122
}
108
123
109
124
110
- function genFrom (): \Generator {
125
+ function genFrom (): \Generator
126
+ {
111
127
112
- $ gen = function (int $ x ): int {
128
+ $ gen = function (int $ x ): int {
113
129
if ($ x < 0 ) {
114
130
return 0 ;
115
131
}
@@ -126,12 +142,13 @@ function genFrom(): \Generator {
126
142
}
127
143
128
144
// @phpcsWarningCodeOnNextLine InvalidGeneratorManyReturns
129
- function genMultiReturn (): \Generator {
145
+ function genMultiReturn (): \Generator
146
+ {
130
147
if (defined ('MEH_MEH ' )) {
131
148
return 1 ;
132
149
}
133
150
134
- yield from [1 ,2 ];
151
+ yield from [1 , 2 ];
135
152
136
153
if (defined ('MEH ' )) {
137
154
return 1 ;
@@ -369,7 +386,7 @@ public function iReturnALotOfStuff() // @phpcsWarningCodeOnThisLine NoReturnType
369
386
}
370
387
371
388
// @phpcsErrorCodeOnNextLine IncorrectVoidReturn
372
- public function iReturnWrongNull () : \ArrayAccess
389
+ public function iReturnWrongNull (): \ArrayAccess
373
390
{
374
391
if (rand (1 , 4 ) > 2 ) {
375
392
return null ;
0 commit comments