Skip to content

Commit

Permalink
Updated Rector to commit 98fa6b51c4114010cb45c7f07ad96256430bf605
Browse files Browse the repository at this point in the history
rectorphp/rector-src@98fa6b5 [NodeManipulator] Reduce parent lookup on PropertyFetchAssignManipulator (#4036)
  • Loading branch information
TomasVotruba committed May 31, 2023
1 parent c0ad822 commit a31c14f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '227186b39430fee40e5c6ba5ff7261700c9d5031';
public const PACKAGE_VERSION = '98fa6b51c4114010cb45c7f07ad96256430bf605';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-05-31 13:00:19';
public const RELEASE_DATE = '2023-05-31 13:13:35';
/**
* @var int
*/
Expand Down
12 changes: 7 additions & 5 deletions src/NodeManipulator/PropertyFetchAssignManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

use PhpParser\Node;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Property;
use PhpParser\NodeTraverser;
use Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer;
Expand Down Expand Up @@ -55,17 +57,17 @@ public function isAssignedMultipleTimesInConstructor(Property $property) : bool
}
$count = 0;
$propertyName = $this->nodeNameResolver->getName($property);
$this->simpleCallableNodeTraverser->traverseNodesWithCallable((array) $classMethod->getStmts(), function (Node $node) use($propertyName, $classLike, &$count) : ?int {
$this->simpleCallableNodeTraverser->traverseNodesWithCallable((array) $classMethod->getStmts(), function (Node $node) use($propertyName, &$count) : ?int {
// skip anonymous classes and inner function
if ($node instanceof Class_ || $node instanceof Function_) {
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
}
if (!$node instanceof Assign) {
return null;
}
if (!$this->propertyFetchAnalyzer->isLocalPropertyFetchName($node->var, $propertyName)) {
return null;
}
$parentClassLike = $this->betterNodeFinder->findParentType($node, ClassLike::class);
if ($parentClassLike !== $classLike) {
return null;
}
++$count;
if ($count === 2) {
return NodeTraverser::STOP_TRAVERSAL;
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit240e2a823014eaffbeecb0be6de24226::getLoader();
return ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d::getLoader();
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit240e2a823014eaffbeecb0be6de24226
class ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d
{
private static $loader;

Expand All @@ -22,17 +22,17 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit240e2a823014eaffbeecb0be6de24226', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit240e2a823014eaffbeecb0be6de24226', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit240e2a823014eaffbeecb0be6de24226::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit731739b266fe641fa1d637c18a956e3d::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);

$filesToLoad = \Composer\Autoload\ComposerStaticInit240e2a823014eaffbeecb0be6de24226::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit731739b266fe641fa1d637c18a956e3d::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit240e2a823014eaffbeecb0be6de24226
class ComposerStaticInit731739b266fe641fa1d637c18a956e3d
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -3062,9 +3062,9 @@ class ComposerStaticInit240e2a823014eaffbeecb0be6de24226
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit240e2a823014eaffbeecb0be6de24226::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit240e2a823014eaffbeecb0be6de24226::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit240e2a823014eaffbeecb0be6de24226::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit731739b266fe641fa1d637c18a956e3d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit731739b266fe641fa1d637c18a956e3d::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit731739b266fe641fa1d637c18a956e3d::$classMap;

}, null, ClassLoader::class);
}
Expand Down

0 comments on commit a31c14f

Please sign in to comment.