Skip to content

Commit

Permalink
Updated Rector to commit bdc2fc99631f67eeb2d96e2cf0906279c2561c9a
Browse files Browse the repository at this point in the history
rectorphp/rector-src@bdc2fc9 [NodeManipulator] Remove parent lookup on PropertyFetchAssignManipulator (#4037)
  • Loading branch information
TomasVotruba committed May 31, 2023
1 parent b655a25 commit bfd8f1a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 29 deletions.
2 changes: 1 addition & 1 deletion rules/Php81/Rector/Property/ReadOnlyPropertyRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private function refactorProperty(Class_ $class, Property $property, Scope $scop
if ($this->propertyManipulator->isPropertyChangeableExceptConstructor($class, $property, $scope)) {
return null;
}
if ($this->propertyFetchAssignManipulator->isAssignedMultipleTimesInConstructor($property)) {
if ($this->propertyFetchAssignManipulator->isAssignedMultipleTimesInConstructor($class, $property)) {
return null;
}
if ($this->shouldSkipInReadonlyClass($property)) {
Expand Down
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 = '81e8c74b0ea2a107db681ee21c13925837b84abc';
public const PACKAGE_VERSION = 'bdc2fc99631f67eeb2d96e2cf0906279c2561c9a';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-05-31 13:15:27';
public const RELEASE_DATE = '2023-05-31 13:22:39';
/**
* @var int
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Kernel/RectorKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class RectorKernel
/**
* @var string
*/
private const CACHE_KEY = 'v43';
private const CACHE_KEY = 'v44';
/**
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
*/
Expand Down
18 changes: 3 additions & 15 deletions src/NodeManipulator/PropertyFetchAssignManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
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;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\ValueObject\MethodName;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser;
Expand All @@ -28,30 +26,20 @@ final class PropertyFetchAssignManipulator
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
/**
* @readonly
* @var \Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer
*/
private $propertyFetchAnalyzer;
public function __construct(SimpleCallableNodeTraverser $simpleCallableNodeTraverser, NodeNameResolver $nodeNameResolver, BetterNodeFinder $betterNodeFinder, PropertyFetchAnalyzer $propertyFetchAnalyzer)
public function __construct(SimpleCallableNodeTraverser $simpleCallableNodeTraverser, NodeNameResolver $nodeNameResolver, PropertyFetchAnalyzer $propertyFetchAnalyzer)
{
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
$this->nodeNameResolver = $nodeNameResolver;
$this->betterNodeFinder = $betterNodeFinder;
$this->propertyFetchAnalyzer = $propertyFetchAnalyzer;
}
public function isAssignedMultipleTimesInConstructor(Property $property) : bool
public function isAssignedMultipleTimesInConstructor(Class_ $class, Property $property) : bool
{
$classLike = $this->betterNodeFinder->findParentType($property, ClassLike::class);
if (!$classLike instanceof ClassLike) {
return \false;
}
$classMethod = $classLike->getMethod(MethodName::CONSTRUCT);
$classMethod = $class->getMethod(MethodName::CONSTRUCT);
if (!$classMethod instanceof ClassMethod) {
return \false;
}
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 ComposerAutoloaderInit79d6ac6df0b20288ba3e1e8745c6e242::getLoader();
return ComposerAutoloaderInit36269e6cb2578ea9f157e3d6515171a3::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 ComposerAutoloaderInit79d6ac6df0b20288ba3e1e8745c6e242
class ComposerAutoloaderInit36269e6cb2578ea9f157e3d6515171a3
{
private static $loader;

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

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

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

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

$filesToLoad = \Composer\Autoload\ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit36269e6cb2578ea9f157e3d6515171a3::$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 ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242
class ComposerStaticInit36269e6cb2578ea9f157e3d6515171a3
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -3062,9 +3062,9 @@ class ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit36269e6cb2578ea9f157e3d6515171a3::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit36269e6cb2578ea9f157e3d6515171a3::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit36269e6cb2578ea9f157e3d6515171a3::$classMap;

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

0 comments on commit bfd8f1a

Please sign in to comment.