Skip to content

Commit

Permalink
Updated Rector to commit 5145487
Browse files Browse the repository at this point in the history
rectorphp/rector-src@5145487 recursion is not needed, as Rector now works till there is something to change
  • Loading branch information
TomasVotruba committed Aug 2, 2021
1 parent fb7f804 commit 0f5395c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 23 deletions.
20 changes: 16 additions & 4 deletions rules/DeadCode/Rector/Plus/RemoveDeadZeroAndOneOperationRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use PhpParser\Node\Expr\AssignOp\Minus as AssignMinus;
use PhpParser\Node\Expr\AssignOp\Mul as AssignMul;
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus;
use PhpParser\Node\Expr\BinaryOp;
use PhpParser\Node\Expr\BinaryOp\Div;
use PhpParser\Node\Expr\BinaryOp\Minus;
use PhpParser\Node\Expr\BinaryOp\Mul;
Expand Down Expand Up @@ -61,13 +62,24 @@ public function getNodeTypes() : array
*/
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
{
// $changedNode = null;
// $previousNode = $node;
$changedNode = null;
$previousNode = $node;
if ($node instanceof \PhpParser\Node\Expr\AssignOp) {
return $this->processAssignOp($node);
$changedNode = $this->processAssignOp($node);
}
// -, +
return $this->processBinaryOp($node);
if ($node instanceof \PhpParser\Node\Expr\BinaryOp) {
$changedNode = $this->processBinaryOp($node);
}
// recurse nested combinations
while ($changedNode !== null && !$this->nodeComparator->areNodesEqual($previousNode, $changedNode)) {
$previousNode = $changedNode;
// nothing more to change, return last node
if (!$changedNode instanceof \PhpParser\Node) {
return $previousNode;
}
}
return $changedNode;
}
private function processAssignOp(\PhpParser\Node $node) : ?\PhpParser\Node\Expr
{
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '00fb10f8a50491ab39eabf924d3da805860fb1a2';
public const PACKAGE_VERSION = '5145487e37a5ed2b83296caf534a1fb9f10e6f69';
/**
* @var string
*/
public const RELEASE_DATE = '2021-08-02 17:52:34';
public const RELEASE_DATE = '2021-08-02 17:50:38';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210802\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit3ba205858d4eaa477d41c7d509ef8507::getLoader();
return ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit3ba205858d4eaa477d41c7d509ef8507
class ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143
{
private static $loader;

Expand All @@ -22,15 +22,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit3ba205858d4eaa477d41c7d509ef8507', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit3ba205858d4eaa477d41c7d509ef8507', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', '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\ComposerStaticInit3ba205858d4eaa477d41c7d509ef8507::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
Expand All @@ -42,19 +42,19 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit3ba205858d4eaa477d41c7d509ef8507::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire3ba205858d4eaa477d41c7d509ef8507($fileIdentifier, $file);
composerRequireefdcc4d5a886384f0eaef8357453d143($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequire3ba205858d4eaa477d41c7d509ef8507($fileIdentifier, $file)
function composerRequireefdcc4d5a886384f0eaef8357453d143($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit3ba205858d4eaa477d41c7d509ef8507
class ComposerStaticInitefdcc4d5a886384f0eaef8357453d143
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
Expand Down Expand Up @@ -3847,9 +3847,9 @@ class ComposerStaticInit3ba205858d4eaa477d41c7d509ef8507
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit3ba205858d4eaa477d41c7d509ef8507::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit3ba205858d4eaa477d41c7d509ef8507::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit3ba205858d4eaa477d41c7d509ef8507::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::$classMap;

}, null, ClassLoader::class);
}
Expand Down
10 changes: 5 additions & 5 deletions vendor/scoper-autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20210802\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit3ba205858d4eaa477d41c7d509ef8507', false) && !interface_exists('ComposerAutoloaderInit3ba205858d4eaa477d41c7d509ef8507', false) && !trait_exists('ComposerAutoloaderInit3ba205858d4eaa477d41c7d509ef8507', false)) {
spl_autoload_call('RectorPrefix20210802\ComposerAutoloaderInit3ba205858d4eaa477d41c7d509ef8507');
if (!class_exists('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', false) && !interface_exists('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', false) && !trait_exists('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', false)) {
spl_autoload_call('RectorPrefix20210802\ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143');
}
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
spl_autoload_call('RectorPrefix20210802\Doctrine\Inflector\Inflector');
Expand Down Expand Up @@ -3308,9 +3308,9 @@ function print_node() {
return \RectorPrefix20210802\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire3ba205858d4eaa477d41c7d509ef8507')) {
function composerRequire3ba205858d4eaa477d41c7d509ef8507() {
return \RectorPrefix20210802\composerRequire3ba205858d4eaa477d41c7d509ef8507(...func_get_args());
if (!function_exists('composerRequireefdcc4d5a886384f0eaef8357453d143')) {
function composerRequireefdcc4d5a886384f0eaef8357453d143() {
return \RectorPrefix20210802\composerRequireefdcc4d5a886384f0eaef8357453d143(...func_get_args());
}
}
if (!function_exists('parseArgs')) {
Expand Down

0 comments on commit 0f5395c

Please sign in to comment.