diff --git a/packages/Parallel/WorkerRunner.php b/packages/Parallel/WorkerRunner.php index 4bc5897ee8a..ce1830438bf 100644 --- a/packages/Parallel/WorkerRunner.php +++ b/packages/Parallel/WorkerRunner.php @@ -98,7 +98,7 @@ final class WorkerRunner $errorAndFileDiffs = []; $systemErrors = []; // 1. allow PHPStan to work with static reflection on provided files - $this->applicationFileProcessor->configurePHPStanNodeScopeResolver($filePaths); + $this->applicationFileProcessor->configurePHPStanNodeScopeResolver($filePaths, $configuration); foreach ($filePaths as $filePath) { try { $file = new File($filePath, FileSystem::read($filePath)); diff --git a/src/Application/ApplicationFileProcessor.php b/src/Application/ApplicationFileProcessor.php index 26b9e7ce232..825b55fdf45 100644 --- a/src/Application/ApplicationFileProcessor.php +++ b/src/Application/ApplicationFileProcessor.php @@ -128,7 +128,7 @@ final class ApplicationFileProcessor // 1. collect all files from files+dirs provided paths $files = $this->fileFactory->createFromPaths($filePaths); // 2. PHPStan has to know about all files too - $this->configurePHPStanNodeScopeResolver($filePaths); + $this->configurePHPStanNodeScopeResolver($filePaths, $configuration); $systemErrorsAndFileDiffs = $this->processFiles($files, $configuration); $this->fileDiffFileDecorator->decorate($files); $this->printFiles($files, $configuration); @@ -170,13 +170,15 @@ final class ApplicationFileProcessor /** * @param string[] $filePaths */ - public function configurePHPStanNodeScopeResolver(array $filePaths) : void + public function configurePHPStanNodeScopeResolver(array $filePaths, Configuration $configuration) : void { - $phpFilter = static function (string $filePath) : bool { - return \substr_compare($filePath, '.php', -\strlen('.php')) === 0; + $fileExtensions = $configuration->getFileExtensions(); + $fileWithExtensionsFilter = static function (string $filePath) use($fileExtensions) : bool { + $filePathExtension = \pathinfo($filePath, \PATHINFO_EXTENSION); + return \in_array($filePathExtension, $fileExtensions, \true); }; - $phpFilePaths = \array_filter($filePaths, $phpFilter); - $this->nodeScopeResolver->setAnalysedFiles($phpFilePaths); + $filePaths = \array_filter($filePaths, $fileWithExtensionsFilter); + $this->nodeScopeResolver->setAnalysedFiles($filePaths); } /** * @param File[] $files diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 7af434969a1..51f53131cfb 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'ad9b5973ebff338b17452fb0240c1834126f388e'; + public const PACKAGE_VERSION = '6d3efd5be7ab2de0a25aebabddb26c497611d4fb'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-03-26 00:30:03'; + public const RELEASE_DATE = '2023-03-26 10:43:02'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index 4aed4845635..61c8121a245 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33::getLoader(); +return ComposerAutoloaderInitabb222c1688d781e7335377fa030e510::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 771d6c8af29..866030fafc7 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33 +class ComposerAutoloaderInitabb222c1688d781e7335377fa030e510 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitabb222c1688d781e7335377fa030e510', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitabb222c1688d781e7335377fa030e510', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitabb222c1688d781e7335377fa030e510::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitabb222c1688d781e7335377fa030e510::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ef171b72da6..8e905e378a6 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33 +class ComposerStaticInitabb222c1688d781e7335377fa030e510 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3127,9 +3127,9 @@ class ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitabb222c1688d781e7335377fa030e510::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitabb222c1688d781e7335377fa030e510::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitabb222c1688d781e7335377fa030e510::$classMap; }, null, ClassLoader::class); }