fix stub loading location

This commit is contained in:
Tomas Votruba 2019-10-10 13:22:44 +01:00
parent c80860e69b
commit 069602abd6

View File

@ -14,6 +14,7 @@ use Rector\Extension\ReportingExtensionRunner;
use Rector\FileSystem\FilesFinder;
use Rector\Guard\RectorGuard;
use Rector\PhpParser\NodeTraverser\RectorNodeTraverser;
use Rector\Stubs\StubLoader;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@ -72,6 +73,11 @@ final class ProcessCommand extends AbstractCommand
*/
private $rectorNodeTraverser;
/**
* @var StubLoader
*/
private $stubLoader;
/**
* @param string[] $fileExtensions
*/
@ -85,6 +91,7 @@ final class ProcessCommand extends AbstractCommand
OutputFormatterCollector $outputFormatterCollector,
ReportingExtensionRunner $reportingExtensionRunner,
RectorNodeTraverser $rectorNodeTraverser,
StubLoader $stubLoader,
array $fileExtensions
) {
$this->filesFinder = $phpFilesFinder;
@ -97,6 +104,7 @@ final class ProcessCommand extends AbstractCommand
$this->outputFormatterCollector = $outputFormatterCollector;
$this->reportingExtensionRunner = $reportingExtensionRunner;
$this->rectorNodeTraverser = $rectorNodeTraverser;
$this->stubLoader = $stubLoader;
parent::__construct();
}
@ -148,6 +156,7 @@ final class ProcessCommand extends AbstractCommand
$this->configuration->setAreAnyPhpRectorsLoaded((bool) $this->rectorNodeTraverser->getPhpRectorCount());
$this->rectorGuard->ensureSomeRectorsAreRegistered();
$this->stubLoader->loadStubs();
$source = (array) $input->getArgument(Option::SOURCE);