Skip to content

Commit f67b48a

Browse files
committed
[BCB] Removed autoload_directories
1 parent 7a21246 commit f67b48a

File tree

3 files changed

+1
-25
lines changed

3 files changed

+1
-25
lines changed

conf/config.neon

-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ parameters:
88
- ../stubs/runtime/Attribute.php
99
excludes_analyse: []
1010
excludePaths: null
11-
autoload_directories: []
1211
level: null
1312
paths: []
1413
exceptions:
@@ -193,7 +192,6 @@ parametersSchema:
193192
analyseAndScan: listOf(string())
194193
])
195194
), nullable())
196-
autoload_directories: listOf(string())
197195
level: schema(anyOf(int(), string()), nullable())
198196
paths: listOf(string())
199197
exceptions: structure([
@@ -1684,7 +1682,6 @@ services:
16841682
arguments:
16851683
parser: @phpParserDecorator
16861684
php8Parser: @php8PhpParser
1687-
autoloadDirectories: %autoload_directories%
16881685
scanFiles: %scanFiles%
16891686
scanDirectories: %scanDirectories%
16901687
analysedPaths: %analysedPaths%

src/Command/CommandHelper.php

-14
Original file line numberDiff line numberDiff line change
@@ -308,20 +308,6 @@ public static function begin(
308308
throw new \PHPStan\Command\InceptionNotSuccessfulException();
309309
}
310310

311-
$autoloadDirectories = $container->getParameter('autoload_directories');
312-
if (count($autoloadDirectories) > 0 && $manageMemoryLimitFile) {
313-
$errorOutput->writeLineFormatted('⚠️ You\'re using a deprecated config option <fg=cyan>autoload_directories</>. ⚠️️');
314-
$errorOutput->writeLineFormatted('');
315-
$errorOutput->writeLineFormatted('You might not need it anymore - try removing it from your');
316-
$errorOutput->writeLineFormatted('configuration file and run PHPStan again.');
317-
$errorOutput->writeLineFormatted('');
318-
$errorOutput->writeLineFormatted('If the analysis fails, replace it with <fg=cyan>scanDirectories</>.');
319-
$errorOutput->writeLineFormatted('');
320-
$errorOutput->writeLineFormatted('Read more about this in PHPStan\'s documentation:');
321-
$errorOutput->writeLineFormatted('https://phpstan.org/user-guide/discovering-symbols');
322-
$errorOutput->writeLineFormatted('');
323-
}
324-
325311
$bootstrapFile = $container->getParameter('bootstrap');
326312
if ($bootstrapFile !== null) {
327313
if ($manageMemoryLimitFile) {

src/Reflection/BetterReflection/BetterReflectionSourceLocatorFactory.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ class BetterReflectionSourceLocatorFactory
5353
/** @var \PHPStan\DependencyInjection\Container */
5454
private $container;
5555

56-
/** @var string[] */
57-
private $autoloadDirectories;
58-
5956
/** @var string[] */
6057
private $scanFiles;
6158

@@ -78,8 +75,6 @@ class BetterReflectionSourceLocatorFactory
7875
private array $staticReflectionClassNamePatterns;
7976

8077
/**
81-
* @param string[] $autoloadDirectories
82-
* @param string[] $autoloadFiles
8378
* @param string[] $scanFiles
8479
* @param string[] $scanDirectories
8580
* @param string[] $analysedPaths
@@ -98,7 +93,6 @@ public function __construct(
9893
ComposerJsonAndInstalledJsonSourceLocatorMaker $composerJsonAndInstalledJsonSourceLocatorMaker,
9994
AutoloadSourceLocator $autoloadSourceLocator,
10095
Container $container,
101-
array $autoloadDirectories,
10296
array $scanFiles,
10397
array $scanDirectories,
10498
array $analysedPaths,
@@ -117,7 +111,6 @@ public function __construct(
117111
$this->composerJsonAndInstalledJsonSourceLocatorMaker = $composerJsonAndInstalledJsonSourceLocatorMaker;
118112
$this->autoloadSourceLocator = $autoloadSourceLocator;
119113
$this->container = $container;
120-
$this->autoloadDirectories = $autoloadDirectories;
121114
$this->scanFiles = $scanFiles;
122115
$this->scanDirectories = $scanDirectories;
123116
$this->analysedPaths = $analysedPaths;
@@ -156,7 +149,7 @@ public function create(): SourceLocator
156149
$locators[] = $this->optimizedSingleFileSourceLocatorRepository->getOrCreate($analysedFile);
157150
}
158151

159-
$directories = array_unique(array_merge($analysedDirectories, $this->autoloadDirectories, $this->scanDirectories));
152+
$directories = array_unique(array_merge($analysedDirectories, $this->scanDirectories));
160153
foreach ($directories as $directory) {
161154
$locators[] = $this->optimizedDirectorySourceLocatorRepository->getOrCreate($directory);
162155
}

0 commit comments

Comments
 (0)