File tree Expand file tree Collapse file tree
src/Psalm/Internal/Analyzer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -371,9 +371,6 @@ public static function getInstance(): ProjectAnalyzer
371371 /** @psalm-mutation-free */
372372 public function canReportIssues (string $ file_path ): bool
373373 {
374- if (!$ this ->project_files_initialized ) {
375- return $ this ->config ->isInProjectDirs ($ file_path );
376- }
377374 $ list = $ this ->project_files ;
378375 return isset ($ list [$ file_path ]);
379376 }
@@ -986,7 +983,22 @@ public function checkPaths(array $paths_to_check): void
986983 $ this ->progress ->write ($ this ->generatePHPVersionMessage ());
987984 $ this ->progress ->startPhase (Phase::SCAN , $ this ->scanThreads );
988985
989- //$this->initProjectFiles();
986+ if (!$ this ->project_files_initialized ) {
987+ $ file_extensions = $ this ->config ->getFileExtensions ();
988+ $ this ->project_files = [];
989+ foreach ($ paths_to_check as $ file_path ) {
990+ if (is_dir ($ file_path )) {
991+ foreach ($ this ->file_provider ->getFilesInDir (
992+ $ file_path ,
993+ $ file_extensions ,
994+ ) as $ file_path ) {
995+ $ this ->project_files [$ file_path ] = $ file_path ;
996+ }
997+ } elseif (is_file ($ file_path )) {
998+ $ this ->project_files [$ file_path ] = $ file_path ;
999+ }
1000+ }
1001+ }
9901002 $ this ->initExtraFiles ();
9911003
9921004 $ this ->config ->visitPreloadedStubFiles ($ this ->codebase , $ this ->progress );
You can’t perform that action at this time.
0 commit comments