clear commander from AbstractRector

This commit is contained in:
TomasVotruba 2020-03-31 17:49:26 +02:00
parent a8da478d44
commit 7f2aef3d7d
2 changed files with 2 additions and 21 deletions

View File

@ -132,6 +132,7 @@ PHP
return false;
}
}
return true;
}

View File

@ -26,7 +26,6 @@ use Rector\NodeTypeResolver\PhpDoc\NodeAnalyzer\DocBlockManipulator;
use Rector\StaticTypeMapper\StaticTypeMapper;
use Rector\Core\Php\PhpVersionProvider;
use Rector\Core\Rector\AbstractRector\AbstractRectorTrait;
use Rector\Core\Rector\AbstractRector\NodeCommandersTrait;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symplify\PackageBuilder\Parameter\ParameterProvider;
use Symplify\SmartFileSystem\SmartFileInfo;
@ -180,26 +179,6 @@ abstract class AbstractRector extends NodeVisitorAbstract implements PhpRectorIn
return $node;
}
/**
* @see NodeCommandersTrait
*
* @param Node[] $nodes
* @return Node[]
*/
public function afterTraverse(array $nodes): array
{
// setup for commanders
foreach ($nodes as $node) {
$fileInfo = $node->getAttribute(AttributeKey::FILE_INFO);
if ($fileInfo instanceof SmartFileInfo) {
$this->currentFileInfoProvider->setCurrentFileInfo($fileInfo);
break;
}
}
return $nodes;
}
protected function getNextExpression(Node $node): ?Node
{
$currentExpression = $node->getAttribute(AttributeKey::CURRENT_STATEMENT);
@ -364,6 +343,7 @@ abstract class AbstractRector extends NodeVisitorAbstract implements PhpRectorIn
return in_array(
$projectType,
// make it typo proof
[Option::PROJECT_TYPE_OPEN_SOURCE, Option::PROJECT_TYPE_OPEN_SOURCE_UNDESCORED],
true
);