mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-22 00:12:29 +02:00
Updated Rector to commit 4b05faa06d30e8d3f47fb3c3b37dad8548ae5230
4b05faa06d
[Php55][NodeTypeResolver] Handle crash on dynamic variable concat assign on StringClassNameToClassConstantRector (#4283)
This commit is contained in:
parent
4d62037b71
commit
30d2bb9a83
@ -11,10 +11,9 @@ use PhpParser\Node\Name\FullyQualified;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use PhpParser\Node\Stmt\ClassConst;
|
||||
use PhpParser\NodeTraverser;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Reflection\ReflectionProvider;
|
||||
use Rector\Core\Contract\Rector\AllowEmptyConfigurableRectorInterface;
|
||||
use Rector\Core\Rector\AbstractScopeAwareRector;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
@ -25,7 +24,7 @@ use RectorPrefix202306\Webmozart\Assert\Assert;
|
||||
*
|
||||
* @see \Rector\Tests\Php55\Rector\String_\StringClassNameToClassConstantRector\StringClassNameToClassConstantRectorTest
|
||||
*/
|
||||
final class StringClassNameToClassConstantRector extends AbstractScopeAwareRector implements AllowEmptyConfigurableRectorInterface, MinPhpVersionInterface
|
||||
final class StringClassNameToClassConstantRector extends AbstractRector implements AllowEmptyConfigurableRectorInterface, MinPhpVersionInterface
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
@ -85,7 +84,7 @@ CODE_SAMPLE
|
||||
* @param String_|FuncCall|ClassConst $node
|
||||
* @return \PhpParser\Node\Expr\BinaryOp\Concat|\PhpParser\Node\Expr\ClassConstFetch|null|int
|
||||
*/
|
||||
public function refactorWithScope(Node $node, Scope $scope)
|
||||
public function refactor(Node $node)
|
||||
{
|
||||
// allow class strings to be part of class const arrays, as probably on purpose
|
||||
if ($node instanceof ClassConst) {
|
||||
@ -117,7 +116,7 @@ CODE_SAMPLE
|
||||
return null;
|
||||
}
|
||||
$fullyQualified = new FullyQualified($classLikeName);
|
||||
$fullyQualifiedOrAliasName = new FullyQualified($scope->resolveName($fullyQualified));
|
||||
$fullyQualifiedOrAliasName = new FullyQualified($fullyQualified);
|
||||
if ($classLikeName !== $node->value) {
|
||||
$preSlashCount = \strlen($node->value) - \strlen($classLikeName);
|
||||
$preSlash = \str_repeat('\\', $preSlashCount);
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '0893df020e01529a72933efee0c085752e24c4d2';
|
||||
public const PACKAGE_VERSION = '4b05faa06d30e8d3f47fb3c3b37dad8548ae5230';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-19 10:56:51';
|
||||
public const RELEASE_DATE = '2023-06-19 14:13:13';
|
||||
/**
|
||||
* @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 ComposerAutoloaderInit1f6b04f7257aa3a6696abf04b600f7a5::getLoader();
|
||||
return ComposerAutoloaderInit518d55c851bd13c63ac6bb97331b72a2::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 ComposerAutoloaderInit1f6b04f7257aa3a6696abf04b600f7a5
|
||||
class ComposerAutoloaderInit518d55c851bd13c63ac6bb97331b72a2
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit1f6b04f7257aa3a6696abf04b600f7a5
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit1f6b04f7257aa3a6696abf04b600f7a5', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit518d55c851bd13c63ac6bb97331b72a2', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit1f6b04f7257aa3a6696abf04b600f7a5', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit518d55c851bd13c63ac6bb97331b72a2', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit1f6b04f7257aa3a6696abf04b600f7a5::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit518d55c851bd13c63ac6bb97331b72a2::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit1f6b04f7257aa3a6696abf04b600f7a5::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit518d55c851bd13c63ac6bb97331b72a2::$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 ComposerStaticInit1f6b04f7257aa3a6696abf04b600f7a5
|
||||
class ComposerStaticInit518d55c851bd13c63ac6bb97331b72a2
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3095,9 +3095,9 @@ class ComposerStaticInit1f6b04f7257aa3a6696abf04b600f7a5
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit1f6b04f7257aa3a6696abf04b600f7a5::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit1f6b04f7257aa3a6696abf04b600f7a5::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit1f6b04f7257aa3a6696abf04b600f7a5::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit518d55c851bd13c63ac6bb97331b72a2::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit518d55c851bd13c63ac6bb97331b72a2::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit518d55c851bd13c63ac6bb97331b72a2::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user