mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
Updated Rector to commit 6d3efd5be7ab2de0a25aebabddb26c497611d4fb
6d3efd5be7
[Core] Set configured file extensions to analyzed files for NodeScopeResolver (#3522)
This commit is contained in:
parent
093f3c0641
commit
3cb738e57e
@ -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));
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitfe0610a974532c44fdd8c1d5b8078f33::getLoader();
|
||||
return ComposerAutoloaderInitabb222c1688d781e7335377fa030e510::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -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;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user