mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
Updated Rector to commit f257b10df15331bc6bf3cfa9fc2c44b685a0076b
f257b10df1
[DeadCode][CodeQuality] Handle SimplifyIfElseToTernaryRector + RemoveUnusedAssignVariableRector (#789)
This commit is contained in:
parent
5fcab9b1bb
commit
d5dde5695b
@ -103,6 +103,12 @@ CODE_SAMPLE
|
||||
if (!$this->isPreviousVariablePartOfOverridingAssign($node) && ($this->isVariableTypeInScope($node) || $this->exprUsedInNextNodeAnalyzer->isUsed($node->var))) {
|
||||
return null;
|
||||
}
|
||||
// @see https://github.com/rectorphp/rector/issues/6655
|
||||
// verify current statement is a Node before removing or use its Assign Expr
|
||||
$currentStatement = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CURRENT_STATEMENT);
|
||||
if (!$currentStatement instanceof \PhpParser\Node) {
|
||||
return null;
|
||||
}
|
||||
// is scalar assign? remove whole
|
||||
if (!$this->sideEffectNodeDetector->detect($node->expr)) {
|
||||
$this->removeNode($node);
|
||||
|
@ -16,11 +16,11 @@ final class VersionResolver
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'a81fd4e050c40ff4de5852d6211eb6865ba7e622';
|
||||
public const PACKAGE_VERSION = 'f257b10df15331bc6bf3cfa9fc2c44b685a0076b';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-08-30 10:13:52';
|
||||
public const RELEASE_DATE = '2021-08-30 10:16:55';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20210830\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214::getLoader();
|
||||
return ComposerAutoloaderInite2f04476e58288750fa77432dff28e79::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214
|
||||
class ComposerAutoloaderInite2f04476e58288750fa77432dff28e79
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,15 +22,15 @@ class ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInite2f04476e58288750fa77432dff28e79', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInite2f04476e58288750fa77432dff28e79', '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\ComposerStaticInitb6969ae95cb1e8c1d2e073f043661214::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInite2f04476e58288750fa77432dff28e79::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
@ -42,19 +42,19 @@ class ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitb6969ae95cb1e8c1d2e073f043661214::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInite2f04476e58288750fa77432dff28e79::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireb6969ae95cb1e8c1d2e073f043661214($fileIdentifier, $file);
|
||||
composerRequiree2f04476e58288750fa77432dff28e79($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequireb6969ae95cb1e8c1d2e073f043661214($fileIdentifier, $file)
|
||||
function composerRequiree2f04476e58288750fa77432dff28e79($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitb6969ae95cb1e8c1d2e073f043661214
|
||||
class ComposerStaticInite2f04476e58288750fa77432dff28e79
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
@ -3856,9 +3856,9 @@ class ComposerStaticInitb6969ae95cb1e8c1d2e073f043661214
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitb6969ae95cb1e8c1d2e073f043661214::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitb6969ae95cb1e8c1d2e073f043661214::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitb6969ae95cb1e8c1d2e073f043661214::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInite2f04476e58288750fa77432dff28e79::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInite2f04476e58288750fa77432dff28e79::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInite2f04476e58288750fa77432dff28e79::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
@ -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('RectorPrefix20210830\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214', false) && !interface_exists('ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214', false) && !trait_exists('ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214', false)) {
|
||||
spl_autoload_call('RectorPrefix20210830\ComposerAutoloaderInitb6969ae95cb1e8c1d2e073f043661214');
|
||||
if (!class_exists('ComposerAutoloaderInite2f04476e58288750fa77432dff28e79', false) && !interface_exists('ComposerAutoloaderInite2f04476e58288750fa77432dff28e79', false) && !trait_exists('ComposerAutoloaderInite2f04476e58288750fa77432dff28e79', false)) {
|
||||
spl_autoload_call('RectorPrefix20210830\ComposerAutoloaderInite2f04476e58288750fa77432dff28e79');
|
||||
}
|
||||
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('RectorPrefix20210830\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
@ -3311,9 +3311,9 @@ if (!function_exists('print_node')) {
|
||||
return \RectorPrefix20210830\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequireb6969ae95cb1e8c1d2e073f043661214')) {
|
||||
function composerRequireb6969ae95cb1e8c1d2e073f043661214() {
|
||||
return \RectorPrefix20210830\composerRequireb6969ae95cb1e8c1d2e073f043661214(...func_get_args());
|
||||
if (!function_exists('composerRequiree2f04476e58288750fa77432dff28e79')) {
|
||||
function composerRequiree2f04476e58288750fa77432dff28e79() {
|
||||
return \RectorPrefix20210830\composerRequiree2f04476e58288750fa77432dff28e79(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('parseArgs')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user