Updated Rector to commit 5a3a7cd9f396c34105fab96a8b55786514b9e230

5a3a7cd9f3 [Application] Move filter files by config extensions to FileFactory (#4522)
This commit is contained in:
Tomas Votruba 2023-07-15 12:20:24 +00:00
parent 191ead1e48
commit 22756db413
6 changed files with 19 additions and 27 deletions

View File

@ -111,7 +111,6 @@ final class ApplicationFileProcessor
public function run(Configuration $configuration, InputInterface $input) : array
{
$filePaths = $this->fileFactory->findFilesInPaths($configuration->getPaths(), $configuration);
$filePaths = $this->resolveFilePathsByConfigurationFileExtensions($filePaths, $configuration);
// no files found
if ($filePaths === []) {
return [Bridge::SYSTEM_ERRORS => [], Bridge::FILE_DIFFS => []];
@ -169,19 +168,6 @@ final class ApplicationFileProcessor
}
return $systemErrorsAndFileDiffs;
}
/**
* @param string[] $filePaths
* @return string[]
*/
public function resolveFilePathsByConfigurationFileExtensions(array $filePaths, Configuration $configuration) : array
{
$fileExtensions = $configuration->getFileExtensions();
$fileWithExtensionsFilter = static function (string $filePath) use($fileExtensions) : bool {
$filePathExtension = \pathinfo($filePath, \PATHINFO_EXTENSION);
return \in_array($filePathExtension, $fileExtensions, \true);
};
return \array_filter($filePaths, $fileWithExtensionsFilter);
}
/**
* @param File[] $files
*/

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '45c46ddf40f27d0d2793c6bd99b66c91a8fdf4f8';
public const PACKAGE_VERSION = '5a3a7cd9f396c34105fab96a8b55786514b9e230';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-07-15 12:07:23';
public const RELEASE_DATE = '2023-07-15 19:16:20';
/**
* @var int
*/

View File

@ -48,7 +48,13 @@ final class FileFactory
$this->changedFilesDetector->clear();
}
$supportedFileExtensions = $this->resolveSupportedFileExtensions($configuration);
return $this->filesFinder->findInDirectoriesAndFiles($paths, $supportedFileExtensions);
$filePaths = $this->filesFinder->findInDirectoriesAndFiles($paths, $supportedFileExtensions);
$fileExtensions = $configuration->getFileExtensions();
$fileWithExtensionsFilter = static function (string $filePath) use($fileExtensions) : bool {
$filePathExtension = \pathinfo($filePath, \PATHINFO_EXTENSION);
return \in_array($filePathExtension, $fileExtensions, \true);
};
return \array_filter($filePaths, $fileWithExtensionsFilter);
}
/**
* @param string[] $filePaths

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit55e76aa0da41c77e2c57285ed0279a9a
class ComposerAutoloaderInit8ef099d1000017cdae7851f036f88ae7
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit55e76aa0da41c77e2c57285ed0279a9a
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit55e76aa0da41c77e2c57285ed0279a9a', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit8ef099d1000017cdae7851f036f88ae7', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit55e76aa0da41c77e2c57285ed0279a9a', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit8ef099d1000017cdae7851f036f88ae7', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit55e76aa0da41c77e2c57285ed0279a9a::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit8ef099d1000017cdae7851f036f88ae7::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit55e76aa0da41c77e2c57285ed0279a9a::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit8ef099d1000017cdae7851f036f88ae7::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

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