mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 20:00:50 +00:00
Updated Rector to commit 295c489f26f3509e9980ea0529137e710e7227e3
295c489f26
Update PHP-Parser to ^4.15.2 (#3057)
This commit is contained in:
parent
4464342ec0
commit
142e95d9c7
|
@ -17,12 +17,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '03f627b38589a03c59108e71d66fb3c04bf0dacf';
|
||||
public const PACKAGE_VERSION = '295c489f26f3509e9980ea0529137e710e7227e3';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-11-12 11:16:42';
|
||||
public const RELEASE_DATE = '2022-11-12 18:38:34';
|
||||
/**
|
||||
* @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 ComposerAutoloaderInit773885751bf01075e19ae7f2bd4a528c::getLoader();
|
||||
return ComposerAutoloaderInitc239a6d738cc58b2aafc9bdbeb2b42f5::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 ComposerAutoloaderInit773885751bf01075e19ae7f2bd4a528c
|
||||
class ComposerAutoloaderInitc239a6d738cc58b2aafc9bdbeb2b42f5
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,19 +22,19 @@ class ComposerAutoloaderInit773885751bf01075e19ae7f2bd4a528c
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit773885751bf01075e19ae7f2bd4a528c', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc239a6d738cc58b2aafc9bdbeb2b42f5', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit773885751bf01075e19ae7f2bd4a528c', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc239a6d738cc58b2aafc9bdbeb2b42f5', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit773885751bf01075e19ae7f2bd4a528c::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc239a6d738cc58b2aafc9bdbeb2b42f5::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit773885751bf01075e19ae7f2bd4a528c::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitc239a6d738cc58b2aafc9bdbeb2b42f5::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire773885751bf01075e19ae7f2bd4a528c($fileIdentifier, $file);
|
||||
composerRequirec239a6d738cc58b2aafc9bdbeb2b42f5($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
@ -46,7 +46,7 @@ class ComposerAutoloaderInit773885751bf01075e19ae7f2bd4a528c
|
|||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire773885751bf01075e19ae7f2bd4a528c($fileIdentifier, $file)
|
||||
function composerRequirec239a6d738cc58b2aafc9bdbeb2b42f5($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 ComposerStaticInit773885751bf01075e19ae7f2bd4a528c
|
||||
class ComposerStaticInitc239a6d738cc58b2aafc9bdbeb2b42f5
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
|
@ -3053,9 +3053,9 @@ class ComposerStaticInit773885751bf01075e19ae7f2bd4a528c
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit773885751bf01075e19ae7f2bd4a528c::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit773885751bf01075e19ae7f2bd4a528c::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit773885751bf01075e19ae7f2bd4a528c::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc239a6d738cc58b2aafc9bdbeb2b42f5::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc239a6d738cc58b2aafc9bdbeb2b42f5::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitc239a6d738cc58b2aafc9bdbeb2b42f5::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
14
vendor/composer/installed.json
vendored
14
vendor/composer/installed.json
vendored
|
@ -528,17 +528,17 @@
|
|||
},
|
||||
{
|
||||
"name": "nikic\/php-parser",
|
||||
"version": "v4.15.1",
|
||||
"version_normalized": "4.15.1.0",
|
||||
"version": "v4.15.2",
|
||||
"version_normalized": "4.15.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/nikic\/PHP-Parser.git",
|
||||
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900"
|
||||
"reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/nikic\/PHP-Parser\/zipball\/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
|
||||
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
|
||||
"url": "https:\/\/api.github.com\/repos\/nikic\/PHP-Parser\/zipball\/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
|
||||
"reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -549,7 +549,7 @@
|
|||
"ircmaxell\/php-yacc": "^0.0.7",
|
||||
"phpunit\/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"time": "2022-09-04T07:30:47+00:00",
|
||||
"time": "2022-11-12T15:38:23+00:00",
|
||||
"bin": [
|
||||
"bin\/php-parse"
|
||||
],
|
||||
|
@ -598,7 +598,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/nikic\/PHP-Parser\/issues",
|
||||
"source": "https:\/\/github.com\/nikic\/PHP-Parser\/tree\/v4.15.1"
|
||||
"source": "https:\/\/github.com\/nikic\/PHP-Parser\/tree\/v4.15.2"
|
||||
},
|
||||
"install-path": "..\/nikic\/php-parser"
|
||||
},
|
||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
|
@ -193,6 +193,10 @@ class TokenStream
|
|||
{
|
||||
return $this->haveTokenInRange($startPos, $endPos, '{') || $this->haveTokenInRange($startPos, $endPos, \T_CURLY_OPEN) || $this->haveTokenInRange($startPos, $endPos, '}');
|
||||
}
|
||||
public function haveTagInRange(int $startPos, int $endPos) : bool
|
||||
{
|
||||
return $this->haveTokenInRange($startPos, $endPos, \T_OPEN_TAG) || $this->haveTokenInRange($startPos, $endPos, \T_CLOSE_TAG);
|
||||
}
|
||||
/**
|
||||
* Get indentation before token position.
|
||||
*
|
||||
|
|
|
@ -44,12 +44,7 @@ class DNumber extends Scalar
|
|||
public static function parse(string $str) : float
|
||||
{
|
||||
$str = \str_replace('_', '', $str);
|
||||
// if string contains any of .eE just cast it to float
|
||||
if (\false !== \strpbrk($str, '.eE')) {
|
||||
return (float) $str;
|
||||
}
|
||||
// otherwise it's an integer notation that overflowed into a float
|
||||
// if it starts with 0 it's one of the special integer notations
|
||||
// Check whether this is one of the special integer notations.
|
||||
if ('0' === $str[0]) {
|
||||
// hex
|
||||
if ('x' === $str[1] || 'X' === $str[1]) {
|
||||
|
@ -59,10 +54,12 @@ class DNumber extends Scalar
|
|||
if ('b' === $str[1] || 'B' === $str[1]) {
|
||||
return \bindec($str);
|
||||
}
|
||||
// oct
|
||||
// substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit (8 or 9)
|
||||
// so that only the digits before that are used
|
||||
return \octdec(\substr($str, 0, \strcspn($str, '89')));
|
||||
// oct, but only if the string does not contain any of '.eE'.
|
||||
if (\false === \strpbrk($str, '.eE')) {
|
||||
// substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit
|
||||
// (8 or 9) so that only the digits before that are used.
|
||||
return \octdec(\substr($str, 0, \strcspn($str, '89')));
|
||||
}
|
||||
}
|
||||
// dec
|
||||
return (float) $str;
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace PhpParser\Node;
|
|||
|
||||
class UnionType extends \PhpParser\Node\ComplexType
|
||||
{
|
||||
/** @var (Identifier|Name)[] Types */
|
||||
/** @var (Identifier|Name|IntersectionType)[] Types */
|
||||
public $types;
|
||||
/**
|
||||
* Constructs a union type.
|
||||
|
|
|
@ -700,7 +700,7 @@ abstract class PrettyPrinterAbstract
|
|||
$commentStartPos = $itemStartPos;
|
||||
}
|
||||
if ($skipRemovedNode) {
|
||||
if ($isStmtList && $this->origTokens->haveBracesInRange($pos, $itemStartPos)) {
|
||||
if ($isStmtList && ($this->origTokens->haveBracesInRange($pos, $itemStartPos) || $this->origTokens->haveTagInRange($pos, $itemStartPos))) {
|
||||
// We'd remove the brace of a code block.
|
||||
// TODO: Preserve formatting.
|
||||
$this->setIndentLevel($origIndentLevel);
|
||||
|
@ -784,7 +784,7 @@ abstract class PrettyPrinterAbstract
|
|||
$result .= $this->origTokens->getTokenCode($pos, $itemStartPos, $indentAdjustment);
|
||||
$skipRemovedNode = \true;
|
||||
} else {
|
||||
if ($isStmtList && $this->origTokens->haveBracesInRange($pos, $itemStartPos)) {
|
||||
if ($isStmtList && ($this->origTokens->haveBracesInRange($pos, $itemStartPos) || $this->origTokens->haveTagInRange($pos, $itemStartPos))) {
|
||||
// We'd remove the brace of a code block.
|
||||
// TODO: Preserve formatting.
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user