mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-19 06:52:51 +02:00
Updated Rector to commit ffa12215cf407e7d7ebb8b5bcb6a3ea794981b1e
ffa12215cf
[Php80] Validate ArrayItem on CurlyListNodeAnnotationToAttributeMapper (#2814)
This commit is contained in:
parent
1df416e942
commit
1bae738926
@ -11,6 +11,7 @@ use Rector\PhpAttribute\AnnotationToAttributeMapper;
|
||||
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
|
||||
use Rector\PhpAttribute\Enum\DocTagNodeState;
|
||||
use RectorPrefix202208\Symfony\Contracts\Service\Attribute\Required;
|
||||
use RectorPrefix202208\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @implements AnnotationToAttributeMapperInterface<CurlyListNode>
|
||||
*/
|
||||
@ -49,14 +50,19 @@ final class CurlyListNodeAnnotationToAttributeMapper implements AnnotationToAttr
|
||||
if ($valueExpr === DocTagNodeState::REMOVE_ARRAY) {
|
||||
continue;
|
||||
}
|
||||
++$loop;
|
||||
$keyExpr = $loop !== $arrayItemNode->key && \is_numeric($arrayItemNode->key) ? new LNumber((int) $arrayItemNode->key) : null;
|
||||
if ($valueExpr instanceof ArrayItem && $keyExpr instanceof LNumber) {
|
||||
$valueExpr->key = $keyExpr;
|
||||
Assert::isInstanceOf($valueExpr, ArrayItem::class);
|
||||
if (!\is_numeric($arrayItemNode->key)) {
|
||||
$arrayItems[] = $valueExpr;
|
||||
} else {
|
||||
$arrayItems[] = new ArrayItem($valueExpr, $keyExpr);
|
||||
continue;
|
||||
}
|
||||
++$loop;
|
||||
$arrayItemNodeKey = (int) $arrayItemNode->key;
|
||||
if ($loop === $arrayItemNodeKey) {
|
||||
$arrayItems[] = $valueExpr;
|
||||
continue;
|
||||
}
|
||||
$valueExpr->key = new LNumber($arrayItemNodeKey);
|
||||
$arrayItems[] = $valueExpr;
|
||||
}
|
||||
return new Array_($arrayItems);
|
||||
}
|
||||
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '837f71e7e8893c4d67d52f2f23bd85cd956a25f4';
|
||||
public const PACKAGE_VERSION = 'ffa12215cf407e7d7ebb8b5bcb6a3ea794981b1e';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-08-21 10:32:18';
|
||||
public const RELEASE_DATE = '2022-08-21 16:25:13';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit9dd5e377c0f72e50a4a41a2b7879a999::getLoader();
|
||||
return ComposerAutoloaderInite84a0bfb7da4eb05ab86badc40a8e370::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit9dd5e377c0f72e50a4a41a2b7879a999
|
||||
class ComposerAutoloaderInite84a0bfb7da4eb05ab86badc40a8e370
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInit9dd5e377c0f72e50a4a41a2b7879a999
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit9dd5e377c0f72e50a4a41a2b7879a999', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInite84a0bfb7da4eb05ab86badc40a8e370', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit9dd5e377c0f72e50a4a41a2b7879a999', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInite84a0bfb7da4eb05ab86badc40a8e370', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit9dd5e377c0f72e50a4a41a2b7879a999::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInite84a0bfb7da4eb05ab86badc40a8e370::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit9dd5e377c0f72e50a4a41a2b7879a999::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInite84a0bfb7da4eb05ab86badc40a8e370::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire9dd5e377c0f72e50a4a41a2b7879a999($fileIdentifier, $file);
|
||||
composerRequiree84a0bfb7da4eb05ab86badc40a8e370($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInit9dd5e377c0f72e50a4a41a2b7879a999
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire9dd5e377c0f72e50a4a41a2b7879a999($fileIdentifier, $file)
|
||||
function composerRequiree84a0bfb7da4eb05ab86badc40a8e370($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 ComposerStaticInit9dd5e377c0f72e50a4a41a2b7879a999
|
||||
class ComposerStaticInite84a0bfb7da4eb05ab86badc40a8e370
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
@ -3256,9 +3256,9 @@ class ComposerStaticInit9dd5e377c0f72e50a4a41a2b7879a999
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit9dd5e377c0f72e50a4a41a2b7879a999::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit9dd5e377c0f72e50a4a41a2b7879a999::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit9dd5e377c0f72e50a4a41a2b7879a999::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInite84a0bfb7da4eb05ab86badc40a8e370::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInite84a0bfb7da4eb05ab86badc40a8e370::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInite84a0bfb7da4eb05ab86badc40a8e370::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user