File tree Expand file tree Collapse file tree 3 files changed +35
-8
lines changed Expand file tree Collapse file tree 3 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ public static function isHookClosure(
330
330
}
331
331
332
332
$ lookForComma = $ file ->findPrevious (
333
- [T_WHITESPACE ],
333
+ [T_WHITESPACE , T_STATIC ],
334
334
$ closurePosition - 1 ,
335
335
null ,
336
336
true ,
Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ function ($foo) {
60
60
}
61
61
);
62
62
63
+ add_filter (
64
+ 'foo ' ,
65
+ static function ($ foo ) {
66
+ return true ;
67
+ }
68
+ );
69
+
63
70
array_map (
64
71
function ($ foo ) { // @phpcsWarningOnThisLine
65
72
@@ -173,15 +180,31 @@ function (PHPUnit\Exception $meh = null) use ($baz)
173
180
class ArgumentTypeDeclarationSniffTestFixture
174
181
{
175
182
// @phpcsWarningOnNextLine
176
- function a ($ bar )
183
+ public function a ($ bar )
177
184
{
178
185
function (array $ baz ) use ($ bar )
179
186
{
180
187
181
188
}
182
189
}
183
190
184
- function b(array $ bar )
191
+ // @phpcsWarningOnNextLine
192
+ private function ap ($ bar )
193
+ {
194
+ function (array $ baz ) use ($ bar )
195
+ {
196
+
197
+ }
198
+ }
199
+
200
+ /**
201
+ * @wp-hook foo
202
+ */
203
+ private function theHook ($ param )
204
+ {
205
+ }
206
+
207
+ protected function b(array $ bar )
185
208
{
186
209
function (array $ baz ) use ($ bar )
187
210
{
@@ -193,7 +216,7 @@ function ($meh) use ($baz)
193
216
}
194
217
}
195
218
196
- function c(array $ bar )
219
+ private function c(array $ bar )
197
220
{
198
221
199
222
function (array $ baz ) use ($ bar )
Original file line number Diff line number Diff line change @@ -184,6 +184,10 @@ function genMultiReturn(): \Generator
184
184
return '' ;
185
185
});
186
186
187
+ add_filter ('x ' , static function () {
188
+ return '' ;
189
+ });
190
+
187
191
// @phpcsErrorCodeOnNextLine IncorrectVoidReturnType
188
192
add_filter ('x ' , function (): void {
189
193
return '0 ' ;
@@ -243,7 +247,7 @@ function noHookCallback() // @phpcsWarningCodeOnThisLine NoReturnType
243
247
class WrapperHookWrapper
244
248
{
245
249
246
- function filterWrapper (string $ x , int $ y ): bool
250
+ public function filterWrapper (string $ x , int $ y ): bool
247
251
{
248
252
249
253
// @phpcsWarningCodeOnNextLine NoReturnType
@@ -275,7 +279,7 @@ function ($x, $y) {
275
279
}
276
280
277
281
// @phpcsWarningCodeOnNextLine NoReturnType
278
- function problematicMethod ()
282
+ protected function problematicMethod ()
279
283
{
280
284
return 'x ' ;
281
285
}
@@ -284,13 +288,13 @@ function problematicMethod()
284
288
* @return string
285
289
* @wp-hook Meh
286
290
*/
287
- function hookMethod ()
291
+ private function hookMethod ()
288
292
{
289
293
return 'x ' ;
290
294
}
291
295
292
296
// @phpcsErrorCodeOnNextLine IncorrectVoidReturn
293
- function problematicMethodTwo (): bool
297
+ protected function problematicMethodTwo (): bool
294
298
{
295
299
if (true ) {
296
300
return true ;
You can’t perform that action at this time.
0 commit comments