Updated Rector to commit 9d5ea4c3e6

9d5ea4c3e6 [CodeQuality][CodingStyle][DeadCode] Handle SimplifyIfElseToTernaryRector+InlineSimplePropertyAnnotationRector+RemoveUnusedVariableAssignRector (#2074)
This commit is contained in:
Tomas Votruba 2022-04-14 17:41:58 +00:00
parent 9dc4771f4a
commit 99d2e969d8
6 changed files with 27 additions and 23 deletions

View File

@ -120,10 +120,6 @@ CODE_SAMPLE
if ($this->isUsed($node, $variable)) {
return $this->refactorUsedVariable($node);
}
$parentNode = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
if (!$parentNode instanceof \PhpParser\Node\Stmt\Expression) {
return null;
}
if ($this->hasCallLikeInAssignExpr($node->expr)) {
// keep the expr, can have side effect
return $this->cleanCastedExpr($node->expr);
@ -155,6 +151,14 @@ CODE_SAMPLE
if (!$variable instanceof \PhpParser\Node\Expr\Variable) {
return \true;
}
$parentNode = $assign->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
if (!$parentNode instanceof \PhpParser\Node\Stmt\Expression) {
return \true;
}
$originalNode = $parentNode->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::ORIGINAL_NODE);
if (!$originalNode instanceof \PhpParser\Node) {
return \true;
}
if (!$variable->name instanceof \PhpParser\Node\Expr\Variable) {
return $this->followedByCurlyBracketAnalyzer->isFollowed($this->file, $variable);
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '51228e4c498e336845bbf18de52fdb0d5ecc7c0b';
public const PACKAGE_VERSION = '9d5ea4c3e6c1f39c7c922a5c82eea75577a57e36';
/**
* @var string
*/
public const RELEASE_DATE = '2022-04-14 23:54:57';
public const RELEASE_DATE = '2022-04-14 17:34:32';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20220414\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit27e574e772371024925f940f063b0fa3
class ComposerAutoloaderInit6b30553d3223804a2010bb349ba1e00e
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit27e574e772371024925f940f063b0fa3
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit27e574e772371024925f940f063b0fa3', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit6b30553d3223804a2010bb349ba1e00e', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit27e574e772371024925f940f063b0fa3', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit6b30553d3223804a2010bb349ba1e00e', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit27e574e772371024925f940f063b0fa3::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit6b30553d3223804a2010bb349ba1e00e::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit27e574e772371024925f940f063b0fa3::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit6b30553d3223804a2010bb349ba1e00e::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire27e574e772371024925f940f063b0fa3($fileIdentifier, $file);
composerRequire6b30553d3223804a2010bb349ba1e00e($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit27e574e772371024925f940f063b0fa3
* @param string $file
* @return void
*/
function composerRequire27e574e772371024925f940f063b0fa3($fileIdentifier, $file)
function composerRequire6b30553d3223804a2010bb349ba1e00e($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 ComposerStaticInit27e574e772371024925f940f063b0fa3
class ComposerStaticInit6b30553d3223804a2010bb349ba1e00e
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -3865,9 +3865,9 @@ class ComposerStaticInit27e574e772371024925f940f063b0fa3
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit27e574e772371024925f940f063b0fa3::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit27e574e772371024925f940f063b0fa3::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit27e574e772371024925f940f063b0fa3::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit6b30553d3223804a2010bb349ba1e00e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6b30553d3223804a2010bb349ba1e00e::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6b30553d3223804a2010bb349ba1e00e::$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('RectorPrefix20220414\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit27e574e772371024925f940f063b0fa3', false) && !interface_exists('ComposerAutoloaderInit27e574e772371024925f940f063b0fa3', false) && !trait_exists('ComposerAutoloaderInit27e574e772371024925f940f063b0fa3', false)) {
spl_autoload_call('RectorPrefix20220414\ComposerAutoloaderInit27e574e772371024925f940f063b0fa3');
if (!class_exists('ComposerAutoloaderInit6b30553d3223804a2010bb349ba1e00e', false) && !interface_exists('ComposerAutoloaderInit6b30553d3223804a2010bb349ba1e00e', false) && !trait_exists('ComposerAutoloaderInit6b30553d3223804a2010bb349ba1e00e', false)) {
spl_autoload_call('RectorPrefix20220414\ComposerAutoloaderInit6b30553d3223804a2010bb349ba1e00e');
}
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('RectorPrefix20220414\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220414\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire27e574e772371024925f940f063b0fa3')) {
function composerRequire27e574e772371024925f940f063b0fa3() {
return \RectorPrefix20220414\composerRequire27e574e772371024925f940f063b0fa3(...func_get_args());
if (!function_exists('composerRequire6b30553d3223804a2010bb349ba1e00e')) {
function composerRequire6b30553d3223804a2010bb349ba1e00e() {
return \RectorPrefix20220414\composerRequire6b30553d3223804a2010bb349ba1e00e(...func_get_args());
}
}
if (!function_exists('scanPath')) {