diff --git a/ecs.php b/ecs.php index 0f68bf48..c593fa26 100644 --- a/ecs.php +++ b/ecs.php @@ -18,6 +18,7 @@ __DIR__ . '/tests', __DIR__ . '/rules-tests', __DIR__ . '/ecs.php', + __DIR__ . '/rector.php', ]); $ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, [ diff --git a/rector.php b/rector.php index da781806..32603f7e 100644 --- a/rector.php +++ b/rector.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use Rector\CodingStyle\Rector\String_\UseClassKeywordForClassNameResolutionRector; use Rector\Config\RectorConfig; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\PHPUnit\Set\PHPUnitSetList; @@ -10,6 +11,7 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->importNames(); + $rectorConfig->removeUnusedImports(); $rectorConfig->sets([ LevelSetList::UP_TO_PHP_81, @@ -30,12 +32,14 @@ __DIR__ . '/tests', __DIR__ . '/rules-tests', __DIR__ . '/config', + __DIR__ . '/rector.php', + __DIR__ . '/ecs.php', ]); $rectorConfig->skip([ StringClassNameToClassConstantRector::class, - \Rector\CodingStyle\Rector\String_\UseClassKeywordForClassNameResolutionRector::class => [ + UseClassKeywordForClassNameResolutionRector::class => [ // not useful short class cases, possibly skip in the rule __DIR__ . '/rules/DowngradePhp80/Rector/MethodCall/DowngradeReflectionClassGetConstantsFilterRector.php', __DIR__ . '/rules/DowngradePhp81/Rector/FuncCall/DowngradeFirstClassCallableSyntaxRector.php', diff --git a/src/NodeAnalyzer/ExprInTopStmtMatcher.php b/src/NodeAnalyzer/ExprInTopStmtMatcher.php index 3036de05..19c8f5f6 100644 --- a/src/NodeAnalyzer/ExprInTopStmtMatcher.php +++ b/src/NodeAnalyzer/ExprInTopStmtMatcher.php @@ -7,7 +7,6 @@ use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Expr\Closure; -use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Do_; use PhpParser\Node\Stmt\Echo_; use PhpParser\Node\Stmt\Expression;