mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
parent
edcfe417a4
commit
074298d35c
@ -9,6 +9,7 @@ use PhpParser\Node\Stmt\Class_;
|
||||
use Rector\Caching\Contract\Rector\ZeroCacheRectorInterface;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\DeadCode\UnusedNodeResolver\UnusedClassResolver;
|
||||
use Rector\Testing\PHPUnit\StaticPHPUnitEnvironment;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
|
||||
@ -87,7 +88,11 @@ CODE_SAMPLE
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->removeFile($this->getFileInfo());
|
||||
if (StaticPHPUnitEnvironment::isPHPUnitRun()) {
|
||||
$this->removeNode($node);
|
||||
} else {
|
||||
$this->removeFile($this->getFileInfo());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -4,14 +4,6 @@ namespace Rector\DeadCode\Tests\Rector\Class_\RemoveUnusedClassesRector\Fixture;
|
||||
|
||||
use Rector\DeadCode\Tests\Rector\Class_\RemoveUnusedClassesRector\Source\SomeInterface;
|
||||
|
||||
class SomeClass implements SomeInterface
|
||||
{
|
||||
public function run($items)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class NowhereUsedClass
|
||||
{
|
||||
}
|
||||
@ -24,12 +16,4 @@ namespace Rector\DeadCode\Tests\Rector\Class_\RemoveUnusedClassesRector\Fixture;
|
||||
|
||||
use Rector\DeadCode\Tests\Rector\Class_\RemoveUnusedClassesRector\Source\SomeInterface;
|
||||
|
||||
class SomeClass implements SomeInterface
|
||||
{
|
||||
public function run($items)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -22,7 +22,7 @@ final class RectorRuleAndValueObjectHaveSameStartsRuleTest extends AbstractServi
|
||||
|
||||
public function provideData(): Iterator
|
||||
{
|
||||
yield [__DIR__ . '/Fixture/HaveSameStarts.php', []];
|
||||
yield [__DIR__ . '/Fixture/SkipHaveSameStarts.php', []];
|
||||
yield [__DIR__ . '/Fixture/SkipDifferentType.php', []];
|
||||
yield [__DIR__ . '/Fixture/SkipNoCall.php', []];
|
||||
yield [__DIR__ . '/Fixture/SkipNoCallConfigure.php', []];
|
||||
|
@ -6,7 +6,7 @@ namespace Rector\PHPStanExtensions\Tests\Rule\RequireRectorCategoryByGetNodeType
|
||||
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
|
||||
abstract class AbstractSkip
|
||||
abstract class SkipAbstract
|
||||
{
|
||||
public function getNodeTypes(): array
|
||||
{
|
@ -33,7 +33,7 @@ final class RequireRectorCategoryByGetNodeTypesRuleTest extends AbstractServiceA
|
||||
yield [__DIR__ . '/Fixture/ClassMethod/ChangeSomethingRector.php', [[$errorMessage, 14]]];
|
||||
yield [__DIR__ . '/Fixture/FunctionLike/SkipSubtypeRector.php', []];
|
||||
yield [__DIR__ . '/Fixture/ClassMethod/SkipInterface.php', []];
|
||||
yield [__DIR__ . '/Fixture/AbstractSkip.php', []];
|
||||
yield [__DIR__ . '/Fixture/SkipAbstract.php', []];
|
||||
}
|
||||
|
||||
protected function getRule(): Rule
|
||||
|
Loading…
x
Reference in New Issue
Block a user