mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-13 14:42:23 +00:00
Updated Rector to commit 07e9ccf00a1318a1083bda3aaa0188cf14b3c39f
07e9ccf00a
[CodeQuality][Php56] Do not add unnecessary init value on ThrowWithPreviousExceptionRector+OptionalParametersAfterRequiredRector+AddDefaultValueForUndefinedVariableRector (#3737)
This commit is contained in:
parent
2125ff71ea
commit
8d0f018bc4
|
@ -124,9 +124,14 @@ final class UndefinedVariableResolver
|
|||
$currentStmt = $this->betterNodeFinder->resolveCurrentStatement($variable);
|
||||
return $currentStmt instanceof Stmt && $currentStmt->getAttribute(AttributeKey::IS_UNREACHABLE) === \true;
|
||||
}
|
||||
private function issetOrUnsetOrEmptyParent(Node $parentNode) : bool
|
||||
private function shouldSkipWithParent(Node $parentNode) : bool
|
||||
{
|
||||
return \in_array(\get_class($parentNode), [Unset_::class, UnsetCast::class, Isset_::class, Empty_::class], \true);
|
||||
if (\in_array(\get_class($parentNode), [Unset_::class, UnsetCast::class, Isset_::class, Empty_::class], \true)) {
|
||||
return \true;
|
||||
}
|
||||
// when parent Node origNode is null, it means parent Node just reprinted, so it can't be verified
|
||||
// so skip it
|
||||
return !$parentNode->getAttribute(AttributeKey::ORIGINAL_NODE) instanceof Node;
|
||||
}
|
||||
private function isAsCoalesceLeftOrAssignOpCoalesceVar(Node $parentNode, Variable $variable) : bool
|
||||
{
|
||||
|
@ -150,7 +155,7 @@ final class UndefinedVariableResolver
|
|||
if ($this->isAssign($parentNode)) {
|
||||
return \true;
|
||||
}
|
||||
if ($this->issetOrUnsetOrEmptyParent($parentNode)) {
|
||||
if ($this->shouldSkipWithParent($parentNode)) {
|
||||
return \true;
|
||||
}
|
||||
// list() = | [$values] = defines variables as null
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '0.16.0';
|
||||
public const PACKAGE_VERSION = '07e9ccf00a1318a1083bda3aaa0188cf14b3c39f';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-05-05 10:20:56';
|
||||
public const RELEASE_DATE = '2023-05-06 13:03:39';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitfe82eac494fd5528a360db91db522024::getLoader();
|
||||
return ComposerAutoloaderInit8dd946b2a79802422af836db9441c24e::getLoader();
|
||||
|
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitfe82eac494fd5528a360db91db522024
|
||||
class ComposerAutoloaderInit8dd946b2a79802422af836db9441c24e
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInitfe82eac494fd5528a360db91db522024
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitfe82eac494fd5528a360db91db522024', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit8dd946b2a79802422af836db9441c24e', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitfe82eac494fd5528a360db91db522024', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit8dd946b2a79802422af836db9441c24e', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitfe82eac494fd5528a360db91db522024::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit8dd946b2a79802422af836db9441c24e::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitfe82eac494fd5528a360db91db522024::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit8dd946b2a79802422af836db9441c24e::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitfe82eac494fd5528a360db91db522024
|
||||
class ComposerStaticInit8dd946b2a79802422af836db9441c24e
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
|
@ -3125,9 +3125,9 @@ class ComposerStaticInitfe82eac494fd5528a360db91db522024
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitfe82eac494fd5528a360db91db522024::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitfe82eac494fd5528a360db91db522024::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitfe82eac494fd5528a360db91db522024::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit8dd946b2a79802422af836db9441c24e::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit8dd946b2a79802422af836db9441c24e::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit8dd946b2a79802422af836db9441c24e::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user