Updated Rector to commit dc1d8625a1

dc1d8625a1 fix name variable caller -> callerName (#253)
This commit is contained in:
Tomas Votruba 2021-06-20 10:00:08 +00:00
parent dd0f41032c
commit 8fb4c4de26
6 changed files with 33 additions and 33 deletions

View File

@ -52,33 +52,33 @@ final class MethodCallToVariableNameResolver
*/
public function resolveVariableName(\PhpParser\Node\Expr\MethodCall $methodCall) : ?string
{
$caller = $this->nodeNameResolver->getName($methodCall->var);
$callerName = $this->nodeNameResolver->getName($methodCall->var);
$methodCallName = $this->nodeNameResolver->getName($methodCall->name);
if ($caller === null) {
if ($callerName === null) {
return null;
}
if ($methodCallName === null) {
return null;
}
$result = $this->getVariableName($methodCall, $caller, $methodCallName);
$result = $this->getVariableName($methodCall, $callerName, $methodCallName);
if (!\RectorPrefix20210620\Nette\Utils\Strings::match($result, self::SPACE_REGEX)) {
return $result;
}
return $this->getFallbackVarName($caller, $methodCallName);
return $this->getFallbackVarName($callerName, $methodCallName);
}
private function getVariableName(\PhpParser\Node\Expr\MethodCall $methodCall, string $caller, string $methodCallName) : string
private function getVariableName(\PhpParser\Node\Expr\MethodCall $methodCall, string $callerName, string $methodCallName) : string
{
$variableName = $this->expectedNameResolver->resolveForCall($methodCall);
if ($methodCall->args === [] && $variableName !== null && $variableName !== $caller) {
if ($methodCall->args === [] && $variableName !== null && $variableName !== $callerName) {
return $variableName;
}
$fallbackVarName = $this->getFallbackVarName($caller, $methodCallName);
$fallbackVarName = $this->getFallbackVarName($callerName, $methodCallName);
$argValue = $methodCall->args[0]->value;
if ($argValue instanceof \PhpParser\Node\Expr\ClassConstFetch && $argValue->name instanceof \PhpParser\Node\Identifier) {
return $this->getClassConstFetchVarName($argValue, $methodCallName);
}
if ($argValue instanceof \PhpParser\Node\Scalar\String_) {
return $this->getStringVarName($argValue, $caller, $fallbackVarName);
return $this->getStringVarName($argValue, $callerName, $fallbackVarName);
}
$argumentName = $this->nodeNameResolver->getName($argValue);
if (!$argValue instanceof \PhpParser\Node\Expr\Variable) {
@ -96,12 +96,12 @@ final class MethodCallToVariableNameResolver
{
return \strpos($functionName, '\\') !== \false;
}
private function getFallbackVarName(string $caller, string $methodCallName) : string
private function getFallbackVarName(string $callerName, string $methodCallName) : string
{
if ($this->isNamespacedFunctionName($caller)) {
$caller = \RectorPrefix20210620\Nette\Utils\Strings::after($caller, '\\', -1);
if ($this->isNamespacedFunctionName($callerName)) {
$callerName = \RectorPrefix20210620\Nette\Utils\Strings::after($callerName, '\\', -1);
}
return $caller . \ucfirst($methodCallName);
return $callerName . \ucfirst($methodCallName);
}
private function getClassConstFetchVarName(\PhpParser\Node\Expr\ClassConstFetch $classConstFetch, string $methodCallName) : string
{
@ -118,13 +118,13 @@ final class MethodCallToVariableNameResolver
}
return $this->normalizeStringVariableName($methodCallName);
}
private function getStringVarName(\PhpParser\Node\Scalar\String_ $string, string $caller, string $fallbackVarName) : string
private function getStringVarName(\PhpParser\Node\Scalar\String_ $string, string $callerName, string $fallbackVarName) : string
{
$normalizeStringVariableName = $this->normalizeStringVariableName($string->value . \ucfirst($fallbackVarName));
if (!\RectorPrefix20210620\Nette\Utils\Strings::match($normalizeStringVariableName, self::START_ALPHA_REGEX)) {
return $fallbackVarName;
}
if ($normalizeStringVariableName === $caller) {
if ($normalizeStringVariableName === $callerName) {
return $fallbackVarName;
}
return $normalizeStringVariableName;

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'dc90b45425c4921e221b7b6b826fa3cb22ccd981';
public const PACKAGE_VERSION = 'dc1d8625a1086779b8c235564128f214e0e1ee55';
/**
* @var string
*/
public const RELEASE_DATE = '2021-06-20 00:25:55';
public const RELEASE_DATE = '2021-06-20 09:48:11';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210620\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 ComposerAutoloaderInitb6d341bce62719b79bc58c2aa12a3061::getLoader();
return ComposerAutoloaderInit80b5dee66b7c9e7cf8f48cd66046d004::getLoader();

View File

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

View File

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

View File

@ -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('RectorPrefix20210620\CheckoutEntityFactory');
}
if (!class_exists('ComposerAutoloaderInitb6d341bce62719b79bc58c2aa12a3061', false) && !interface_exists('ComposerAutoloaderInitb6d341bce62719b79bc58c2aa12a3061', false) && !trait_exists('ComposerAutoloaderInitb6d341bce62719b79bc58c2aa12a3061', false)) {
spl_autoload_call('RectorPrefix20210620\ComposerAutoloaderInitb6d341bce62719b79bc58c2aa12a3061');
if (!class_exists('ComposerAutoloaderInit80b5dee66b7c9e7cf8f48cd66046d004', false) && !interface_exists('ComposerAutoloaderInit80b5dee66b7c9e7cf8f48cd66046d004', false) && !trait_exists('ComposerAutoloaderInit80b5dee66b7c9e7cf8f48cd66046d004', false)) {
spl_autoload_call('RectorPrefix20210620\ComposerAutoloaderInit80b5dee66b7c9e7cf8f48cd66046d004');
}
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
spl_autoload_call('RectorPrefix20210620\Doctrine\Inflector\Inflector');
@ -3323,9 +3323,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210620\print_node(...func_get_args());
}
}
if (!function_exists('composerRequireb6d341bce62719b79bc58c2aa12a3061')) {
function composerRequireb6d341bce62719b79bc58c2aa12a3061() {
return \RectorPrefix20210620\composerRequireb6d341bce62719b79bc58c2aa12a3061(...func_get_args());
if (!function_exists('composerRequire80b5dee66b7c9e7cf8f48cd66046d004')) {
function composerRequire80b5dee66b7c9e7cf8f48cd66046d004() {
return \RectorPrefix20210620\composerRequire80b5dee66b7c9e7cf8f48cd66046d004(...func_get_args());
}
}
if (!function_exists('parseArgs')) {