mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
Updated Rector to commit 84c80e4cb3b771dd60e33a3daa37c697f6f09bb5
84c80e4cb3
[Naming] Skip change duplicate type on RenamePropertyToMatchTypeRector (#161)
This commit is contained in:
parent
2a67a839e2
commit
8953d4eb8c
@ -4,6 +4,7 @@ declare (strict_types=1);
|
||||
namespace Rector\Naming\Rector\Class_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Param;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\ClassLike;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
@ -135,7 +136,8 @@ CODE_SAMPLE
|
||||
if (!$constructClassMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
|
||||
return;
|
||||
}
|
||||
foreach ($constructClassMethod->params as $param) {
|
||||
$desiredPropertyNames = [];
|
||||
foreach ($constructClassMethod->params as $key => $param) {
|
||||
if ($param->flags === 0) {
|
||||
continue;
|
||||
}
|
||||
@ -144,9 +146,27 @@ CODE_SAMPLE
|
||||
if ($desiredPropertyName === null) {
|
||||
continue;
|
||||
}
|
||||
$currentName = $this->getName($param);
|
||||
$this->propertyFetchRenamer->renamePropertyFetchesInClass($classLike, $currentName, $desiredPropertyName);
|
||||
$param->var->name = $desiredPropertyName;
|
||||
if (\in_array($desiredPropertyName, $desiredPropertyNames, \true)) {
|
||||
return;
|
||||
}
|
||||
$desiredPropertyNames[$key] = $desiredPropertyName;
|
||||
}
|
||||
$this->renameParamVarName($classLike, $constructClassMethod->params, $desiredPropertyNames);
|
||||
}
|
||||
/**
|
||||
* @param Param[] $params
|
||||
* @param string[] $desiredPropertyNames
|
||||
*/
|
||||
private function renameParamVarName(\PhpParser\Node\Stmt\ClassLike $classLike, array $params, array $desiredPropertyNames) : void
|
||||
{
|
||||
$keys = \array_keys($desiredPropertyNames);
|
||||
foreach ($params as $key => $param) {
|
||||
if (\in_array($key, $keys, \true)) {
|
||||
$currentName = $this->getName($param);
|
||||
$desiredPropertyName = $desiredPropertyNames[$key];
|
||||
$this->propertyFetchRenamer->renamePropertyFetchesInClass($classLike, $currentName, $desiredPropertyName);
|
||||
$param->var->name = $desiredPropertyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ final class VersionResolver
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '6f59563d8b5b3ac526655380aa37706d569cc75f';
|
||||
public const PACKAGE_VERSION = '84c80e4cb3b771dd60e33a3daa37c697f6f09bb5';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-06-06 11:52:56';
|
||||
public const RELEASE_DATE = '2021-06-06 13:51:26';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20210606\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1::getLoader();
|
||||
return ComposerAutoloaderInitff28a7a2f90365626db20fe8f79c6638::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1
|
||||
class ComposerAutoloaderInitff28a7a2f90365626db20fe8f79c6638
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,15 +22,15 @@ class ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitff28a7a2f90365626db20fe8f79c6638', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitff28a7a2f90365626db20fe8f79c6638', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit7f61e9a3b6dd39903d75c3eb4933eaa1::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitff28a7a2f90365626db20fe8f79c6638::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
@ -42,19 +42,19 @@ class ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit7f61e9a3b6dd39903d75c3eb4933eaa1::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitff28a7a2f90365626db20fe8f79c6638::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire7f61e9a3b6dd39903d75c3eb4933eaa1($fileIdentifier, $file);
|
||||
composerRequireff28a7a2f90365626db20fe8f79c6638($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire7f61e9a3b6dd39903d75c3eb4933eaa1($fileIdentifier, $file)
|
||||
function composerRequireff28a7a2f90365626db20fe8f79c6638($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit7f61e9a3b6dd39903d75c3eb4933eaa1
|
||||
class ComposerStaticInitff28a7a2f90365626db20fe8f79c6638
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
@ -3872,9 +3872,9 @@ class ComposerStaticInit7f61e9a3b6dd39903d75c3eb4933eaa1
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit7f61e9a3b6dd39903d75c3eb4933eaa1::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit7f61e9a3b6dd39903d75c3eb4933eaa1::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit7f61e9a3b6dd39903d75c3eb4933eaa1::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitff28a7a2f90365626db20fe8f79c6638::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitff28a7a2f90365626db20fe8f79c6638::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitff28a7a2f90365626db20fe8f79c6638::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
@ -21,8 +21,8 @@ if (!class_exists('SomeTestCase', false) && !interface_exists('SomeTestCase', fa
|
||||
if (!class_exists('CheckoutEntityFactory', false) && !interface_exists('CheckoutEntityFactory', false) && !trait_exists('CheckoutEntityFactory', false)) {
|
||||
spl_autoload_call('RectorPrefix20210606\CheckoutEntityFactory');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1', false) && !interface_exists('ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1', false) && !trait_exists('ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1', false)) {
|
||||
spl_autoload_call('RectorPrefix20210606\ComposerAutoloaderInit7f61e9a3b6dd39903d75c3eb4933eaa1');
|
||||
if (!class_exists('ComposerAutoloaderInitff28a7a2f90365626db20fe8f79c6638', false) && !interface_exists('ComposerAutoloaderInitff28a7a2f90365626db20fe8f79c6638', false) && !trait_exists('ComposerAutoloaderInitff28a7a2f90365626db20fe8f79c6638', false)) {
|
||||
spl_autoload_call('RectorPrefix20210606\ComposerAutoloaderInitff28a7a2f90365626db20fe8f79c6638');
|
||||
}
|
||||
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
|
||||
spl_autoload_call('RectorPrefix20210606\Doctrine\Inflector\Inflector');
|
||||
@ -3323,9 +3323,9 @@ if (!function_exists('print_node')) {
|
||||
return \RectorPrefix20210606\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequire7f61e9a3b6dd39903d75c3eb4933eaa1')) {
|
||||
function composerRequire7f61e9a3b6dd39903d75c3eb4933eaa1() {
|
||||
return \RectorPrefix20210606\composerRequire7f61e9a3b6dd39903d75c3eb4933eaa1(...func_get_args());
|
||||
if (!function_exists('composerRequireff28a7a2f90365626db20fe8f79c6638')) {
|
||||
function composerRequireff28a7a2f90365626db20fe8f79c6638() {
|
||||
return \RectorPrefix20210606\composerRequireff28a7a2f90365626db20fe8f79c6638(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('parseArgs')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user