Updated Rector to commit aa0c9af2cc7f25d44f38c206da114268f0a397af

aa0c9af2cc Reduce count() usage on PHPStanNodeScopeResolver (#4102)
This commit is contained in:
Tomas Votruba 2023-06-07 07:52:19 +00:00
parent 348aef8907
commit 69b9b53c58
5 changed files with 16 additions and 16 deletions

View File

@ -146,11 +146,11 @@ final class PHPStanNodeScopeResolver
*/
Assert::allIsInstanceOf($stmts, Stmt::class);
$this->nodeTraverser->traverse($stmts);
$isFileWithoutNamespace = \count($stmts) === 1 && $stmts[0] instanceof FileWithoutNamespace;
if (!$isScopeRefreshing && !$isFileWithoutNamespace) {
if (!$isScopeRefreshing && !\current($stmts) instanceof FileWithoutNamespace) {
$stmts = $this->fileWithoutNamespaceNodeTraverser->traverse($stmts);
if (\count($stmts) === 1 && $stmts[0] instanceof FileWithoutNamespace) {
$stmts = $stmts[0]->stmts;
$currentStmt = \current($stmts);
if ($currentStmt instanceof FileWithoutNamespace) {
$stmts = $currentStmt->stmts;
}
}
$scope = $formerMutatingScope ?? $this->scopeFactory->createFromFile($filePath);

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'f4f94bcd4bb9fd9819ae11b1d2b06b74a078c205';
public const PACKAGE_VERSION = 'aa0c9af2cc7f25d44f38c206da114268f0a397af';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-06-07 08:56:48';
public const RELEASE_DATE = '2023-06-07 14:47:56';
/**
* @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';
return ComposerAutoloaderInitfc522e15861238a029f09b626d6e5d63::getLoader();
return ComposerAutoloaderInitaff14a03474074cbfb52b5462c15bbb7::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitfc522e15861238a029f09b626d6e5d63
class ComposerAutoloaderInitaff14a03474074cbfb52b5462c15bbb7
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitfc522e15861238a029f09b626d6e5d63
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitfc522e15861238a029f09b626d6e5d63', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitaff14a03474074cbfb52b5462c15bbb7', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitfc522e15861238a029f09b626d6e5d63', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitaff14a03474074cbfb52b5462c15bbb7', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitfc522e15861238a029f09b626d6e5d63::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitaff14a03474074cbfb52b5462c15bbb7::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitfc522e15861238a029f09b626d6e5d63::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitaff14a03474074cbfb52b5462c15bbb7::$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 ComposerStaticInitfc522e15861238a029f09b626d6e5d63
class ComposerStaticInitaff14a03474074cbfb52b5462c15bbb7
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3040,9 +3040,9 @@ class ComposerStaticInitfc522e15861238a029f09b626d6e5d63
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitfc522e15861238a029f09b626d6e5d63::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitfc522e15861238a029f09b626d6e5d63::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitfc522e15861238a029f09b626d6e5d63::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitaff14a03474074cbfb52b5462c15bbb7::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitaff14a03474074cbfb52b5462c15bbb7::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitaff14a03474074cbfb52b5462c15bbb7::$classMap;
}, null, ClassLoader::class);
}