@@ -71,7 +71,6 @@ public function testIsCandidateReturnsFalseWhenNoClass(): void
71
71
public function testBuildDocBlockWithEmptyAnnotations (): void
72
72
{
73
73
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
74
- $ method ->setAccessible (true );
75
74
76
75
$ result = $ method ->invoke ($ this ->fixer , [], 'TestClass ' );
77
76
@@ -81,7 +80,6 @@ public function testBuildDocBlockWithEmptyAnnotations(): void
81
80
public function testBuildDocBlockWithSingleAnnotation (): void
82
81
{
83
82
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
84
- $ method ->setAccessible (true );
85
83
86
84
$ result = $ method ->invoke ($ this ->fixer , ['author ' => 'John Doe <john@example.com> ' ], '' );
87
85
@@ -92,7 +90,6 @@ public function testBuildDocBlockWithSingleAnnotation(): void
92
90
public function testBuildDocBlockWithMultipleAnnotations (): void
93
91
{
94
92
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
95
- $ method ->setAccessible (true );
96
93
97
94
$ result = $ method ->invoke ($ this ->fixer , [
98
95
'author ' => 'John Doe <john@example.com> ' ,
@@ -106,7 +103,6 @@ public function testBuildDocBlockWithMultipleAnnotations(): void
106
103
public function testBuildDocBlockWithArrayValue (): void
107
104
{
108
105
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
109
- $ method ->setAccessible (true );
110
106
111
107
$ result = $ method ->invoke ($ this ->fixer , [
112
108
'author ' => [
@@ -123,7 +119,6 @@ public function testBuildDocBlockWithArrayValue(): void
123
119
public function testBuildDocBlockWithEmptyValue (): void
124
120
{
125
121
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
126
- $ method ->setAccessible (true );
127
122
128
123
$ result = $ method ->invoke ($ this ->fixer , [
129
124
'deprecated ' => '' ,
@@ -137,7 +132,6 @@ public function testBuildDocBlockWithEmptyValue(): void
137
132
public function testBuildDocBlockWithNullValue (): void
138
133
{
139
134
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
140
- $ method ->setAccessible (true );
141
135
142
136
$ result = $ method ->invoke ($ this ->fixer , [
143
137
'internal ' => null ,
@@ -151,7 +145,6 @@ public function testBuildDocBlockWithNullValue(): void
151
145
public function testBuildDocBlockWithMixedEmptyAndNonEmptyValues (): void
152
146
{
153
147
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
154
- $ method ->setAccessible (true );
155
148
156
149
$ result = $ method ->invoke ($ this ->fixer , [
157
150
'deprecated ' => '' ,
@@ -189,7 +182,6 @@ public function testConfigurationDefinition(): void
189
182
public function testParseExistingAnnotations (): void
190
183
{
191
184
$ method = new ReflectionMethod ($ this ->fixer , 'parseExistingAnnotations ' );
192
- $ method ->setAccessible (true );
193
185
194
186
$ docBlock = "/** \n * @author John Doe \n * @license MIT \n */ " ;
195
187
$ result = $ method ->invoke ($ this ->fixer , $ docBlock );
@@ -205,7 +197,6 @@ public function testParseExistingAnnotations(): void
205
197
public function testMergeAnnotations (): void
206
198
{
207
199
$ method = new ReflectionMethod ($ this ->fixer , 'mergeAnnotations ' );
208
- $ method ->setAccessible (true );
209
200
210
201
$ existing = ['author ' => 'Existing Author ' , 'version ' => '1.0 ' ];
211
202
$ new = ['author ' => 'New Author ' , 'license ' => 'MIT ' ];
@@ -228,7 +219,6 @@ public function testApplyFixWithEmptyAnnotations(): void
228
219
$ file = new SplFileInfo (__FILE__ );
229
220
230
221
$ method = new ReflectionMethod ($ this ->fixer , 'applyFix ' );
231
- $ method ->setAccessible (true );
232
222
233
223
$ this ->fixer ->configure (['annotations ' => []]);
234
224
$ method ->invoke ($ this ->fixer , $ file , $ tokens );
@@ -243,7 +233,6 @@ public function testApplyFixAddsDocBlockToClass(): void
243
233
$ file = new SplFileInfo (__FILE__ );
244
234
245
235
$ method = new ReflectionMethod ($ this ->fixer , 'applyFix ' );
246
- $ method ->setAccessible (true );
247
236
248
237
$ this ->fixer ->configure ([
249
238
'annotations ' => ['author ' => 'John Doe ' ],
@@ -262,7 +251,6 @@ public function testApplyFixHandlesMultipleClasses(): void
262
251
$ file = new SplFileInfo (__FILE__ );
263
252
264
253
$ method = new ReflectionMethod ($ this ->fixer , 'applyFix ' );
265
- $ method ->setAccessible (true );
266
254
267
255
$ this ->fixer ->configure ([
268
256
'annotations ' => ['author ' => 'John Doe ' ],
@@ -281,7 +269,6 @@ public function testProcessClassDocBlockWithNewDocBlock(): void
281
269
$ annotations = ['author ' => 'John Doe ' ];
282
270
283
271
$ method = new ReflectionMethod ($ this ->fixer , 'processStructureDocBlock ' );
284
- $ method ->setAccessible (true );
285
272
286
273
$ this ->fixer ->configure (['separate ' => 'none ' ]);
287
274
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
@@ -297,7 +284,6 @@ public function testProcessClassDocBlockWithExistingDocBlockPreserve(): void
297
284
$ annotations = ['author ' => 'John Doe ' ];
298
285
299
286
$ method = new ReflectionMethod ($ this ->fixer , 'processStructureDocBlock ' );
300
- $ method ->setAccessible (true );
301
287
302
288
$ this ->fixer ->configure (['preserve_existing ' => true ]);
303
289
$ method ->invoke ($ this ->fixer , $ tokens , 2 , $ annotations , 'Foo ' );
@@ -313,7 +299,6 @@ public function testProcessClassDocBlockWithExistingDocBlockReplace(): void
313
299
$ annotations = ['author ' => 'John Doe ' ];
314
300
315
301
$ method = new ReflectionMethod ($ this ->fixer , 'processStructureDocBlock ' );
316
- $ method ->setAccessible (true );
317
302
318
303
$ this ->fixer ->configure (['preserve_existing ' => false ]);
319
304
$ method ->invoke ($ this ->fixer , $ tokens , 2 , $ annotations , 'Foo ' );
@@ -328,7 +313,6 @@ public function testFindExistingDocBlockFound(): void
328
313
$ tokens = Tokens::fromCode ($ code );
329
314
330
315
$ method = new ReflectionMethod ($ this ->fixer , 'findExistingDocBlock ' );
331
- $ method ->setAccessible (true );
332
316
333
317
$ result = $ method ->invoke ($ this ->fixer , $ tokens , 2 );
334
318
@@ -341,7 +325,6 @@ public function testFindExistingDocBlockNotFound(): void
341
325
$ tokens = Tokens::fromCode ($ code );
342
326
343
327
$ method = new ReflectionMethod ($ this ->fixer , 'findExistingDocBlock ' );
344
- $ method ->setAccessible (true );
345
328
346
329
$ result = $ method ->invoke ($ this ->fixer , $ tokens , 1 );
347
330
@@ -354,7 +337,6 @@ public function testFindExistingDocBlockWithModifiers(): void
354
337
$ tokens = Tokens::fromCode ($ code );
355
338
356
339
$ method = new ReflectionMethod ($ this ->fixer , 'findExistingDocBlock ' );
357
- $ method ->setAccessible (true );
358
340
359
341
$ result = $ method ->invoke ($ this ->fixer , $ tokens , 3 );
360
342
@@ -368,7 +350,6 @@ public function testMergeWithExistingDocBlock(): void
368
350
$ annotations = ['author ' => 'John Doe ' ];
369
351
370
352
$ method = new ReflectionMethod ($ this ->fixer , 'mergeWithExistingDocBlock ' );
371
- $ method ->setAccessible (true );
372
353
373
354
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
374
355
@@ -383,7 +364,6 @@ public function testReplaceDocBlock(): void
383
364
$ annotations = ['author ' => 'John Doe ' ];
384
365
385
366
$ method = new ReflectionMethod ($ this ->fixer , 'replaceDocBlock ' );
386
- $ method ->setAccessible (true );
387
367
388
368
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
389
369
@@ -398,7 +378,6 @@ public function testInsertNewDocBlockWithSeparateNone(): void
398
378
$ annotations = ['author ' => 'John Doe ' ];
399
379
400
380
$ method = new ReflectionMethod ($ this ->fixer , 'insertNewDocBlock ' );
401
- $ method ->setAccessible (true );
402
381
403
382
$ this ->fixer ->configure (['separate ' => 'none ' ]);
404
383
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
@@ -414,7 +393,6 @@ public function testInsertNewDocBlockWithSeparateTop(): void
414
393
$ annotations = ['author ' => 'John Doe ' ];
415
394
416
395
$ method = new ReflectionMethod ($ this ->fixer , 'insertNewDocBlock ' );
417
- $ method ->setAccessible (true );
418
396
419
397
$ this ->fixer ->configure (['separate ' => 'top ' ]);
420
398
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
@@ -431,7 +409,6 @@ public function testInsertNewDocBlockWithSeparateBottom(): void
431
409
$ annotations = ['author ' => 'John Doe ' ];
432
410
433
411
$ method = new ReflectionMethod ($ this ->fixer , 'insertNewDocBlock ' );
434
- $ method ->setAccessible (true );
435
412
436
413
$ this ->fixer ->configure (['separate ' => 'bottom ' ]);
437
414
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
@@ -448,7 +425,6 @@ public function testInsertNewDocBlockWithSeparateBoth(): void
448
425
$ annotations = ['author ' => 'John Doe ' ];
449
426
450
427
$ method = new ReflectionMethod ($ this ->fixer , 'insertNewDocBlock ' );
451
- $ method ->setAccessible (true );
452
428
453
429
$ this ->fixer ->configure (['separate ' => 'both ' ]);
454
430
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
@@ -464,7 +440,6 @@ public function testFindInsertPositionSimpleClass(): void
464
440
$ tokens = Tokens::fromCode ($ code );
465
441
466
442
$ method = new ReflectionMethod ($ this ->fixer , 'findInsertPosition ' );
467
- $ method ->setAccessible (true );
468
443
469
444
$ result = $ method ->invoke ($ this ->fixer , $ tokens , 1 );
470
445
@@ -477,7 +452,6 @@ public function testFindInsertPositionWithFinalModifier(): void
477
452
$ tokens = Tokens::fromCode ($ code );
478
453
479
454
$ method = new ReflectionMethod ($ this ->fixer , 'findInsertPosition ' );
480
- $ method ->setAccessible (true );
481
455
482
456
$ result = $ method ->invoke ($ this ->fixer , $ tokens , 2 );
483
457
@@ -490,7 +464,6 @@ public function testFindInsertPositionWithAbstractModifier(): void
490
464
$ tokens = Tokens::fromCode ($ code );
491
465
492
466
$ method = new ReflectionMethod ($ this ->fixer , 'findInsertPosition ' );
493
- $ method ->setAccessible (true );
494
467
495
468
$ result = $ method ->invoke ($ this ->fixer , $ tokens , 2 );
496
469
@@ -503,7 +476,6 @@ public function testFindInsertPositionWithAttribute(): void
503
476
$ tokens = Tokens::fromCode ($ code );
504
477
505
478
$ method = new ReflectionMethod ($ this ->fixer , 'findInsertPosition ' );
506
- $ method ->setAccessible (true );
507
479
508
480
$ result = $ method ->invoke ($ this ->fixer , $ tokens , 2 );
509
481
@@ -513,7 +485,6 @@ public function testFindInsertPositionWithAttribute(): void
513
485
public function testBuildDocBlockWithClassName (): void
514
486
{
515
487
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
516
- $ method ->setAccessible (true );
517
488
518
489
$ this ->fixer ->configure (['add_structure_name ' => true ]);
519
490
$ result = $ method ->invoke ($ this ->fixer , ['author ' => 'John Doe ' ], 'MyClass ' );
@@ -525,7 +496,6 @@ public function testBuildDocBlockWithClassName(): void
525
496
public function testBuildDocBlockWithClassNameOnly (): void
526
497
{
527
498
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
528
- $ method ->setAccessible (true );
529
499
530
500
$ this ->fixer ->configure (['add_structure_name ' => true ]);
531
501
$ result = $ method ->invoke ($ this ->fixer , [], 'MyClass ' );
@@ -537,7 +507,6 @@ public function testBuildDocBlockWithClassNameOnly(): void
537
507
public function testBuildDocBlockWithClassNameDisabled (): void
538
508
{
539
509
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
540
- $ method ->setAccessible (true );
541
510
542
511
$ this ->fixer ->configure (['add_structure_name ' => false ]);
543
512
$ result = $ method ->invoke ($ this ->fixer , ['author ' => 'John Doe ' ], 'MyClass ' );
@@ -549,7 +518,6 @@ public function testBuildDocBlockWithClassNameDisabled(): void
549
518
public function testBuildDocBlockWithEmptyClassName (): void
550
519
{
551
520
$ method = new ReflectionMethod ($ this ->fixer , 'buildDocBlock ' );
552
- $ method ->setAccessible (true );
553
521
554
522
$ this ->fixer ->configure (['add_structure_name ' => true ]);
555
523
$ result = $ method ->invoke ($ this ->fixer , ['author ' => 'John Doe ' ], '' );
@@ -564,7 +532,6 @@ public function testGetClassName(): void
564
532
$ tokens = Tokens::fromCode ($ code );
565
533
566
534
$ method = new ReflectionMethod ($ this ->fixer , 'getStructureName ' );
567
- $ method ->setAccessible (true );
568
535
569
536
$ result = $ method ->invoke ($ this ->fixer , $ tokens , 1 );
570
537
@@ -577,7 +544,6 @@ public function testGetClassNameWithModifiers(): void
577
544
$ tokens = Tokens::fromCode ($ code );
578
545
579
546
$ method = new ReflectionMethod ($ this ->fixer , 'getStructureName ' );
580
- $ method ->setAccessible (true );
581
547
582
548
// Find the class token index
583
549
$ classIndex = null ;
@@ -600,7 +566,6 @@ public function testGetClassNameHitsBreakOnNonStringToken(): void
600
566
$ tokens = Tokens::fromCode ($ code );
601
567
602
568
$ method = new ReflectionMethod ($ this ->fixer , 'getStructureName ' );
603
- $ method ->setAccessible (true );
604
569
605
570
// Find the opening brace token (it comes after class name)
606
571
$ braceIndex = null ;
@@ -625,7 +590,6 @@ public function testGetStructureNameInterface(): void
625
590
$ tokens = Tokens::fromCode ($ code );
626
591
627
592
$ method = new ReflectionMethod ($ this ->fixer , 'getStructureName ' );
628
- $ method ->setAccessible (true );
629
593
630
594
// Find the interface token index
631
595
$ interfaceIndex = null ;
@@ -647,7 +611,6 @@ public function testGetStructureNameTrait(): void
647
611
$ tokens = Tokens::fromCode ($ code );
648
612
649
613
$ method = new ReflectionMethod ($ this ->fixer , 'getStructureName ' );
650
- $ method ->setAccessible (true );
651
614
652
615
// Find the trait token index
653
616
$ traitIndex = null ;
@@ -669,7 +632,6 @@ public function testGetStructureNameEnum(): void
669
632
$ tokens = Tokens::fromCode ($ code );
670
633
671
634
$ method = new ReflectionMethod ($ this ->fixer , 'getStructureName ' );
672
- $ method ->setAccessible (true );
673
635
674
636
// Find the enum token index
675
637
$ enumIndex = null ;
@@ -691,7 +653,6 @@ public function testGetStructureNameReturnsEmptyWhenLoopCompletes(): void
691
653
$ tokens = Tokens::fromCode ($ code );
692
654
693
655
$ method = new ReflectionMethod ($ this ->fixer , 'getStructureName ' );
694
- $ method ->setAccessible (true );
695
656
696
657
// Find the closing brace token - when we call getStructureName from there,
697
658
// the loop should complete without finding anything and return empty string (line 153)
@@ -737,7 +698,6 @@ public function testApplyFixAddsDocBlockToInterface(): void
737
698
$ file = new SplFileInfo (__FILE__ );
738
699
739
700
$ method = new ReflectionMethod ($ this ->fixer , 'applyFix ' );
740
- $ method ->setAccessible (true );
741
701
742
702
$ this ->fixer ->configure ([
743
703
'annotations ' => ['author ' => 'John Doe ' ],
@@ -756,7 +716,6 @@ public function testApplyFixAddsDocBlockToTrait(): void
756
716
$ file = new SplFileInfo (__FILE__ );
757
717
758
718
$ method = new ReflectionMethod ($ this ->fixer , 'applyFix ' );
759
- $ method ->setAccessible (true );
760
719
761
720
$ this ->fixer ->configure ([
762
721
'annotations ' => ['author ' => 'Jane Doe ' ],
@@ -775,7 +734,6 @@ public function testApplyFixAddsDocBlockToEnum(): void
775
734
$ file = new SplFileInfo (__FILE__ );
776
735
777
736
$ method = new ReflectionMethod ($ this ->fixer , 'applyFix ' );
778
- $ method ->setAccessible (true );
779
737
780
738
$ this ->fixer ->configure ([
781
739
'annotations ' => ['license ' => 'MIT ' ],
@@ -794,7 +752,6 @@ public function testApplyFixWithClassNameEnabled(): void
794
752
$ file = new SplFileInfo (__FILE__ );
795
753
796
754
$ method = new ReflectionMethod ($ this ->fixer , 'applyFix ' );
797
- $ method ->setAccessible (true );
798
755
799
756
$ this ->fixer ->configure ([
800
757
'annotations ' => ['author ' => 'John Doe ' ],
@@ -814,7 +771,6 @@ public function testApplyFixWithMultipleClassesAndClassName(): void
814
771
$ file = new SplFileInfo (__FILE__ );
815
772
816
773
$ method = new ReflectionMethod ($ this ->fixer , 'applyFix ' );
817
- $ method ->setAccessible (true );
818
774
819
775
$ this ->fixer ->configure ([
820
776
'annotations ' => ['author ' => 'John Doe ' ],
@@ -836,7 +792,6 @@ public function testMergeWithExistingDocBlockWithClassName(): void
836
792
$ annotations = ['author ' => 'John Doe ' ];
837
793
838
794
$ method = new ReflectionMethod ($ this ->fixer , 'mergeWithExistingDocBlock ' );
839
- $ method ->setAccessible (true );
840
795
841
796
$ this ->fixer ->configure (['add_structure_name ' => true ]);
842
797
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'TestClass ' );
@@ -854,7 +809,6 @@ public function testReplaceDocBlockWithClassName(): void
854
809
$ annotations = ['author ' => 'John Doe ' ];
855
810
856
811
$ method = new ReflectionMethod ($ this ->fixer , 'replaceDocBlock ' );
857
- $ method ->setAccessible (true );
858
812
859
813
$ this ->fixer ->configure (['add_structure_name ' => true ]);
860
814
$ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'TestClass ' );
@@ -872,7 +826,6 @@ public function testInsertNewDocBlockWithClassNameAndSeparateNone(): void
872
826
$ annotations = ['author ' => 'John Doe ' ];
873
827
874
828
$ method = new ReflectionMethod ($ this ->fixer , 'insertNewDocBlock ' );
875
- $ method ->setAccessible (true );
876
829
877
830
$ this ->fixer ->configure ([
878
831
'add_structure_name ' => true ,
0 commit comments