Skip to content

Commit

Permalink
[BCB] Removed autoload_directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 12, 2021
1 parent 7a21246 commit f67b48a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
3 changes: 0 additions & 3 deletions conf/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ parameters:
- ../stubs/runtime/Attribute.php
excludes_analyse: []
excludePaths: null
autoload_directories: []
level: null
paths: []
exceptions:
Expand Down Expand Up @@ -193,7 +192,6 @@ parametersSchema:
analyseAndScan: listOf(string())
])
), nullable())
autoload_directories: listOf(string())
level: schema(anyOf(int(), string()), nullable())
paths: listOf(string())
exceptions: structure([
Expand Down Expand Up @@ -1684,7 +1682,6 @@ services:
arguments:
parser: @phpParserDecorator
php8Parser: @php8PhpParser
autoloadDirectories: %autoload_directories%
scanFiles: %scanFiles%
scanDirectories: %scanDirectories%
analysedPaths: %analysedPaths%
Expand Down
14 changes: 0 additions & 14 deletions src/Command/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,20 +308,6 @@ public static function begin(
throw new \PHPStan\Command\InceptionNotSuccessfulException();
}

$autoloadDirectories = $container->getParameter('autoload_directories');
if (count($autoloadDirectories) > 0 && $manageMemoryLimitFile) {
$errorOutput->writeLineFormatted('⚠️ You\'re using a deprecated config option <fg=cyan>autoload_directories</>. ⚠️️');
$errorOutput->writeLineFormatted('');
$errorOutput->writeLineFormatted('You might not need it anymore - try removing it from your');
$errorOutput->writeLineFormatted('configuration file and run PHPStan again.');
$errorOutput->writeLineFormatted('');
$errorOutput->writeLineFormatted('If the analysis fails, replace it with <fg=cyan>scanDirectories</>.');
$errorOutput->writeLineFormatted('');
$errorOutput->writeLineFormatted('Read more about this in PHPStan\'s documentation:');
$errorOutput->writeLineFormatted('https://phpstan.org/user-guide/discovering-symbols');
$errorOutput->writeLineFormatted('');
}

$bootstrapFile = $container->getParameter('bootstrap');
if ($bootstrapFile !== null) {
if ($manageMemoryLimitFile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ class BetterReflectionSourceLocatorFactory
/** @var \PHPStan\DependencyInjection\Container */
private $container;

/** @var string[] */
private $autoloadDirectories;

/** @var string[] */
private $scanFiles;

Expand All @@ -78,8 +75,6 @@ class BetterReflectionSourceLocatorFactory
private array $staticReflectionClassNamePatterns;

/**
* @param string[] $autoloadDirectories
* @param string[] $autoloadFiles
* @param string[] $scanFiles
* @param string[] $scanDirectories
* @param string[] $analysedPaths
Expand All @@ -98,7 +93,6 @@ public function __construct(
ComposerJsonAndInstalledJsonSourceLocatorMaker $composerJsonAndInstalledJsonSourceLocatorMaker,
AutoloadSourceLocator $autoloadSourceLocator,
Container $container,
array $autoloadDirectories,
array $scanFiles,
array $scanDirectories,
array $analysedPaths,
Expand All @@ -117,7 +111,6 @@ public function __construct(
$this->composerJsonAndInstalledJsonSourceLocatorMaker = $composerJsonAndInstalledJsonSourceLocatorMaker;
$this->autoloadSourceLocator = $autoloadSourceLocator;
$this->container = $container;
$this->autoloadDirectories = $autoloadDirectories;
$this->scanFiles = $scanFiles;
$this->scanDirectories = $scanDirectories;
$this->analysedPaths = $analysedPaths;
Expand Down Expand Up @@ -156,7 +149,7 @@ public function create(): SourceLocator
$locators[] = $this->optimizedSingleFileSourceLocatorRepository->getOrCreate($analysedFile);
}

$directories = array_unique(array_merge($analysedDirectories, $this->autoloadDirectories, $this->scanDirectories));
$directories = array_unique(array_merge($analysedDirectories, $this->scanDirectories));
foreach ($directories as $directory) {
$locators[] = $this->optimizedDirectorySourceLocatorRepository->getOrCreate($directory);
}
Expand Down

0 comments on commit f67b48a

Please sign in to comment.