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