|
4 | 4 |
|
5 | 5 | use fsmaker\InitEditor; |
6 | 6 | use PHPUnit\Framework\TestCase; |
7 | | -use PHPUnit\Framework\Attributes\CoversClass; |
8 | 7 |
|
9 | | -#[CoversClass(InitEditor::class)] |
| 8 | +/** |
| 9 | + * @covers \fsmaker\InitEditor |
| 10 | + */ |
10 | 11 | final class InitEditorTest extends TestCase |
11 | 12 | { |
12 | 13 | // Comprobar si detecta correctamente 1 existencia |
@@ -507,14 +508,16 @@ private function isInvisibleChar(string $char): mixed |
507 | 508 |
|
508 | 509 | private function getRealStrPosFromNoSpaceStrPos(string $string, int $noSpacesPos, int $noSpaceWordsLength): mixed |
509 | 510 | { |
510 | | - $getRealStrPosFromNoSpaceStrPos = new ReflectionClass(InitEditor::class)->getMethod('getRealStrPosFromNoSpaceStrPos'); |
| 511 | + $reflection = new ReflectionClass(InitEditor::class); |
| 512 | + $getRealStrPosFromNoSpaceStrPos = $reflection->getMethod('getRealStrPosFromNoSpaceStrPos'); |
511 | 513 |
|
512 | 514 | return $getRealStrPosFromNoSpaceStrPos->invoke(null, $string, $noSpacesPos, $noSpaceWordsLength); |
513 | 515 | } |
514 | 516 |
|
515 | 517 | private function getBracesAnalysis(string $str): mixed |
516 | 518 | { |
517 | | - $getBracesAnalysis = new ReflectionClass(InitEditor::class)->getMethod('getBracesAnalysis'); |
| 519 | + $reflection = new ReflectionClass(InitEditor::class); |
| 520 | + $getBracesAnalysis = $reflection->getMethod('getBracesAnalysis'); |
518 | 521 |
|
519 | 522 | return $getBracesAnalysis->invoke(null, $str); |
520 | 523 | } |
@@ -560,14 +563,16 @@ private function putUseInstruction(string $str, string $fileName): mixed |
560 | 563 |
|
561 | 564 | private function getCurrentIndentation(string $str, int $indentEndPos): mixed |
562 | 565 | { |
563 | | - $getCurrentIndentation = new ReflectionClass(InitEditor::class)->getMethod('getCurrentIndentation'); |
| 566 | + $reflection = new ReflectionClass(InitEditor::class); |
| 567 | + $getCurrentIndentation = $reflection->getMethod('getCurrentIndentation'); |
564 | 568 |
|
565 | 569 | return $getCurrentIndentation->invoke(null, $str, $indentEndPos); |
566 | 570 | } |
567 | 571 |
|
568 | 572 | private function formatTextWithIndentation(string $str, string $indention): mixed |
569 | 573 | { |
570 | | - $formatTextWithIndentation = new ReflectionClass(InitEditor::class)->getMethod('formatTextWithIndentation'); |
| 574 | + $reflection = new ReflectionClass(InitEditor::class); |
| 575 | + $formatTextWithIndentation = $reflection->getMethod('formatTextWithIndentation'); |
571 | 576 |
|
572 | 577 | return $formatTextWithIndentation->invoke(null, $str, $indention); |
573 | 578 | } |
|
0 commit comments