Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/Skipper/Skipper/Skipper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
21 changes: 0 additions & 21 deletions tests/Skipper/Skipper/SkipperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
{
Expand All @@ -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<array<array<int, mixed>, mixed>>
*/
public static function provideDataShouldSkipElement(): Iterator
{
yield [ThreeMan::class, false];
yield [FifthElement::class, true];
yield [new FifthElement(), true];
}
}
2 changes: 1 addition & 1 deletion tests/Skipper/Skipper/UsedSkipCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Loading