File: 0002-Adapt-to-recent-version-of-PHPUnit-10.patch

package info (click to toggle)
php-phpstan-phpdoc-parser 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 2,476 kB
  • sloc: php: 21,130; makefile: 50; xml: 42; sh: 17
file content (570 lines) | stat: -rw-r--r-- 16,330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
From: =?utf-8?q?David_Pr=C3=A9vot?= <david@tilapin.org>
Date: Tue, 30 May 2023 12:37:27 +0200
Subject: Adapt to recent version of PHPUnit (10)

---
 tests/PHPStan/Ast/NodeTraverserTest.php            |  2 +-
 tests/PHPStan/Parser/ConstExprParserTest.php       | 16 ++---
 tests/PHPStan/Parser/FuzzyTest.php                 | 10 +--
 tests/PHPStan/Parser/PhpDocParserTest.php          | 76 +++++++++++-----------
 tests/PHPStan/Parser/TypeParserTest.php            |  4 +-
 tests/PHPStan/Printer/DifferTest.php               |  4 +-
 .../IntegrationPrinterWithPhpParserTest.php        |  2 +-
 tests/PHPStan/Printer/PrinterTest.php              |  6 +-
 8 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/tests/PHPStan/Ast/NodeTraverserTest.php b/tests/PHPStan/Ast/NodeTraverserTest.php
index 49f3646..1c66cff 100644
--- a/tests/PHPStan/Ast/NodeTraverserTest.php
+++ b/tests/PHPStan/Ast/NodeTraverserTest.php
@@ -365,7 +365,7 @@ class NodeTraverserTest extends TestCase
 	/**
 	 * @return list<list<mixed>>
 	 */
-	public function provideTestInvalidReturn(): array
+	public static function provideTestInvalidReturn(): array
 	{
 		$num = new ConstExprIntegerNode('42');
 		$expr = new ConstTypeNode($num);
diff --git a/tests/PHPStan/Parser/ConstExprParserTest.php b/tests/PHPStan/Parser/ConstExprParserTest.php
index f823674..f800135 100644
--- a/tests/PHPStan/Parser/ConstExprParserTest.php
+++ b/tests/PHPStan/Parser/ConstExprParserTest.php
@@ -87,7 +87,7 @@ class ConstExprParserTest extends TestCase
 	}
 
 
