mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit dfef34df2f634b87afe6940cc4671018fb81e26e
dfef34df2f
Bump nikic/php-parser to 4.16.0 (#4343)
This commit is contained in:
parent
96b9046f78
commit
9d08d136fd
|
@ -180,7 +180,7 @@ final class PhpNestedAttributeGroupFactory
|
|||
$attributeArgs = $this->createAttributeArgs($nestedDoctrineAnnotationTagValueNode, $nestedAnnotationToAttribute);
|
||||
$originalIdentifier = $nestedDoctrineAnnotationTagValueNode->identifierTypeNode->name;
|
||||
$attributeName = $this->resolveAliasedAttributeName($originalIdentifier, $annotationPropertyToAttributeClass);
|
||||
if ($annotationPropertyToAttributeClass->doesNeedNewImport() && \count($attributeName->parts) === 1) {
|
||||
if ($annotationPropertyToAttributeClass->doesNeedNewImport() && \count($attributeName->getParts()) === 1) {
|
||||
$attributeName->setAttribute(AttributeKey::EXTRA_USE_IMPORT, $annotationPropertyToAttributeClass->getAttributeClass());
|
||||
}
|
||||
$attribute = new Attribute($attributeName, $attributeArgs);
|
||||
|
|
|
@ -156,10 +156,10 @@ final class NameImporter
|
|||
return \true;
|
||||
}
|
||||
if ($parentNode instanceof ConstFetch) {
|
||||
return \count($name->parts) === 1;
|
||||
return \count($name->getParts()) === 1;
|
||||
}
|
||||
if ($parentNode instanceof FuncCall) {
|
||||
return \count($name->parts) === 1;
|
||||
return \count($name->getParts()) === 1;
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ use PhpParser\Node;
|
|||
use PhpParser\Node\FunctionLike;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\Namespace_;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
|
@ -145,8 +146,7 @@ CODE_SAMPLE
|
|||
private function processName(Name $name) : Name
|
||||
{
|
||||
$nodeName = $this->getName($name);
|
||||
$name->parts = \explode('_', $nodeName);
|
||||
return $name;
|
||||
return $name instanceof FullyQualified ? new FullyQualified(\explode('_', $nodeName), $name->getAttributes()) : new Name(\explode('_', $nodeName), $name->getAttributes());
|
||||
}
|
||||
private function processIdentifier(Identifier $identifier) : ?Identifier
|
||||
{
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '8337f6fb509fffc41aaa5ab15a4e7c695a2883e1';
|
||||
public const PACKAGE_VERSION = 'dfef34df2f634b87afe6940cc4671018fb81e26e';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-25 17:03:21';
|
||||
public const RELEASE_DATE = '2023-06-25 23:14:29';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit72da8dc2b9acba4ee4139935cad99bb4::getLoader();
|
||||
return ComposerAutoloaderInita0eec1cc51d070e60c18f0bcf971a1a9::getLoader();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit72da8dc2b9acba4ee4139935cad99bb4
|
||||
class ComposerAutoloaderInita0eec1cc51d070e60c18f0bcf971a1a9
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInit72da8dc2b9acba4ee4139935cad99bb4
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit72da8dc2b9acba4ee4139935cad99bb4', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInita0eec1cc51d070e60c18f0bcf971a1a9', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit72da8dc2b9acba4ee4139935cad99bb4', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita0eec1cc51d070e60c18f0bcf971a1a9', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit72da8dc2b9acba4ee4139935cad99bb4::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita0eec1cc51d070e60c18f0bcf971a1a9::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit72da8dc2b9acba4ee4139935cad99bb4::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInita0eec1cc51d070e60c18f0bcf971a1a9::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit72da8dc2b9acba4ee4139935cad99bb4
|
||||
class ComposerStaticInita0eec1cc51d070e60c18f0bcf971a1a9
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
|
@ -3091,9 +3091,9 @@ class ComposerStaticInit72da8dc2b9acba4ee4139935cad99bb4
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit72da8dc2b9acba4ee4139935cad99bb4::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit72da8dc2b9acba4ee4139935cad99bb4::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit72da8dc2b9acba4ee4139935cad99bb4::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita0eec1cc51d070e60c18f0bcf971a1a9::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita0eec1cc51d070e60c18f0bcf971a1a9::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita0eec1cc51d070e60c18f0bcf971a1a9::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
|
@ -769,17 +769,17 @@
|
|||
},
|
||||
{
|
||||
"name": "nikic\/php-parser",
|
||||
"version": "v4.15.5",
|
||||
"version_normalized": "4.15.5.0",
|
||||
"version": "v4.16.0",
|
||||
"version_normalized": "4.16.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/nikic\/PHP-Parser.git",
|
||||
"reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e"
|
||||
"reference": "19526a33fb561ef417e822e85f08a00db4059c17"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/nikic\/PHP-Parser\/zipball\/11e2663a5bc9db5d714eedb4277ee300403b4a9e",
|
||||
"reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e",
|
||||
"url": "https:\/\/api.github.com\/repos\/nikic\/PHP-Parser\/zipball\/19526a33fb561ef417e822e85f08a00db4059c17",
|
||||
"reference": "19526a33fb561ef417e822e85f08a00db4059c17",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -790,7 +790,7 @@
|
|||
"ircmaxell\/php-yacc": "^0.0.7",
|
||||
"phpunit\/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"time": "2023-05-19T20:20:00+00:00",
|
||||
"time": "2023-06-25T14:52:30+00:00",
|
||||
"bin": [
|
||||
"bin\/php-parse"
|
||||
],
|
||||
|
@ -839,7 +839,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/nikic\/PHP-Parser\/issues",
|
||||
"source": "https:\/\/github.com\/nikic\/PHP-Parser\/tree\/v4.15.5"
|
||||
"source": "https:\/\/github.com\/nikic\/PHP-Parser\/tree\/v4.16.0"
|
||||
},
|
||||
"install-path": "..\/nikic\/php-parser"
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1008,7 +1008,7 @@ array_pair:
|
|||
| expr { $$ = Expr\ArrayItem[$1, null, false]; }
|
||||
| expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; }
|
||||
| ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; }
|
||||
| T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; }
|
||||
| T_ELLIPSIS expr { $$ = new Expr\ArrayItem($2, null, false, attributes(), true); }
|
||||
;
|
||||
|
||||
encaps_list:
|
||||
|
|
|
@ -1194,7 +1194,7 @@ array_pair:
|
|||
| expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; }
|
||||
| expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; }
|
||||
| expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; }
|
||||
| T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; }
|
||||
| T_ELLIPSIS expr { $$ = new Expr\ArrayItem($2, null, false, attributes(), true); }
|
||||
| /* empty */ { $$ = null; }
|
||||
;
|
||||
|
||||
|
|
|
@ -6,7 +6,10 @@ namespace PhpParser\Node;
|
|||
use PhpParser\NodeAbstract;
|
||||
class Name extends NodeAbstract
|
||||
{
|
||||
/** @var string[] Parts of the name */
|
||||
/**
|
||||
* @var string[] Parts of the name
|
||||
* @deprecated Use getParts() instead
|
||||
*/
|
||||
public $parts;
|
||||
private static $specialClassNames = ['self' => \true, 'parent' => \true, 'static' => \true];
|
||||
/**
|
||||
|
@ -24,6 +27,15 @@ class Name extends NodeAbstract
|
|||
{
|
||||
return ['parts'];
|
||||
}
|
||||
/**
|
||||
* Get parts of name (split by the namespace separator).
|
||||
*
|
||||
* @return string[] Parts of name
|
||||
*/
|
||||
public function getParts() : array
|
||||
{
|
||||
return $this->parts;
|
||||
}
|
||||
/**
|
||||
* Gets the first part of the name, i.e. everything before the first namespace separator.
|
||||
*
|
||||
|
|
|
@ -1278,7 +1278,7 @@ class Php5 extends \PhpParser\ParserAbstract
|
|||
}, 551 => function ($stackPos) {
|
||||
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
|
||||
}, 552 => function ($stackPos) {
|
||||
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
|
||||
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, \true);
|
||||
}, 553 => function ($stackPos) {
|
||||
$this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
|
||||
$this->semValue = $this->semStack[$stackPos - (2 - 1)];
|
||||
|
|
|
@ -1386,7 +1386,7 @@ class Php7 extends \PhpParser\ParserAbstract
|
|||
}, 591 => function ($stackPos) {
|
||||
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
|
||||
}, 592 => function ($stackPos) {
|
||||
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
|
||||
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, \true);
|
||||
}, 593 => function ($stackPos) {
|
||||
$this->semValue = null;
|
||||
}, 594 => function ($stackPos) {
|
||||
|
|
Loading…
Reference in New Issue