diff --git a/src/Command/AnalyseCommand.php b/src/Command/AnalyseCommand.php index 41baf4aecb..2dca70d859 100644 --- a/src/Command/AnalyseCommand.php +++ b/src/Command/AnalyseCommand.php @@ -225,7 +225,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int return $inceptionResult->handleReturn(0, null); } - /** @var AnalyseApplication $application */ $application = $container->getByType(AnalyseApplication::class); $debug = $input->getOption('debug'); @@ -436,7 +435,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int $inceptionResult->handleReturn(0, $analysisResult->getPeakMemoryUsageBytes()); - /** @var FixerApplication $fixerApplication */ $fixerApplication = $container->getByType(FixerApplication::class); return $fixerApplication->run( diff --git a/src/Command/ClearResultCacheCommand.php b/src/Command/ClearResultCacheCommand.php index 5e9bc7b87c..82234b9eff 100644 --- a/src/Command/ClearResultCacheCommand.php +++ b/src/Command/ClearResultCacheCommand.php @@ -84,7 +84,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int $container = $inceptionResult->getContainer(); - /** @var ResultCacheClearer $resultCacheClearer */ $resultCacheClearer = $container->getByType(ResultCacheClearer::class); $path = $resultCacheClearer->clear(); diff --git a/src/Command/CommandHelper.php b/src/Command/CommandHelper.php index a214a6b631..acb5640f00 100644 --- a/src/Command/CommandHelper.php +++ b/src/Command/CommandHelper.php @@ -467,7 +467,6 @@ public static function begin( $pathRoutingParser = $container->getService('pathRoutingParser'); - /** @var StubFilesProvider $stubFilesProvider */ $stubFilesProvider = $container->getByType(StubFilesProvider::class); $filesCallback = static function () use ($currentWorkingDirectoryFileHelper, $stubFilesProvider, $fileFinder, $pathRoutingParser, $paths): array { diff --git a/src/Command/FixerWorkerCommand.php b/src/Command/FixerWorkerCommand.php index b68a7b14f3..9784718afc 100644 --- a/src/Command/FixerWorkerCommand.php +++ b/src/Command/FixerWorkerCommand.php @@ -4,7 +4,6 @@ use Nette\Utils\Json; use PHPStan\Analyser\IgnoredErrorHelper; -use PHPStan\Analyser\ResultCache\ResultCacheManager; use PHPStan\Analyser\ResultCache\ResultCacheManagerFactory; use PHPStan\ShouldNotHappenException; use Symfony\Component\Console\Command\Command; @@ -94,17 +93,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int $container = $inceptionResult->getContainer(); - /** @var IgnoredErrorHelper $ignoredErrorHelper */ $ignoredErrorHelper = $container->getByType(IgnoredErrorHelper::class); $ignoredErrorHelperResult = $ignoredErrorHelper->initialize(); if (count($ignoredErrorHelperResult->getErrors()) > 0) { throw new ShouldNotHappenException(); } - /** @var AnalyserRunner $analyserRunner */ $analyserRunner = $container->getByType(AnalyserRunner::class); - /** @var ResultCacheManager $resultCacheManager */ $resultCacheManager = $container->getByType(ResultCacheManagerFactory::class)->create(); $projectConfigArray = $inceptionResult->getProjectConfigArray(); [$inceptionFiles, $isOnlyFiles] = $inceptionResult->getFiles(); diff --git a/src/Command/WorkerCommand.php b/src/Command/WorkerCommand.php index bbcdef2a03..bc0ac39202 100644 --- a/src/Command/WorkerCommand.php +++ b/src/Command/WorkerCommand.php @@ -117,7 +117,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 1; } - /** @var NodeScopeResolver $nodeScopeResolver */ $nodeScopeResolver = $container->getByType(NodeScopeResolver::class); $nodeScopeResolver->setAnalysedFiles($analysedFiles); @@ -169,11 +168,8 @@ private function runWorker( $out->end(); }; $out->on('error', $handleError); - /** @var FileAnalyser $fileAnalyser */ $fileAnalyser = $container->getByType(FileAnalyser::class); - /** @var RuleRegistry $ruleRegistry */ $ruleRegistry = $container->getByType(RuleRegistry::class); - /** @var CollectorRegistry $collectorRegistry */ $collectorRegistry = $container->getByType(CollectorRegistry::class); $in->on('data', function (array $json) use ($fileAnalyser, $ruleRegistry, $collectorRegistry, $out, $analysedFiles, $output): void { $action = $json['action']; diff --git a/src/DependencyInjection/ContainerFactory.php b/src/DependencyInjection/ContainerFactory.php index 2663b25674..2cc7e76957 100644 --- a/src/DependencyInjection/ContainerFactory.php +++ b/src/DependencyInjection/ContainerFactory.php @@ -164,7 +164,6 @@ public static function postInitializeContainer(Container $container): void $container->getByType(PhpStormStubsSourceStubber::class), ); - /** @var Broker $broker */ $broker = $container->getByType(Broker::class); Broker::registerInstance($broker); ReflectionProviderStaticAccessor::registerInstance($container->getByType(ReflectionProvider::class)); diff --git a/src/PhpDoc/StubValidator.php b/src/PhpDoc/StubValidator.php index 578b719bb0..58de9126e8 100644 --- a/src/PhpDoc/StubValidator.php +++ b/src/PhpDoc/StubValidator.php @@ -91,10 +91,8 @@ public function validate(array $stubFiles, bool $debug): array $ruleRegistry = $this->getRuleRegistry($container); $collectorRegistry = $this->getCollectorRegistry($container); - /** @var FileAnalyser $fileAnalyser */ $fileAnalyser = $container->getByType(FileAnalyser::class); - /** @var NodeScopeResolver $nodeScopeResolver */ $nodeScopeResolver = $container->getByType(NodeScopeResolver::class); $nodeScopeResolver->setAnalysedFiles($stubFiles);