Updated Rector to commit 2a56619617a8a263fcfd8052bf8f9c2404419a06

2a56619617 Fix handling of curly braces for choice's callback (#642)
This commit is contained in:
Tomas Votruba 2021-08-11 06:48:39 +00:00
parent a75504cb47
commit c891c89e88
7 changed files with 25 additions and 23 deletions

View File

@ -8,6 +8,7 @@ use PhpParser\Node;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocParser\ClassAnnotationMatcher;
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
final class PhpDocClassRenamer
{
/**
@ -40,14 +41,15 @@ final class PhpDocClassRenamer
return;
}
$callback = $assertChoiceTagValueNode->getValueWithoutQuotes('callback');
if ($callback === null) {
if (!$callback instanceof \Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode) {
return;
}
$callbackClass = $callback->getValueWithoutQuotes(0);
foreach ($oldToNewClasses as $oldClass => $newClass) {
if ($callback[0] !== $oldClass) {
if ($callbackClass !== $oldClass) {
continue;
}
$callback[0] = $newClass;
$callback->changeValue('0', $newClass);
$assertChoiceTagValueNode->changeValue('callback', $callback);
break;
}

View File

@ -83,7 +83,7 @@ abstract class AbstractValuesAwareNode implements \PHPStan\PhpDocParser\Ast\PhpD
public function changeValue(string $key, $value) : void
{
// is quoted?
if (isset($this->values[$key])) {
if (isset($this->values[$key]) && \is_string($this->values[$key])) {
$isQuoted = (bool) \RectorPrefix20210811\Nette\Utils\Strings::match($this->values[$key], self::UNQUOTED_VALUE_REGEX);
if ($isQuoted) {
$value = '"' . $value . '"';

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '3a76077bfe5ba553bf59f7ea269b7d594f715ecb';
public const PACKAGE_VERSION = '2a56619617a8a263fcfd8052bf8f9c2404419a06';
/**
* @var string
*/
public const RELEASE_DATE = '2021-08-11 08:26:39';
public const RELEASE_DATE = '2021-08-11 08:36:27';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210811\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 ComposerAutoloaderInita0a6a823e83b0927e15867837ab07a6e::getLoader();
return ComposerAutoloaderInitaee0294538353c88ee2832cea5f368bd::getLoader();

View File

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

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInita0a6a823e83b0927e15867837ab07a6e
class ComposerStaticInitaee0294538353c88ee2832cea5f368bd
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3849,9 +3849,9 @@ class ComposerStaticInita0a6a823e83b0927e15867837ab07a6e
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInita0a6a823e83b0927e15867837ab07a6e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita0a6a823e83b0927e15867837ab07a6e::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInita0a6a823e83b0927e15867837ab07a6e::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitaee0294538353c88ee2832cea5f368bd::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitaee0294538353c88ee2832cea5f368bd::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitaee0294538353c88ee2832cea5f368bd::$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('RectorPrefix20210811\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInita0a6a823e83b0927e15867837ab07a6e', false) && !interface_exists('ComposerAutoloaderInita0a6a823e83b0927e15867837ab07a6e', false) && !trait_exists('ComposerAutoloaderInita0a6a823e83b0927e15867837ab07a6e', false)) {
spl_autoload_call('RectorPrefix20210811\ComposerAutoloaderInita0a6a823e83b0927e15867837ab07a6e');
if (!class_exists('ComposerAutoloaderInitaee0294538353c88ee2832cea5f368bd', false) && !interface_exists('ComposerAutoloaderInitaee0294538353c88ee2832cea5f368bd', false) && !trait_exists('ComposerAutoloaderInitaee0294538353c88ee2832cea5f368bd', false)) {
spl_autoload_call('RectorPrefix20210811\ComposerAutoloaderInitaee0294538353c88ee2832cea5f368bd');
}
if (!class_exists('AjaxLogin', false) && !interface_exists('AjaxLogin', false) && !trait_exists('AjaxLogin', false)) {
spl_autoload_call('RectorPrefix20210811\AjaxLogin');
@ -3305,9 +3305,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210811\print_node(...func_get_args());
}
}
if (!function_exists('composerRequirea0a6a823e83b0927e15867837ab07a6e')) {
function composerRequirea0a6a823e83b0927e15867837ab07a6e() {
return \RectorPrefix20210811\composerRequirea0a6a823e83b0927e15867837ab07a6e(...func_get_args());
if (!function_exists('composerRequireaee0294538353c88ee2832cea5f368bd')) {
function composerRequireaee0294538353c88ee2832cea5f368bd() {
return \RectorPrefix20210811\composerRequireaee0294538353c88ee2832cea5f368bd(...func_get_args());
}
}
if (!function_exists('parseArgs')) {