Skip to content

Commit

Permalink
Introduce scanFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jun 7, 2020
1 parent aad1bf8 commit b971fc6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions conf/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ parameters:
reportMaybesInMethodSignatures: false
reportStaticMethodSignatures: false
mixinExcludeClasses: []
scanFiles: []
parallel:
jobSize: 20
processTimeout: 60.0
Expand Down Expand Up @@ -226,6 +227,7 @@ parametersSchema:
currentWorkingDirectory: string()
cliArgumentsVariablesRegistered: bool()
mixinExcludeClasses: listOf(string())
scanFiles: listOf(string())

# irrelevant Nette parameters
debugMode: bool()
Expand Down Expand Up @@ -1145,6 +1147,7 @@ services:
parser: @phpParserDecorator
autoloadDirectories: %autoload_directories%
autoloadFiles: %autoload_files%
scanFiles: %scanFiles%
analysedPaths: %analysedPaths%
composerAutoloaderProjectPaths: %composerAutoloaderProjectPaths%
analysedPathsFromConfig: %analysedPathsFromConfig%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class BetterReflectionSourceLocatorFactory
/** @var string[] */
private $autoloadFiles;

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

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

Expand All @@ -64,6 +67,7 @@ class BetterReflectionSourceLocatorFactory
/**
* @param string[] $autoloadDirectories
* @param string[] $autoloadFiles
* @param string[] $scanFiles
* @param string[] $analysedPaths
* @param string[] $composerAutoloaderProjectPaths
* @param string[] $analysedPathsFromConfig
Expand All @@ -79,6 +83,7 @@ public function __construct(
Container $container,
array $autoloadDirectories,
array $autoloadFiles,
array $scanFiles,
array $analysedPaths,
array $composerAutoloaderProjectPaths,
array $analysedPathsFromConfig
Expand All @@ -94,6 +99,7 @@ public function __construct(
$this->container = $container;
$this->autoloadDirectories = $autoloadDirectories;
$this->autoloadFiles = $autoloadFiles;
$this->scanFiles = $scanFiles;
$this->analysedPaths = $analysedPaths;
$this->composerAutoloaderProjectPaths = $composerAutoloaderProjectPaths;
$this->analysedPathsFromConfig = $analysedPathsFromConfig;
Expand Down Expand Up @@ -127,7 +133,7 @@ public function create(): SourceLocator
$analysedDirectories[] = $analysedPath;
}

$analysedFiles = array_unique(array_merge($analysedFiles, $this->autoloadFiles));
$analysedFiles = array_unique(array_merge($analysedFiles, $this->autoloadFiles, $this->scanFiles));
foreach ($analysedFiles as $analysedFile) {
$locators[] = $this->optimizedSingleFileSourceLocatorRepository->getOrCreate($analysedFile);
}
Expand Down

0 comments on commit b971fc6

Please sign in to comment.