Updated Rector to commit 25accb21425957d4da0db801465570e4c62014ff

25accb2142 [EarlyReturn] Skip ReturnEarlyIfVariableRector with @var doc (#2616)
This commit is contained in:
Tomas Votruba 2022-07-03 11:23:14 +00:00
parent 8c06162529
commit 7a4cfee22c
5 changed files with 19 additions and 14 deletions

View File

@ -11,6 +11,7 @@ use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\If_;
use PhpParser\Node\Stmt\Return_;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface;
use Rector\Core\NodeAnalyzer\VariableAnalyzer;
use Rector\Core\Rector\AbstractRector;
@ -107,6 +108,10 @@ CODE_SAMPLE
if (!$onlyIfStmt->expr instanceof Assign) {
return null;
}
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($onlyIfStmt);
if ($phpDocInfo->getVarTagValueNode() instanceof VarTagValueNode) {
return null;
}
$assign = $onlyIfStmt->expr;
// assign to same variable that is returned
if (!$assign->var instanceof Variable) {

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'f608461e44c6a4008a2bff6c603ba9d52d3ffacf';
public const PACKAGE_VERSION = '25accb21425957d4da0db801465570e4c62014ff';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-03 09:59:36';
public const RELEASE_DATE = '2022-07-03 13:16:49';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872
class ComposerAutoloaderInite20b2e720a7a5d1cf900b8b5689d6b8c
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInite20b2e720a7a5d1cf900b8b5689d6b8c', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInite20b2e720a7a5d1cf900b8b5689d6b8c', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInite20b2e720a7a5d1cf900b8b5689d6b8c::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInite20b2e720a7a5d1cf900b8b5689d6b8c::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire39c1e46a51a1dbf4e2612d6c7327c872($fileIdentifier, $file);
composerRequiree20b2e720a7a5d1cf900b8b5689d6b8c($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872
* @param string $file
* @return void
*/
function composerRequire39c1e46a51a1dbf4e2612d6c7327c872($fileIdentifier, $file)
function composerRequiree20b2e720a7a5d1cf900b8b5689d6b8c($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 ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872
class ComposerStaticInite20b2e720a7a5d1cf900b8b5689d6b8c
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3414,9 +3414,9 @@ class ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInite20b2e720a7a5d1cf900b8b5689d6b8c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite20b2e720a7a5d1cf900b8b5689d6b8c::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInite20b2e720a7a5d1cf900b8b5689d6b8c::$classMap;
}, null, ClassLoader::class);
}