From df111d9b0420a36fca5b5e86babd2c1ea247b4ba Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 21 Jan 2023 13:08:39 +0000 Subject: [PATCH] Updated Rector to commit 9cb97aa042de32f336321516131f007dd519c2d4 https://github.com/rectorphp/rector-src/commit/9cb97aa042de32f336321516131f007dd519c2d4 [Php82] Skip non-FilesystemIterator on FilesystemIteratorSkipDotsRector (#3298) --- .../Rector/New_/FilesystemIteratorSkipDotsRector.php | 7 ++++++- src/Application/VersionResolver.php | 4 ++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php b/rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php index 48a327c65ae..50c2aa1e300 100644 --- a/rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php +++ b/rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php @@ -11,6 +11,7 @@ use PhpParser\Node\Expr\BinaryOp\BitwiseOr; use PhpParser\Node\Expr\ClassConstFetch; use PhpParser\Node\Expr\New_; use PhpParser\Node\Name\FullyQualified; +use PHPStan\Type\ObjectType; use Rector\Core\Rector\AbstractRector; use Rector\Core\ValueObject\PhpVersionFeature; use Rector\NodeNameResolver\NodeNameResolver\ClassConstFetchNameResolver; @@ -46,6 +47,9 @@ final class FilesystemIteratorSkipDotsRector extends AbstractRector implements M */ public function refactor(Node $node) : ?New_ { + if (!$this->isObjectType($node->class, new ObjectType('FilesystemIterator'))) { + return null; + } if ($node->isFirstClassCallable()) { return null; } @@ -83,7 +87,8 @@ final class FilesystemIteratorSkipDotsRector extends AbstractRector implements M private function isSkipDots(Expr $expr) : bool { if (!$expr instanceof ClassConstFetch) { - return \false; + // can be anything + return \true; } return $this->classConstFetchNameResolver->resolve($expr) === 'FilesystemIterator::SKIP_DOTS'; } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 0af36b68553..3dc788db845 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 = '0.15.8'; + public const PACKAGE_VERSION = '9cb97aa042de32f336321516131f007dd519c2d4'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-01-20 20:21:18'; + public const RELEASE_DATE = '2023-01-21 13:04:15'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index 0c5fdf2f863..f5a986177e3 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 ComposerAutoloaderInit37f8995ef812480f1500af09738cbdc0::getLoader(); +return ComposerAutoloaderInit6ebd1588072a038294cd05cb51f261c5::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 763655a5df9..c414cc3a140 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit37f8995ef812480f1500af09738cbdc0 +class ComposerAutoloaderInit6ebd1588072a038294cd05cb51f261c5 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInit37f8995ef812480f1500af09738cbdc0 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit37f8995ef812480f1500af09738cbdc0', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit6ebd1588072a038294cd05cb51f261c5', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit37f8995ef812480f1500af09738cbdc0', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit6ebd1588072a038294cd05cb51f261c5', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit37f8995ef812480f1500af09738cbdc0::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit6ebd1588072a038294cd05cb51f261c5::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit37f8995ef812480f1500af09738cbdc0::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit6ebd1588072a038294cd05cb51f261c5::$files; $requireFile = 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 ee5671a90bb..eaa740bf4cc 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit37f8995ef812480f1500af09738cbdc0 +class ComposerStaticInit6ebd1588072a038294cd05cb51f261c5 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3070,9 +3070,9 @@ class ComposerStaticInit37f8995ef812480f1500af09738cbdc0 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit37f8995ef812480f1500af09738cbdc0::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit37f8995ef812480f1500af09738cbdc0::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit37f8995ef812480f1500af09738cbdc0::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit6ebd1588072a038294cd05cb51f261c5::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit6ebd1588072a038294cd05cb51f261c5::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit6ebd1588072a038294cd05cb51f261c5::$classMap; }, null, ClassLoader::class); }