Updated Rector to commit 6d3efd5be7ab2de0a25aebabddb26c497611d4fb

6d3efd5be7 [Core] Set configured file extensions to analyzed files for NodeScopeResolver (#3522)
This commit is contained in:
Tomas Votruba 2023-03-26 08:46:54 +00:00
parent 093f3c0641
commit 3cb738e57e
6 changed files with 21 additions and 19 deletions

View File

@ -98,7 +98,7 @@ final class WorkerRunner
$errorAndFileDiffs = []; $errorAndFileDiffs = [];
$systemErrors = []; $systemErrors = [];
// 1. allow PHPStan to work with static reflection on provided files // 1. allow PHPStan to work with static reflection on provided files
$this->applicationFileProcessor->configurePHPStanNodeScopeResolver($filePaths); $this->applicationFileProcessor->configurePHPStanNodeScopeResolver($filePaths, $configuration);
foreach ($filePaths as $filePath) { foreach ($filePaths as $filePath) {
try { try {
$file = new File($filePath, FileSystem::read($filePath)); $file = new File($filePath, FileSystem::read($filePath));

View File

@ -128,7 +128,7 @@ final class ApplicationFileProcessor
// 1. collect all files from files+dirs provided paths // 1. collect all files from files+dirs provided paths
$files = $this->fileFactory->createFromPaths($filePaths); $files = $this->fileFactory->createFromPaths($filePaths);
// 2. PHPStan has to know about all files too // 2. PHPStan has to know about all files too
$this->configurePHPStanNodeScopeResolver($filePaths); $this->configurePHPStanNodeScopeResolver($filePaths, $configuration);
$systemErrorsAndFileDiffs = $this->processFiles($files, $configuration); $systemErrorsAndFileDiffs = $this->processFiles($files, $configuration);
$this->fileDiffFileDecorator->decorate($files); $this->fileDiffFileDecorator->decorate($files);
$this->printFiles($files, $configuration); $this->printFiles($files, $configuration);
@ -170,13 +170,15 @@ final class ApplicationFileProcessor
/** /**
* @param string[] $filePaths * @param string[] $filePaths
*/ */
public function configurePHPStanNodeScopeResolver(array $filePaths) : void public function configurePHPStanNodeScopeResolver(array $filePaths, Configuration $configuration) : void
{ {
$phpFilter = static function (string $filePath) : bool { $fileExtensions = $configuration->getFileExtensions();
return \substr_compare($filePath, '.php', -\strlen('.php')) === 0; $fileWithExtensionsFilter = static function (string $filePath) use($fileExtensions) : bool {
$filePathExtension = \pathinfo($filePath, \PATHINFO_EXTENSION);
return \in_array($filePathExtension, $fileExtensions, \true);
}; };
$phpFilePaths = \array_filter($filePaths, $phpFilter); $filePaths = \array_filter($filePaths, $fileWithExtensionsFilter);
$this->nodeScopeResolver->setAnalysedFiles($phpFilePaths); $this->nodeScopeResolver->setAnalysedFiles($filePaths);
} }
/** /**
* @param File[] $files * @param File[] $files

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api * @api
* @var string * @var string
*/ */
public const PACKAGE_VERSION = 'ad9b5973ebff338b17452fb0240c1834126f388e'; public const PACKAGE_VERSION = '6d3efd5be7ab2de0a25aebabddb26c497611d4fb';
/** /**
* @api * @api
* @var string * @var string
*/ */
public const RELEASE_DATE = '2023-03-26 00:30:03'; public const RELEASE_DATE = '2023-03-26 10:43:02';
/** /**
* @var int * @var int
*/ */

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33::getLoader(); return ComposerAutoloaderInitabb222c1688d781e7335377fa030e510::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33 class ComposerAutoloaderInitabb222c1688d781e7335377fa030e510
{ {
private static $loader; private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33
return self::$loader; 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__)); 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'; 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->setClassMapAuthoritative(true);
$loader->register(true); $loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::$files; $filesToLoad = \Composer\Autoload\ComposerStaticInitabb222c1688d781e7335377fa030e510::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) { $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33 class ComposerStaticInitabb222c1688d781e7335377fa030e510
{ {
public static $files = array ( public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3127,9 +3127,9 @@ class ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInitabb222c1688d781e7335377fa030e510::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitabb222c1688d781e7335377fa030e510::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitfe0610a974532c44fdd8c1d5b8078f33::$classMap; $loader->classMap = ComposerStaticInitabb222c1688d781e7335377fa030e510::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }