Updated Rector to commit 2d583eba1512d3b51e79503eba46466a32cb7374

2d583eba15 [cleanup] Make use of getArgs() (#3769)
This commit is contained in:
Tomas Votruba 2023-05-08 07:49:33 +00:00
parent a2c39b778e
commit 930a1a2ba2
15 changed files with 29 additions and 28 deletions

View File

@ -80,7 +80,7 @@ final class SimplifyEmptyArrayCheckRector extends AbstractRector
if (!$this->isName($node, 'is_array')) {
return \false;
}
return isset($node->args[0]);
return isset($node->getArgs()[0]);
},
// empty(...)
function (Node $node) : bool {
@ -94,7 +94,7 @@ final class SimplifyEmptyArrayCheckRector extends AbstractRector
if (!$this->isName($node->expr, 'array_filter')) {
return \false;
}
return isset($node->expr->args[0]);
return isset($node->expr->getArgs()[0]);
}
return \true;
}

View File

@ -114,14 +114,15 @@ CODE_SAMPLE
return null;
}
// exception is bundled
if (isset($new->args[$exceptionArgumentPosition])) {
if (isset($new->getArgs()[$exceptionArgumentPosition])) {
return null;
}
if (!isset($new->args[0])) {
if (!isset($new->getArgs()[0])) {
// get previous message
$new->args[0] = new Arg(new MethodCall($catchedThrowableVariable, 'getMessage'));
$getMessageMethodCall = new MethodCall($catchedThrowableVariable, 'getMessage');
$new->args[0] = new Arg($getMessageMethodCall);
}
if (!isset($new->args[1])) {
if (!isset($new->getArgs()[1])) {
// get previous code
$new->args[1] = new Arg(new MethodCall($catchedThrowableVariable, 'getCode'));
}

View File

@ -69,7 +69,7 @@ CODE_SAMPLE
return null;
}
// change the node
if (!isset($node->args[0])) {
if (!isset($node->getArgs()[0])) {
return null;
}
$firstArg = $node->args[0];

View File

@ -72,7 +72,7 @@ CODE_SAMPLE
}
private function processMysqlCreateDb(FuncCall $funcCall) : ?FuncCall
{
if (!isset($funcCall->args[0])) {
if (!isset($funcCall->getArgs()[0])) {
return null;
}
if (!$funcCall->args[0] instanceof Arg) {
@ -84,7 +84,7 @@ CODE_SAMPLE
}
private function processMysqlDropDb(FuncCall $funcCall) : ?FuncCall
{
if (!isset($funcCall->args[0])) {
if (!isset($funcCall->getArgs()[0])) {
return null;
}
if (!$funcCall->args[0] instanceof Arg) {

View File

@ -141,7 +141,7 @@ CODE_SAMPLE
if (!$ternary->cond instanceof NotIdentical) {
return \false;
}
if (!isset($funcCall->args[0])) {
if (!isset($funcCall->getArgs()[0])) {
return \false;
}
if (!$funcCall->args[0] instanceof Arg) {

View File

@ -133,7 +133,7 @@ CODE_SAMPLE
if (!$this->isName($subNode, 'key')) {
return \false;
}
return $this->nodeComparator->areNodesEqual($resetOrEndFuncCall->args[0], $subNode->args[0]);
return $this->nodeComparator->areNodesEqual($resetOrEndFuncCall->getArgs()[0], $subNode->getArgs()[0]);
});
}
private function hasPrevCallNext(StmtsAwareInterface $stmtsAware, int $nextKey, int $totalKeys, FuncCall $funcCall) : bool

View File

@ -116,7 +116,7 @@ CODE_SAMPLE
}
private function isFirstValueStringOrArray(FuncCall $funcCall) : bool
{
if (!isset($funcCall->args[0])) {
if (!isset($funcCall->getArgs()[0])) {
return \false;
}
$firstArg = $funcCall->args[0];

View File

@ -197,7 +197,7 @@ final class ResourceReturnToObject
if (!$this->nodeNameResolver->isName($funcCall, 'is_resource')) {
return \true;
}
if (!isset($funcCall->args[0])) {
if (!isset($funcCall->getArgs()[0])) {
return \true;
}
$argResource = $funcCall->args[0];

View File

@ -187,7 +187,7 @@ CODE_SAMPLE
if (!$this->nodeNameResolver->isName($funcCall, 'strlen')) {
return \false;
}
if (!isset($funcCall->args[0])) {
if (!isset($funcCall->getArgs()[0])) {
return \false;
}
if (!$funcCall->args[0] instanceof Arg) {

View File

@ -78,7 +78,7 @@ CODE_SAMPLE
if ($ternary->cond->isFirstClassCallable()) {
return \true;
}
if (!isset($ternary->cond->args[0])) {
if (!isset($ternary->cond->getArgs()[0])) {
return \true;
}
if (!$this->nodeNameResolver->isName($ternary->cond, 'is_object')) {

View File

@ -63,7 +63,7 @@ CODE_SAMPLE
if (!$this->isObjectType($node->class, $newArgToMethodCall->getObjectType())) {
continue;
}
if (!isset($node->args[0])) {
if (!isset($node->getArgs()[0])) {
return null;
}
if (!$node->args[0] instanceof Arg) {

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '13d81f90894396f7e443cb5cb9198aeacb6bc05a';
public const PACKAGE_VERSION = '2d583eba1512d3b51e79503eba46466a32cb7374';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-05-08 07:32:49';
public const RELEASE_DATE = '2023-05-08 07:45:37';
/**
* @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 ComposerAutoloaderInit861ab03aa616d1f38d85273839029a00::getLoader();
return ComposerAutoloaderInitdec46fe944854c80fe5449e7726c58e3::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit861ab03aa616d1f38d85273839029a00
class ComposerAutoloaderInitdec46fe944854c80fe5449e7726c58e3
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit861ab03aa616d1f38d85273839029a00
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit861ab03aa616d1f38d85273839029a00', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitdec46fe944854c80fe5449e7726c58e3', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit861ab03aa616d1f38d85273839029a00', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitdec46fe944854c80fe5449e7726c58e3', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit861ab03aa616d1f38d85273839029a00::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitdec46fe944854c80fe5449e7726c58e3::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit861ab03aa616d1f38d85273839029a00::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitdec46fe944854c80fe5449e7726c58e3::$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 ComposerStaticInit861ab03aa616d1f38d85273839029a00
class ComposerStaticInitdec46fe944854c80fe5449e7726c58e3
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3121,9 +3121,9 @@ class ComposerStaticInit861ab03aa616d1f38d85273839029a00
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit861ab03aa616d1f38d85273839029a00::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit861ab03aa616d1f38d85273839029a00::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit861ab03aa616d1f38d85273839029a00::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitdec46fe944854c80fe5449e7726c58e3::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitdec46fe944854c80fe5449e7726c58e3::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitdec46fe944854c80fe5449e7726c58e3::$classMap;
}, null, ClassLoader::class);
}