Updated Rector to commit 21ead88cdeef5013e635c9e4eb2a22456d6e93e9

21ead88cde [Core] Improve performance: remove unnecessary loop StmtsAwareInterface to fill Scope on PHPStanNodeScopeResolver (#3048)
This commit is contained in:
Tomas Votruba 2022-11-11 13:35:09 +00:00
parent fac0875c1b
commit 73bd079d75
5 changed files with 14 additions and 27 deletions

View File

@ -43,7 +43,6 @@ use PHPStan\Type\ObjectType;
use PHPStan\Type\TypeCombinator;
use Rector\Caching\Detector\ChangedFilesDetector;
use Rector\Caching\FileSystem\DependencyResolver;
use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\StaticReflection\SourceLocator\ParentAttributeSourceLocator;
use Rector\Core\StaticReflection\SourceLocator\RenamedClassesSourceLocator;
@ -183,9 +182,6 @@ final class PHPStanNodeScopeResolver
// decorate value as well
$node->var->setAttribute(AttributeKey::SCOPE, $mutatingScope);
}
if ($node instanceof StmtsAwareInterface) {
$this->processStmtsAwareInterface($node, $mutatingScope);
}
if ($node instanceof Trait_) {
$traitName = $this->resolveClassName($node);
$traitReflectionClass = $this->reflectionProvider->getClass($traitName);
@ -215,15 +211,6 @@ final class PHPStanNodeScopeResolver
};
return $this->processNodesWithDependentFiles($filePath, $stmts, $scope, $nodeCallback);
}
private function processStmtsAwareInterface(StmtsAwareInterface $stmtsAware, MutatingScope $mutatingScope) : void
{
if ($stmtsAware->stmts === null) {
return;
}
foreach ($stmtsAware->stmts as $stmt) {
$stmt->setAttribute(AttributeKey::SCOPE, $mutatingScope);
}
}
private function processArrayItem(ArrayItem $arrayItem, MutatingScope $mutatingScope) : void
{
if ($arrayItem->key instanceof Expr) {

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'fced569c7d60f32dbe3bc02e7ba8b64dd5aeef0f';
public const PACKAGE_VERSION = '21ead88cdeef5013e635c9e4eb2a22456d6e93e9';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-11-11 12:44:25';
public const RELEASE_DATE = '2022-11-11 14:30:37';
/**
* @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 ComposerAutoloaderInitfe1a0aaefa49d26af612d44510f35d51::getLoader();
return ComposerAutoloaderInit8fc6bad89166e4dfab86781ae1b64388::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitfe1a0aaefa49d26af612d44510f35d51
class ComposerAutoloaderInit8fc6bad89166e4dfab86781ae1b64388
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInitfe1a0aaefa49d26af612d44510f35d51
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitfe1a0aaefa49d26af612d44510f35d51', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit8fc6bad89166e4dfab86781ae1b64388', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitfe1a0aaefa49d26af612d44510f35d51', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit8fc6bad89166e4dfab86781ae1b64388', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitfe1a0aaefa49d26af612d44510f35d51::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit8fc6bad89166e4dfab86781ae1b64388::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInitfe1a0aaefa49d26af612d44510f35d51::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit8fc6bad89166e4dfab86781ae1b64388::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirefe1a0aaefa49d26af612d44510f35d51($fileIdentifier, $file);
composerRequire8fc6bad89166e4dfab86781ae1b64388($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInitfe1a0aaefa49d26af612d44510f35d51
* @param string $file
* @return void
*/
function composerRequirefe1a0aaefa49d26af612d44510f35d51($fileIdentifier, $file)
function composerRequire8fc6bad89166e4dfab86781ae1b64388($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 ComposerStaticInitfe1a0aaefa49d26af612d44510f35d51
class ComposerStaticInit8fc6bad89166e4dfab86781ae1b64388
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3053,9 +3053,9 @@ class ComposerStaticInitfe1a0aaefa49d26af612d44510f35d51
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitfe1a0aaefa49d26af612d44510f35d51::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitfe1a0aaefa49d26af612d44510f35d51::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitfe1a0aaefa49d26af612d44510f35d51::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit8fc6bad89166e4dfab86781ae1b64388::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8fc6bad89166e4dfab86781ae1b64388::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8fc6bad89166e4dfab86781ae1b64388::$classMap;
}, null, ClassLoader::class);
}