Updated Rector to commit 954ffad1e5

954ffad1e5 extend MethodCallRenameInterface contract with getClass() (#1129)
This commit is contained in:
Tomas Votruba 2021-11-02 09:33:40 +00:00
parent c7efc375b8
commit a3dbd26c74
9 changed files with 41 additions and 32 deletions

View File

@ -6,7 +6,8 @@ namespace Rector\Renaming\Contract;
use PHPStan\Type\ObjectType;
interface MethodCallRenameInterface
{
public function getOldObjectType() : \PHPStan\Type\ObjectType;
public function getClass() : string;
public function getObjectType() : \PHPStan\Type\ObjectType;
public function getOldMethod() : string;
public function getNewMethod() : string;
}

View File

@ -73,11 +73,11 @@ CODE_SAMPLE
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
{
foreach ($this->methodCallRenames as $methodCallRename) {
$implementsInterface = $this->classManipulator->hasParentMethodOrInterface($methodCallRename->getOldObjectType(), $methodCallRename->getOldMethod());
$implementsInterface = $this->classManipulator->hasParentMethodOrInterface($methodCallRename->getObjectType(), $methodCallRename->getOldMethod());
if ($implementsInterface) {
continue;
}
if (!$this->nodeTypeResolver->isMethodStaticCallOrClassMethodObjectType($node, $methodCallRename->getOldObjectType())) {
if (!$this->nodeTypeResolver->isMethodStaticCallOrClassMethodObjectType($node, $methodCallRename->getObjectType())) {
continue;
}
if (!$this->isName($node->name, $methodCallRename->getOldMethod())) {

View File

@ -10,7 +10,7 @@ final class MethodCallRename implements \Rector\Renaming\Contract\MethodCallRena
/**
* @var string
*/
private $oldClass;
private $class;
/**
* @var string
*/
@ -19,15 +19,19 @@ final class MethodCallRename implements \Rector\Renaming\Contract\MethodCallRena
* @var string
*/
private $newMethod;
public function __construct(string $oldClass, string $oldMethod, string $newMethod)
public function __construct(string $class, string $oldMethod, string $newMethod)
{
$this->oldClass = $oldClass;
$this->class = $class;
$this->oldMethod = $oldMethod;
$this->newMethod = $newMethod;
}
public function getOldObjectType() : \PHPStan\Type\ObjectType
public function getClass() : string
{
return new \PHPStan\Type\ObjectType($this->oldClass);
return $this->class;
}
public function getObjectType() : \PHPStan\Type\ObjectType
{
return new \PHPStan\Type\ObjectType($this->class);
}
public function getOldMethod() : string
{

View File

@ -10,7 +10,7 @@ final class MethodCallRenameWithArrayKey implements \Rector\Renaming\Contract\Me
/**
* @var string
*/
private $oldClass;
private $class;
/**
* @var string
*/
@ -23,16 +23,20 @@ final class MethodCallRenameWithArrayKey implements \Rector\Renaming\Contract\Me
/**
* @param mixed $arrayKey
*/
public function __construct(string $oldClass, string $oldMethod, string $newMethod, $arrayKey)
public function __construct(string $class, string $oldMethod, string $newMethod, $arrayKey)
{
$this->oldClass = $oldClass;
$this->class = $class;
$this->oldMethod = $oldMethod;
$this->newMethod = $newMethod;
$this->arrayKey = $arrayKey;
}
public function getOldObjectType() : \PHPStan\Type\ObjectType
public function getClass() : string
{
return new \PHPStan\Type\ObjectType($this->oldClass);
return $this->class;
}
public function getObjectType() : \PHPStan\Type\ObjectType
{
return new \PHPStan\Type\ObjectType($this->class);
}
public function getOldMethod() : string
{

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'df233273aa078a74f464359a522984bce7d6d4f1';
public const PACKAGE_VERSION = '954ffad1e58f9640e9581ee3a6bbbc6bbdb385fa';
/**
* @var string
*/
public const RELEASE_DATE = '2021-11-02 15:11:00';
public const RELEASE_DATE = '2021-11-02 10:14:19';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20211102\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc::getLoader();
return ComposerAutoloaderInitfe4e58c29112e82d9914ab75af40f1ae::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc
class ComposerAutoloaderInitfe4e58c29112e82d9914ab75af40f1ae
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitfe4e58c29112e82d9914ab75af40f1ae', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitfe4e58c29112e82d9914ab75af40f1ae', '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\ComposerStaticInitd7ec0a64c9df37c2af67911d695483fc::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitfe4e58c29112e82d9914ab75af40f1ae::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitd7ec0a64c9df37c2af67911d695483fc::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitfe4e58c29112e82d9914ab75af40f1ae::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequired7ec0a64c9df37c2af67911d695483fc($fileIdentifier, $file);
composerRequirefe4e58c29112e82d9914ab75af40f1ae($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequired7ec0a64c9df37c2af67911d695483fc($fileIdentifier, $file)
function composerRequirefe4e58c29112e82d9914ab75af40f1ae($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitd7ec0a64c9df37c2af67911d695483fc
class ComposerStaticInitfe4e58c29112e82d9914ab75af40f1ae
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3539,9 +3539,9 @@ class ComposerStaticInitd7ec0a64c9df37c2af67911d695483fc
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitd7ec0a64c9df37c2af67911d695483fc::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd7ec0a64c9df37c2af67911d695483fc::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitd7ec0a64c9df37c2af67911d695483fc::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitfe4e58c29112e82d9914ab75af40f1ae::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitfe4e58c29112e82d9914ab75af40f1ae::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitfe4e58c29112e82d9914ab75af40f1ae::$classMap;
}, null, ClassLoader::class);
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20211102\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc', false) && !interface_exists('ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc', false) && !trait_exists('ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc', false)) {
spl_autoload_call('RectorPrefix20211102\ComposerAutoloaderInitd7ec0a64c9df37c2af67911d695483fc');
if (!class_exists('ComposerAutoloaderInitfe4e58c29112e82d9914ab75af40f1ae', false) && !interface_exists('ComposerAutoloaderInitfe4e58c29112e82d9914ab75af40f1ae', false) && !trait_exists('ComposerAutoloaderInitfe4e58c29112e82d9914ab75af40f1ae', false)) {
spl_autoload_call('RectorPrefix20211102\ComposerAutoloaderInitfe4e58c29112e82d9914ab75af40f1ae');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20211102\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -3306,9 +3306,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20211102\print_node(...func_get_args());
}
}
if (!function_exists('composerRequired7ec0a64c9df37c2af67911d695483fc')) {
function composerRequired7ec0a64c9df37c2af67911d695483fc() {
return \RectorPrefix20211102\composerRequired7ec0a64c9df37c2af67911d695483fc(...func_get_args());
if (!function_exists('composerRequirefe4e58c29112e82d9914ab75af40f1ae')) {
function composerRequirefe4e58c29112e82d9914ab75af40f1ae() {
return \RectorPrefix20211102\composerRequirefe4e58c29112e82d9914ab75af40f1ae(...func_get_args());
}
}
if (!function_exists('parseArgs')) {