Updated Rector to commit 8615aa59fb9e0f650e529f8e08e02b8b3a7dd0ac

8615aa59fb [DeadCode] Handle crash on RemoveUnusedPrivatePropertyRector+RemoveJustPropertyFetchForAssignRector (#2943)
This commit is contained in:
Tomas Votruba 2022-09-21 06:37:36 +00:00
parent 1fbb663af8
commit 5f9e3588ab
7 changed files with 20 additions and 20 deletions

View File

@ -17,7 +17,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class FloatvalToTypeCastRector extends AbstractRector
{
/**
* @var array<int, string>
* @var string[]
*/
private const VAL_FUNCTION_NAMES = ['floatval', 'doubleval'];
public function getRuleDefinition() : RuleDefinition
@ -69,8 +69,8 @@ CODE_SAMPLE
if (!$node->args[0] instanceof Arg) {
return null;
}
$castNode = new Double($node->args[0]->value);
$castNode->setAttribute(AttributeKey::KIND, Double::KIND_FLOAT);
return $castNode;
$double = new Double($node->args[0]->value);
$double->setAttribute(AttributeKey::KIND, Double::KIND_FLOAT);
return $double;
}
}

View File

@ -91,11 +91,10 @@ final class ChangedNodeScopeRefresher
$attributeGroup = new AttributeGroup([$node]);
$node = new Property(0, [], [], null, [$attributeGroup]);
}
$this->reIndexNodeAttributes($node);
$stmts = $this->resolveStmts($node);
$this->phpStanNodeScopeResolver->processNodes($stmts, $filePath, $mutatingScope);
}
private function reIndexNodeAttributes(Node $node) : void
public function reIndexNodeAttributes(Node $node) : void
{
if (($node instanceof ClassLike || $node instanceof StmtsAwareInterface) && $node->stmts !== null) {
$node->stmts = \array_values($node->stmts);

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '05dc89279c87e074f6a974ab5a973a36c8262723';
public const PACKAGE_VERSION = '8615aa59fb9e0f650e529f8e08e02b8b3a7dd0ac';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-09-20 15:28:36';
public const RELEASE_DATE = '2022-09-21 08:31:53';
/**
* @var int
*/

View File

@ -209,6 +209,7 @@ CODE_SAMPLE;
// for PHP doc info factory and change notifier
$this->currentNodeProvider->setNode($node);
$this->printDebugCurrentFileAndRule();
$this->changedNodeScopeRefresher->reIndexNodeAttributes($node);
$refactoredNode = $this->refactor($node);
// nothing to change → continue
if ($refactoredNode === null) {

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit70d98016e613e94e6a2b16f79f741f22
class ComposerAutoloaderInitc0de6081749310d75250e0461f30fec3
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit70d98016e613e94e6a2b16f79f741f22
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit70d98016e613e94e6a2b16f79f741f22', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitc0de6081749310d75250e0461f30fec3', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit70d98016e613e94e6a2b16f79f741f22', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc0de6081749310d75250e0461f30fec3', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit70d98016e613e94e6a2b16f79f741f22::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitc0de6081749310d75250e0461f30fec3::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit70d98016e613e94e6a2b16f79f741f22::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInitc0de6081749310d75250e0461f30fec3::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire70d98016e613e94e6a2b16f79f741f22($fileIdentifier, $file);
composerRequirec0de6081749310d75250e0461f30fec3($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit70d98016e613e94e6a2b16f79f741f22
* @param string $file
* @return void
*/
function composerRequire70d98016e613e94e6a2b16f79f741f22($fileIdentifier, $file)
function composerRequirec0de6081749310d75250e0461f30fec3($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 ComposerStaticInit70d98016e613e94e6a2b16f79f741f22
class ComposerStaticInitc0de6081749310d75250e0461f30fec3
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3106,9 +3106,9 @@ class ComposerStaticInit70d98016e613e94e6a2b16f79f741f22
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit70d98016e613e94e6a2b16f79f741f22::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit70d98016e613e94e6a2b16f79f741f22::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit70d98016e613e94e6a2b16f79f741f22::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitc0de6081749310d75250e0461f30fec3::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc0de6081749310d75250e0461f30fec3::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc0de6081749310d75250e0461f30fec3::$classMap;
}, null, ClassLoader::class);
}