-	public function provideTrueNodeParseData(): Iterator
+	public static function provideTrueNodeParseData(): Iterator
 	{
 		yield [
 			'true',
@@ -106,7 +106,7 @@ class ConstExprParserTest extends TestCase
 	}
 
 
-	public function provideFalseNodeParseData(): Iterator
+	public static function provideFalseNodeParseData(): Iterator
 	{
 		yield [
 			'false',
@@ -125,7 +125,7 @@ class ConstExprParserTest extends TestCase
 	}
 
 
-	public function provideNullNodeParseData(): Iterator
+	public static function provideNullNodeParseData(): Iterator
 	{
 		yield [
 			'null',
@@ -144,7 +144,7 @@ class ConstExprParserTest extends TestCase
 	}
 
 
-	public function provideIntegerNodeParseData(): Iterator
+	public static function provideIntegerNodeParseData(): Iterator
 	{
 		yield [
 			'123',
@@ -208,7 +208,7 @@ class ConstExprParserTest extends TestCase
 	}
 
 
-	public function provideFloatNodeParseData(): Iterator
+	public static function provideFloatNodeParseData(): Iterator
 	{
 		yield [
 			'123.4',
@@ -307,7 +307,7 @@ class ConstExprParserTest extends TestCase
 	}
 
 
-	public function provideStringNodeParseData(): Iterator
+	public static function provideStringNodeParseData(): Iterator
 	{
 		yield [
 			'"foo"',
@@ -336,7 +336,7 @@ class ConstExprParserTest extends TestCase
 	}
 
 
-	public function provideArrayNodeParseData(): Iterator
+	public static function provideArrayNodeParseData(): Iterator
 	{
 		yield [
 			'[]',
@@ -438,7 +438,7 @@ class ConstExprParserTest extends TestCase
 	}
 
 
-	public function provideFetchNodeParseData(): Iterator
+	public static function provideFetchNodeParseData(): Iterator
 	{
 		yield [
 			'GLOBAL_CONSTANT',
diff --git a/tests/PHPStan/Parser/FuzzyTest.php b/tests/PHPStan/Parser/FuzzyTest.php
index 9491bf6..6c4f2ae 100644
--- a/tests/PHPStan/Parser/FuzzyTest.php
+++ b/tests/PHPStan/Parser/FuzzyTest.php
@@ -50,9 +50,9 @@ class FuzzyTest extends TestCase
 		);
 	}
 
-	public function provideTypeParserData(): Iterator
+	public static function provideTypeParserData(): Iterator
 	{
-		return $this->provideFuzzyInputsData('Type');
+		return self::provideFuzzyInputsData('Type');
 	}
 
 	/**
@@ -70,12 +70,12 @@ class FuzzyTest extends TestCase
 		);
 	}
 
-	public function provideConstExprParserData(): Iterator
+	public static function provideConstExprParserData(): Iterator
 	{
-		return $this->provideFuzzyInputsData('ConstantExpr');
+		return self::provideFuzzyInputsData('ConstantExpr');
 	}
 
-	private function provideFuzzyInputsData(string $startSymbol): Iterator
+	private static function provideFuzzyInputsData(string $startSymbol): Iterator
 	{
 		$inputsDirectory = sprintf('%s/fuzzy/%s', __DIR__ . '/../../../temp', $startSymbol);
 
diff --git a/tests/PHPStan/Parser/PhpDocParserTest.php b/tests/PHPStan/Parser/PhpDocParserTest.php
index b2857b2..1ec1dc6 100644
--- a/tests/PHPStan/Parser/PhpDocParserTest.php
+++ b/tests/PHPStan/Parser/PhpDocParserTest.php
@@ -156,7 +156,7 @@ class PhpDocParserTest extends TestCase
 	}
 
 
-	public function provideParamTagsData(): Iterator
+	public static function provideParamTagsData(): Iterator
 	{
 		yield [
 			'OK without description',
@@ -536,7 +536,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideTypelessParamTagsData(): Iterator
+	public static function provideTypelessParamTagsData(): Iterator
 	{
 		yield [
 			'OK',
@@ -619,7 +619,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideParamImmediatelyInvokedCallableTagsData(): Iterator
+	public static function provideParamImmediatelyInvokedCallableTagsData(): Iterator
 	{
 		yield [
 			'OK',
@@ -650,7 +650,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideParamLaterInvokedCallableTagsData(): Iterator
+	public static function provideParamLaterInvokedCallableTagsData(): Iterator
 	{
 		yield [
 			'OK',
@@ -681,7 +681,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideParamClosureThisTagsData(): Iterator
+	public static function provideParamClosureThisTagsData(): Iterator
 	{
 		yield [
 			'OK',
@@ -729,7 +729,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function providePureUnlessCallableIsImpureTagsData(): Iterator
+	public static function providePureUnlessCallableIsImpureTagsData(): Iterator
 	{
 		yield [
 			'OK',
@@ -760,7 +760,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideVarTagsData(): Iterator
+	public static function provideVarTagsData(): Iterator
 	{
 		yield [
 			'OK without description and variable name',
@@ -1155,7 +1155,7 @@ class PhpDocParserTest extends TestCase
 	}
 
 
-	public function providePropertyTagsData(): Iterator
+	public static function providePropertyTagsData(): Iterator
 	{
 		yield [
 			'OK without description',
@@ -1357,7 +1357,7 @@ class PhpDocParserTest extends TestCase
 	}
 
 
-	public function provideReturnTagsData(): Iterator
+	public static function provideReturnTagsData(): Iterator
 	{
 		yield [
 			'OK without description',
@@ -1888,7 +1888,7 @@ class PhpDocParserTest extends TestCase
 	}
 
 
-	public function provideThrowsTagsData(): Iterator
+	public static function provideThrowsTagsData(): Iterator
 	{
 		yield [
 			'OK without description',
@@ -1975,7 +1975,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideMixinTagsData(): Iterator
+	public static function provideMixinTagsData(): Iterator
 	{
 		yield [
 			'OK without description',
@@ -2080,7 +2080,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideRequireExtendsTagsData(): Iterator
+	public static function provideRequireExtendsTagsData(): Iterator
 	{
 		yield [
 			'OK without description',
@@ -2146,7 +2146,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideRequireImplementsTagsData(): Iterator
+	public static function provideRequireImplementsTagsData(): Iterator
 	{
 		yield [
 			'OK without description',
@@ -2212,7 +2212,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideSealedTagsData(): Iterator
+	public static function provideSealedTagsData(): Iterator
 	{
 		yield [
 			'OK without description',
@@ -2287,7 +2287,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideDeprecatedTagsData(): Iterator
+	public static function provideDeprecatedTagsData(): Iterator
 	{
 		yield [
 			'OK with no description',
@@ -2393,7 +2393,7 @@ class PhpDocParserTest extends TestCase
 		];
 	}
 
-	public function provideMethodTagsData(): Iterator
+	public static function provideMethodTagsData(): Iterator
 	{
 		yield [
 			'OK non-static, without return type',
@@ -2907,7 +2907,7 @@ class PhpDocParserTest extends TestCase
 	}
 
 
-	public function provideSingleLinePhpDocData(): Iterator
+	public static function provideSingleLinePhpDocData(): Iterator
 	{
 		yield [
 			'empty',
@@ -4502,7 +4502,7 @@ test',
 		];
 	}
 
-	public function provideTemplateTagsData(): Iterator
+	public static function provideTemplateTagsData(): Iterator
 	{
 		yield [
 			'OK without bound and description',
@@ -4734,7 +4734,7 @@ test',
 		];
 	}
 
-	public function provideExtendsTagsData(): Iterator
+	public static function provideExtendsTagsData(): Iterator
 	{
 		yield [
 			'OK with one argument',
@@ -4953,7 +4953,7 @@ test',
 		];
 	}
 
-	public function provideTypeAliasTagsData(): Iterator
+	public static function provideTypeAliasTagsData(): Iterator
 	{
 		yield [
 			'OK',
@@ -5156,7 +5156,7 @@ test',
 		];
 	}
 
-	public function provideTypeAliasImportTagsData(): Iterator
+	public static function provideTypeAliasImportTagsData(): Iterator
 	{
 		yield [
 			'OK',
@@ -5294,7 +5294,7 @@ test',
 		];
 	}
 
-	public function provideAssertTagsData(): Iterator
+	public static function provideAssertTagsData(): Iterator
 	{
 		yield [
 			'OK',
@@ -5584,7 +5584,7 @@ test',
 		];
 	}
 
-	public function providerDebug(): Iterator
+	public static function providerDebug(): Iterator
 	{
 		$sample = '/**
 			 * Returns the schema for the field.
@@ -5610,7 +5610,7 @@ Computed fields having no schema should return an empty array.'),
 		];
 	}
 
-	public function provideRealWorldExampleData(): Iterator
+	public static function provideRealWorldExampleData(): Iterator
 	{
 			$sample = "/**
 			 * Returns the schema for the field.
@@ -6182,7 +6182,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideDescriptionWithOrWithoutHtml(): Iterator
+	public static function provideDescriptionWithOrWithoutHtml(): Iterator
 	{
 		yield [
 			'Description with HTML tags in @return tag (close tags together)',
@@ -6259,7 +6259,7 @@ Finder::findFiles('*.php')
 	/**
 	 * @return array<mixed>
 	 */
-	public function dataParseTagValue(): array
+	public static function dataParseTagValue(): array
 	{
 		return [
 			[
@@ -6291,7 +6291,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideTagsWithNumbers(): Iterator
+	public static function provideTagsWithNumbers(): Iterator
 	{
 		yield [
 			'OK without description and tag with number in it',
@@ -6305,7 +6305,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideTagsWithBackslash(): Iterator
+	public static function provideTagsWithBackslash(): Iterator
 	{
 		yield [
 			'OK without description and tag with backslashes in it',
@@ -6333,7 +6333,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideSelfOutTagsData(): Iterator
+	public static function provideSelfOutTagsData(): Iterator
 	{
 		yield [
 			'OK phpstan-self-out',
@@ -6406,7 +6406,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideCommentLikeDescriptions(): Iterator
+	public static function provideCommentLikeDescriptions(): Iterator
 	{
 		yield [
 			'Comment after @param',
@@ -6541,7 +6541,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideInlineTags(): Iterator
+	public static function provideInlineTags(): Iterator
 	{
 		yield [
 			'Inline @link tag in @copyright',
@@ -6562,7 +6562,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideParamOutTagsData(): Iterator
+	public static function provideParamOutTagsData(): Iterator
 	{
 		yield [
 			'OK param-out',
@@ -6595,7 +6595,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideDoctrineData(): Iterator
+	public static function provideDoctrineData(): Iterator
 	{
 		yield [
 			'single tag node with empty parameters',
@@ -7150,7 +7150,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideDoctrineWithoutDoctrineCheckData(): Iterator
+	public static function provideDoctrineWithoutDoctrineCheckData(): Iterator
 	{
 		yield [
 			'Dummy 1',
@@ -7439,7 +7439,7 @@ Finder::findFiles('*.php')
 		];
 	}
 
-	public function provideSpecializedTags(): Iterator
+	public static function provideSpecializedTags(): Iterator
 	{
 		yield [
 			'Ok specialized tag',
@@ -7507,7 +7507,7 @@ Finder::findFiles('*.php')
 	/**
 	 * @return array<mixed>
 	 */
-	public function dataLinesAndIndexes(): iterable
+	public static function dataLinesAndIndexes(): iterable
 	{
 		yield [
 			'/** @param Foo $a */',
@@ -7631,7 +7631,7 @@ Finder::findFiles('*.php')
 	/**
 	 * @return iterable<array{string, list<array{int, int, int, int}>}>
 	 */
-	public function dataDeepNodesLinesAndIndexes(): iterable
+	public static function dataDeepNodesLinesAndIndexes(): iterable
 	{
 		yield [
 			'/**' . PHP_EOL .
@@ -7716,7 +7716,7 @@ Finder::findFiles('*.php')
 	/**
 	 * @return array<mixed>
 	 */
-	public function dataReturnTypeLinesAndIndexes(): iterable
+	public static function dataReturnTypeLinesAndIndexes(): iterable
 	{
 		yield [
 			'/** @return Foo */',
diff --git a/tests/PHPStan/Parser/TypeParserTest.php b/tests/PHPStan/Parser/TypeParserTest.php
index 8fe96f5..cae31c1 100644
--- a/tests/PHPStan/Parser/TypeParserTest.php
+++ b/tests/PHPStan/Parser/TypeParserTest.php
@@ -223,7 +223,7 @@ class TypeParserTest extends TestCase
 	/**
 	 * @return array<mixed>
 	 */
-	public function provideParseData(): array
+	public static function provideParseData(): array
 	{
 		return [
 			[
@@ -3047,7 +3047,7 @@ class TypeParserTest extends TestCase
 	/**
 	 * @return array<mixed>
 	 */
-	public function dataLinesAndIndexes(): iterable
+	public static function dataLinesAndIndexes(): iterable
 	{
 		yield [
 			'int | object{foo: int}[]',
diff --git a/tests/PHPStan/Printer/DifferTest.php b/tests/PHPStan/Printer/DifferTest.php
index cca1f61..a8c3a0f 100644
--- a/tests/PHPStan/Printer/DifferTest.php
+++ b/tests/PHPStan/Printer/DifferTest.php
@@ -52,7 +52,7 @@ class DifferTest extends TestCase
 	/**
 	 * @return list<array{string, string, string}>
 	 */
-	public function provideTestDiff(): array
+	public static function provideTestDiff(): array
 	{
 		return [
 			['abc', 'abc', 'abc'],
@@ -78,7 +78,7 @@ class DifferTest extends TestCase
 	/**
 	 * @return list<array{string, string, string}>
 	 */
-	public function provideTestDiffWithReplacements(): array
+	public static function provideTestDiffWithReplacements(): array
 	{
 		return [
 			['abcde', 'axyze', 'a/bx/cy/dze'],
diff --git a/tests/PHPStan/Printer/IntegrationPrinterWithPhpParserTest.php b/tests/PHPStan/Printer/IntegrationPrinterWithPhpParserTest.php
index 045156e..994abd7 100644
--- a/tests/PHPStan/Printer/IntegrationPrinterWithPhpParserTest.php
+++ b/tests/PHPStan/Printer/IntegrationPrinterWithPhpParserTest.php
@@ -37,7 +37,7 @@ class IntegrationPrinterWithPhpParserTest extends TestCase
 	/**
 	 * @return iterable<array{string, string, NodeVisitor}>
 	 */
-	public function dataPrint(): iterable
+	public static function dataPrint(): iterable
 	{
 		$insertParameter = new class () extends AbstractNodeVisitor {
 
diff --git a/tests/PHPStan/Printer/PrinterTest.php b/tests/PHPStan/Printer/PrinterTest.php
index 464b723..0982ae5 100644
--- a/tests/PHPStan/Printer/PrinterTest.php
+++ b/tests/PHPStan/Printer/PrinterTest.php
@@ -90,7 +90,7 @@ class PrinterTest extends TestCase
 	/**
 	 * @return iterable<array{string, string, NodeVisitor}>
 	 */
-	public function dataPrintFormatPreserving(): iterable
+	public static function dataPrintFormatPreserving(): iterable
 	{
 		$noopVisitor = new class extends AbstractNodeVisitor {
 
@@ -2680,7 +2680,7 @@ class PrinterTest extends TestCase
 	/**
 	 * @return iterable<array{TypeNode, string}>
 	 */
-	public function dataPrintType(): iterable
+	public static function dataPrintType(): iterable
 	{
 		yield [
 			new IdentifierTypeNode('int'),
@@ -2824,7 +2824,7 @@ class PrinterTest extends TestCase
 	/**
 	 * @return iterable<array{PhpDocNode, string}>
 	 */
-	public function dataPrintPhpDocNode(): iterable
+	public static function dataPrintPhpDocNode(): iterable
 	{
 		yield [
 			new PhpDocNode([