Updated Rector to commit 21f33de2b90c0e63d42c3ebebef7cf4415191a21

21f33de2b9 Recreate to exact Expr node instead of printing when possible on AddParamBasedOnParentClassMethodRector take 2 (#4842)
This commit is contained in:
Tomas Votruba 2023-08-24 10:28:16 +00:00
parent 6da4ac4e2a
commit b19f667a5b
9 changed files with 25 additions and 25 deletions

View File

@ -198,8 +198,8 @@ CODE_SAMPLE
private function resolveParamDefault(Expr $expr) : Expr
{
// re-create to avoid TokenStream error
if ($expr instanceof String_ && $expr->value === '') {
return new String_($expr->value);
if ($expr instanceof String_) {
return new String_($expr->value, [AttributeKey::KIND => $expr->getAttribute(AttributeKey::KIND)]);
}
if ($expr instanceof LNumber) {
return new LNumber($expr->value);
@ -207,10 +207,10 @@ CODE_SAMPLE
if ($expr instanceof DNumber) {
return new DNumber($expr->value);
}
$printParamDefault = $this->betterStandardPrinter->print($expr);
if ($printParamDefault === '[]') {
return new Array_([]);
if ($expr instanceof Array_ && $expr->items === []) {
return new Array_($expr->items, [AttributeKey::KIND => $expr->getAttribute(AttributeKey::KIND)]);
}
$printParamDefault = $this->betterStandardPrinter->print($expr);
return new ConstFetch(new Name($printParamDefault));
}
/**

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '295156cba171ce9685cd26e73490fd7d7b2001b1';
public const PACKAGE_VERSION = '21f33de2b90c0e63d42c3ebebef7cf4415191a21';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-08-24 14:15:31';
public const RELEASE_DATE = '2023-08-24 17:24:57';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit8671783b2c46a0862733c9e04557a6cf::getLoader();
return ComposerAutoloaderInit97d2a153d27d81819b1dac0daacf982b::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit8671783b2c46a0862733c9e04557a6cf
class ComposerAutoloaderInit97d2a153d27d81819b1dac0daacf982b
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit8671783b2c46a0862733c9e04557a6cf
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit8671783b2c46a0862733c9e04557a6cf', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit97d2a153d27d81819b1dac0daacf982b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit8671783b2c46a0862733c9e04557a6cf', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit97d2a153d27d81819b1dac0daacf982b', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8671783b2c46a0862733c9e04557a6cf::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit97d2a153d27d81819b1dac0daacf982b::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit8671783b2c46a0862733c9e04557a6cf::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit97d2a153d27d81819b1dac0daacf982b::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit8671783b2c46a0862733c9e04557a6cf
class ComposerStaticInit97d2a153d27d81819b1dac0daacf982b
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -2609,9 +2609,9 @@ class ComposerStaticInit8671783b2c46a0862733c9e04557a6cf
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit8671783b2c46a0862733c9e04557a6cf::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8671783b2c46a0862733c9e04557a6cf::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8671783b2c46a0862733c9e04557a6cf::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit97d2a153d27d81819b1dac0daacf982b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit97d2a153d27d81819b1dac0daacf982b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit97d2a153d27d81819b1dac0daacf982b::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1812,12 +1812,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "9a58a849b3cc586c1a1654bfe1df9541cd2f4fd7"
"reference": "ae036b6c4f50cfd253ea527c83c8fc6819e8e1e7"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/9a58a849b3cc586c1a1654bfe1df9541cd2f4fd7",
"reference": "9a58a849b3cc586c1a1654bfe1df9541cd2f4fd7",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/ae036b6c4f50cfd253ea527c83c8fc6819e8e1e7",
"reference": "ae036b6c4f50cfd253ea527c83c8fc6819e8e1e7",
"shasum": ""
},
"require": {
@ -1831,7 +1831,7 @@
"phpunit\/phpunit": "^10.1",
"rector\/phpstan-rules": "^0.6",
"rector\/rector-generator": "^0.6",
"rector\/rector-src": "dev-phpstan-config",
"rector\/rector-src": "dev-main",
"symplify\/easy-ci": "^11.2",
"symplify\/easy-coding-standard": "^11.2",
"symplify\/phpstan-extensions": "^11.2",
@ -1843,7 +1843,7 @@
"tomasvotruba\/type-coverage": "^0.2",
"tomasvotruba\/unused-public": "^0.1"
},
"time": "2023-08-24T07:10:27+00:00",
"time": "2023-08-24T07:17:26+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main c0ab738'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9a58a84'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e6dd6a0'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ef9424a'));
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main c0ab738'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ae036b6'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e6dd6a0'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ef9424a'));
private function __construct()
{
}

View File

@ -14,7 +14,7 @@
"phpunit\/phpunit": "^10.1",
"rector\/phpstan-rules": "^0.6",
"rector\/rector-generator": "^0.6",
"rector\/rector-src": "dev-phpstan-config",
"rector\/rector-src": "dev-main",
"symplify\/easy-ci": "^11.2",
"symplify\/easy-coding-standard": "^11.2",
"symplify\/phpstan-extensions": "^11.2",