Skip to content

Commit 960da5d

Browse files
committed
align RectorRegistry and its test with the merged version on main
1 parent a1314e7 commit 960da5d

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎src/Application/RectorRegistry.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public function refreshRectors(array $rectors): void
3333
}
3434

3535
/**
36-
* @return array<RectorInterface>
36+
* @return RectorInterface[]
37+
*
38+
* @api used in tests
3739
*/
3840
public function forPath(string $filePath): array
3941
{

‎tests/Application/RectorRegistryTest.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Rector\Configuration\Parameter\SimpleParameterProvider;
1010
use Rector\Testing\PHPUnit\AbstractLazyTestCase;
1111
use Rector\Tests\Application\Source\SkippableRector;
12-
use Rector\Tests\Skipper\Skipper\Fixture\Element\FifthElement;
1312

1413
final class RectorRegistryTest extends AbstractLazyTestCase
1514
{
@@ -21,11 +20,10 @@ protected function setUp(): void
2120

2221
SimpleParameterProvider::setParameter(Option::SKIP, [
2322
SkippableRector::class => ['*/skipped_directory/*'],
24-
FifthElement::class => ['*/skipped_directory/*'],
2523
]);
2624

2725
$this->rectorRegistry = $this->make(RectorRegistry::class);
28-
$this->rectorRegistry->refreshRectors([new FifthElement()]);
26+
$this->rectorRegistry->refreshRectors([new SkippableRector()]);
2927
}
3028

3129
protected function tearDown(): void
@@ -46,6 +44,5 @@ public function testForPathKeepsRectorForOtherPath(): void
4644

4745
$this->assertCount(1, $rectorsForPath);
4846
$this->assertInstanceOf(SkippableRector::class, $rectorsForPath[0]);
49-
$this->assertInstanceOf(FifthElement::class, $rectorsForPath[0]);
5047
}
5148
}

0 commit comments

Comments
 (0)