diff --git a/src/Skipper/Skipper/Skipper.php b/src/Skipper/Skipper/Skipper.php index 9664e5595c7..8cd52c5f4b4 100644 --- a/src/Skipper/Skipper/Skipper.php +++ b/src/Skipper/Skipper/Skipper.php @@ -27,11 +27,6 @@ public function __construct( ) { } - public function shouldSkipElement(string|object $element): bool - { - return $this->shouldSkipElementAndFilePath($element, __FILE__); - } - public function shouldSkipFilePath(string $filePath): bool { return $this->pathSkipper->shouldSkip($filePath); diff --git a/tests/Skipper/Skipper/SkipperTest.php b/tests/Skipper/Skipper/SkipperTest.php index 33dda0fd5a8..8fa8ae21b92 100644 --- a/tests/Skipper/Skipper/SkipperTest.php +++ b/tests/Skipper/Skipper/SkipperTest.php @@ -11,7 +11,6 @@ use Rector\Skipper\Skipper\Skipper; use Rector\Testing\PHPUnit\AbstractLazyTestCase; use Rector\Tests\Skipper\Skipper\Fixture\Element\FifthElement; -use Rector\Tests\Skipper\Skipper\Fixture\Element\ThreeMan; use Rector\Tests\Skipper\Skipper\Source\AnotherClassToSkip; use Rector\Tests\Skipper\Skipper\Source\NotSkippedClass; @@ -69,16 +68,6 @@ public static function provideDataShouldSkipFilePath(): Iterator yield [__DIR__ . '/Fixture/PathSkippedWithMask/another_file.txt', true]; } - /** - * @param object|class-string $element - */ - #[DataProvider('provideDataShouldSkipElement')] - public function testSkipElement(string|object $element, bool $expectedSkip): void - { - $resultSkip = $this->skipper->shouldSkipElement($element); - $this->assertSame($expectedSkip, $resultSkip); - } - #[DataProvider('provideCheckerAndFile')] public function testSkipElementAndFilePath(string $element, string $filePath, bool $expectedSkip): void { @@ -99,14 +88,4 @@ public static function provideCheckerAndFile(): Iterator yield [NotSkippedClass::class, __DIR__ . '/Fixture/someFile', false]; yield [NotSkippedClass::class, __DIR__ . '/Fixture/someOtherFile', false]; } - - /** - * @return Iterator, mixed>> - */ - public static function provideDataShouldSkipElement(): Iterator - { - yield [ThreeMan::class, false]; - yield [FifthElement::class, true]; - yield [new FifthElement(), true]; - } } diff --git a/tests/Skipper/Skipper/UsedSkipCollectorTest.php b/tests/Skipper/Skipper/UsedSkipCollectorTest.php index e013a5da95b..9e12d70c48a 100644 --- a/tests/Skipper/Skipper/UsedSkipCollectorTest.php +++ b/tests/Skipper/Skipper/UsedSkipCollectorTest.php @@ -50,7 +50,7 @@ protected function tearDown(): void public function testCollectsOnlyMatchedSkips(): void { $this->skipper->shouldSkipFilePath('tests/Skipper/Skipper/Fixture/SomeSkippedPath/any.txt'); - $this->skipper->shouldSkipElement(FifthElement::class); + $this->skipper->shouldSkipElementAndFilePath(FifthElement::class, __FILE__); $usedSkips = $this->usedSkipCollector->provide();