mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 13:28:18 +01:00
Updated Rector to commit 40c546e1835ebd452b0375e8529861b926e151ae
40c546e183
Update nikic/php-parser to 4.15.1 (#2903)
This commit is contained in:
parent
5a0a2376f8
commit
463e8128b4
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'd3cab63bcb44b27446a6224eb9d511f2d52e97ba';
|
||||
public const PACKAGE_VERSION = '40c546e1835ebd452b0375e8529861b926e151ae';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-09-03 11:33:55';
|
||||
public const RELEASE_DATE = '2022-09-04 11:47:33';
|
||||
/**
|
||||
* @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 ComposerAutoloaderInita41b7f71732248b99c8d96bcd349eac5::getLoader();
|
||||
return ComposerAutoloaderInitfd28d1d5ce1546a98e44734a34cec23e::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 ComposerAutoloaderInita41b7f71732248b99c8d96bcd349eac5
|
||||
class ComposerAutoloaderInitfd28d1d5ce1546a98e44734a34cec23e
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInita41b7f71732248b99c8d96bcd349eac5
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInita41b7f71732248b99c8d96bcd349eac5', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitfd28d1d5ce1546a98e44734a34cec23e', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita41b7f71732248b99c8d96bcd349eac5', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitfd28d1d5ce1546a98e44734a34cec23e', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita41b7f71732248b99c8d96bcd349eac5::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitfd28d1d5ce1546a98e44734a34cec23e::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInita41b7f71732248b99c8d96bcd349eac5::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitfd28d1d5ce1546a98e44734a34cec23e::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirea41b7f71732248b99c8d96bcd349eac5($fileIdentifier, $file);
|
||||
composerRequirefd28d1d5ce1546a98e44734a34cec23e($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInita41b7f71732248b99c8d96bcd349eac5
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequirea41b7f71732248b99c8d96bcd349eac5($fileIdentifier, $file)
|
||||
function composerRequirefd28d1d5ce1546a98e44734a34cec23e($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 ComposerStaticInita41b7f71732248b99c8d96bcd349eac5
|
||||
class ComposerStaticInitfd28d1d5ce1546a98e44734a34cec23e
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3093,9 +3093,9 @@ class ComposerStaticInita41b7f71732248b99c8d96bcd349eac5
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita41b7f71732248b99c8d96bcd349eac5::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita41b7f71732248b99c8d96bcd349eac5::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita41b7f71732248b99c8d96bcd349eac5::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitfd28d1d5ce1546a98e44734a34cec23e::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitfd28d1d5ce1546a98e44734a34cec23e::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitfd28d1d5ce1546a98e44734a34cec23e::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
44
vendor/composer/installed.json
vendored
44
vendor/composer/installed.json
vendored
@ -528,17 +528,17 @@
|
||||
},
|
||||
{
|
||||
"name": "nikic\/php-parser",
|
||||
"version": "v4.14.0",
|
||||
"version_normalized": "4.14.0.0",
|
||||
"version": "v4.15.1",
|
||||
"version_normalized": "4.15.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/nikic\/PHP-Parser.git",
|
||||
"reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1"
|
||||
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/nikic\/PHP-Parser\/zipball\/34bea19b6e03d8153165d8f30bba4c3be86184c1",
|
||||
"reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1",
|
||||
"url": "https:\/\/api.github.com\/repos\/nikic\/PHP-Parser\/zipball\/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
|
||||
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -549,7 +549,7 @@
|
||||
"ircmaxell\/php-yacc": "^0.0.7",
|
||||
"phpunit\/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"time": "2022-05-31T20:59:12+00:00",
|
||||
"time": "2022-09-04T07:30:47+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.14.0"
|
||||
"source": "https:\/\/github.com\/nikic\/PHP-Parser\/tree\/v4.15.1"
|
||||
},
|
||||
"install-path": "..\/nikic\/php-parser"
|
||||
},
|
||||
@ -733,17 +733,17 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan\/phpstan",
|
||||
"version": "1.8.3",
|
||||
"version_normalized": "1.8.3.0",
|
||||
"version": "1.8.4",
|
||||
"version_normalized": "1.8.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
|
||||
"reference": "5583623b61caafebd62bc78a99533aa9d769d097"
|
||||
"reference": "eed4c9da531f6ebb4787235b6fb486e2c20f34e5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/5583623b61caafebd62bc78a99533aa9d769d097",
|
||||
"reference": "5583623b61caafebd62bc78a99533aa9d769d097",
|
||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/eed4c9da531f6ebb4787235b6fb486e2c20f34e5",
|
||||
"reference": "eed4c9da531f6ebb4787235b6fb486e2c20f34e5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -752,7 +752,7 @@
|
||||
"conflict": {
|
||||
"phpstan\/phpstan-shim": "*"
|
||||
},
|
||||
"time": "2022-09-01T15:27:34+00:00",
|
||||
"time": "2022-09-03T13:08:04+00:00",
|
||||
"bin": [
|
||||
"phpstan",
|
||||
"phpstan.phar"
|
||||
@ -775,7 +775,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/phpstan\/phpstan\/issues",
|
||||
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.8.3"
|
||||
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.8.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1853,12 +1853,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
|
||||
"reference": "23593a293bb05215e354a8544fd49cac5c223aac"
|
||||
"reference": "79161afe06da6608b2776b82bf2c82cbf9c50924"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/23593a293bb05215e354a8544fd49cac5c223aac",
|
||||
"reference": "23593a293bb05215e354a8544fd49cac5c223aac",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/79161afe06da6608b2776b82bf2c82cbf9c50924",
|
||||
"reference": "79161afe06da6608b2776b82bf2c82cbf9c50924",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1884,7 +1884,7 @@
|
||||
"symplify\/rule-doc-generator": "^11.1",
|
||||
"symplify\/vendor-patches": "^11.1"
|
||||
},
|
||||
"time": "2022-09-03T07:45:16+00:00",
|
||||
"time": "2022-09-04T09:20:00+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
@ -1922,12 +1922,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
|
||||
"reference": "b4b49bf4643751b7dba703fa2f57406082308e64"
|
||||
"reference": "def9fd5dc5eddc074de8e1ceda1693a7b14dfb1f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/b4b49bf4643751b7dba703fa2f57406082308e64",
|
||||
"reference": "b4b49bf4643751b7dba703fa2f57406082308e64",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/def9fd5dc5eddc074de8e1ceda1693a7b14dfb1f",
|
||||
"reference": "def9fd5dc5eddc074de8e1ceda1693a7b14dfb1f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1952,7 +1952,7 @@
|
||||
"symplify\/rule-doc-generator": "^11.1",
|
||||
"symplify\/vendor-patches": "^11.1"
|
||||
},
|
||||
"time": "2022-09-02T10:37:40+00:00",
|
||||
"time": "2022-09-04T09:42:10+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
6
vendor/nikic/php-parser/README.md
vendored
6
vendor/nikic/php-parser/README.md
vendored
@ -3,10 +3,10 @@ PHP Parser
|
||||
|
||||
[![Coverage Status](https://coveralls.io/repos/github/nikic/PHP-Parser/badge.svg?branch=master)](https://coveralls.io/github/nikic/PHP-Parser?branch=master)
|
||||
|
||||
This is a PHP 5.2 to PHP 8.1 parser written in PHP. Its purpose is to simplify static code analysis and
|
||||
This is a PHP 5.2 to PHP 8.2 parser written in PHP. Its purpose is to simplify static code analysis and
|
||||
manipulation.
|
||||
|
||||
[**Documentation for version 4.x**][doc_master] (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.1).
|
||||
[**Documentation for version 4.x**][doc_4_x] (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.2).
|
||||
|
||||
[Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2).
|
||||
|
||||
@ -222,4 +222,4 @@ Component documentation:
|
||||
* Parent and sibling references
|
||||
|
||||
[doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc
|
||||
[doc_master]: https://github.com/nikic/PHP-Parser/tree/master/doc
|
||||
[doc_4_x]: https://github.com/nikic/PHP-Parser/tree/4.x/doc
|
||||
|
42
vendor/nikic/php-parser/grammar/php7.y
vendored
42
vendor/nikic/php-parser/grammar/php7.y
vendored
@ -571,7 +571,7 @@ type_expr:
|
||||
type { $$ = $1; }
|
||||
| '?' type { $$ = Node\NullableType[$2]; }
|
||||
| union_type { $$ = Node\UnionType[$1]; }
|
||||
| intersection_type { $$ = Node\IntersectionType[$1]; }
|
||||
| intersection_type { $$ = $1; }
|
||||
;
|
||||
|
||||
type:
|
||||
@ -585,34 +585,52 @@ type_without_static:
|
||||
| T_CALLABLE { $$ = Node\Identifier['callable']; }
|
||||
;
|
||||
|
||||
union_type_element:
|
||||
type { $$ = $1; }
|
||||
| '(' intersection_type ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
union_type:
|
||||
type '|' type { init($1, $3); }
|
||||
| union_type '|' type { push($1, $3); }
|
||||
union_type_element '|' union_type_element { init($1, $3); }
|
||||
| union_type '|' union_type_element { push($1, $3); }
|
||||
;
|
||||
|
||||
union_type_without_static_element:
|
||||
type_without_static { $$ = $1; }
|
||||
| '(' intersection_type_without_static ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
union_type_without_static:
|
||||
type_without_static '|' type_without_static { init($1, $3); }
|
||||
| union_type_without_static '|' type_without_static { push($1, $3); }
|
||||
union_type_without_static_element '|' union_type_without_static_element { init($1, $3); }
|
||||
| union_type_without_static '|' union_type_without_static_element { push($1, $3); }
|
||||
;
|
||||
|
||||
intersection_type_list:
|
||||
type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type { init($1, $3); }
|
||||
| intersection_type_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type
|
||||
{ push($1, $3); }
|
||||
;
|
||||
|
||||
intersection_type:
|
||||
type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type { init($1, $3); }
|
||||
| intersection_type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type
|
||||
intersection_type_list { $$ = Node\IntersectionType[$1]; }
|
||||
;
|
||||
|
||||
intersection_type_without_static_list:
|
||||
type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static
|
||||
{ init($1, $3); }
|
||||
| intersection_type_without_static_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static
|
||||
{ push($1, $3); }
|
||||
;
|
||||
|
||||
intersection_type_without_static:
|
||||
type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static
|
||||
{ init($1, $3); }
|
||||
| intersection_type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static
|
||||
{ push($1, $3); }
|
||||
intersection_type_without_static_list { $$ = Node\IntersectionType[$1]; }
|
||||
;
|
||||
|
||||
type_expr_without_static:
|
||||
type_without_static { $$ = $1; }
|
||||
| '?' type_without_static { $$ = Node\NullableType[$2]; }
|
||||
| union_type_without_static { $$ = Node\UnionType[$1]; }
|
||||
| intersection_type_without_static { $$ = Node\IntersectionType[$1]; }
|
||||
| intersection_type_without_static { $$ = $1; }
|
||||
;
|
||||
|
||||
optional_type_without_static:
|
||||
|
@ -154,7 +154,7 @@ final class BuilderHelpers
|
||||
$nullable = \true;
|
||||
$type = \substr($type, 1);
|
||||
}
|
||||
$builtinTypes = ['array', 'callable', 'string', 'int', 'float', 'bool', 'iterable', 'void', 'object', 'mixed', 'never'];
|
||||
$builtinTypes = ['array', 'callable', 'bool', 'int', 'float', 'string', 'iterable', 'void', 'object', 'null', 'false', 'mixed', 'never', 'true'];
|
||||
$lowerType = \strtolower($type);
|
||||
if (\in_array($lowerType, $builtinTypes)) {
|
||||
$type = new Identifier($lowerType);
|
||||
|
@ -28,7 +28,7 @@ abstract class KeywordEmulator extends \PhpParser\Lexer\TokenEmulator\TokenEmula
|
||||
}
|
||||
/**
|
||||
* @param mixed[] $tokens
|
||||
* @return mixed[]|null
|
||||
* @return array|string|null
|
||||
*/
|
||||
private function getPreviousNonSpaceToken(array $tokens, int $start)
|
||||
{
|
||||
|
@ -18,4 +18,12 @@ final class ReadonlyTokenEmulator extends \PhpParser\Lexer\TokenEmulator\Keyword
|
||||
{
|
||||
return \T_READONLY;
|
||||
}
|
||||
protected function isKeywordContext(array $tokens, int $pos) : bool
|
||||
{
|
||||
if (!parent::isKeywordContext($tokens, $pos)) {
|
||||
return \false;
|
||||
}
|
||||
// Support "function readonly("
|
||||
return !(isset($tokens[$pos + 1]) && ($tokens[$pos + 1][0] === '(' || $tokens[$pos + 1][0] === \T_WHITESPACE && isset($tokens[$pos + 2]) && $tokens[$pos + 2][0] === '('));
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ class Name extends NodeAbstract
|
||||
$realLength = $numParts - $realOffset;
|
||||
} else {
|
||||
$realLength = $length < 0 ? $length + $numParts - $realOffset : $length;
|
||||
if ($realLength < 0 || $realLength > $numParts) {
|
||||
if ($realLength < 0 || $realLength > $numParts - $realOffset) {
|
||||
throw new \OutOfBoundsException(\sprintf('Length %d is out of bounds', $length));
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class ClassMethod extends Node\Stmt implements FunctionLike, StmtsAwareInterface
|
||||
public $stmts;
|
||||
/** @var Node\AttributeGroup[] PHP attribute groups */
|
||||
public $attrGroups;
|
||||
private static $magicNames = ['__construct' => \true, '__destruct' => \true, '__call' => \true, '__callstatic' => \true, '__get' => \true, '__set' => \true, '__isset' => \true, '__unset' => \true, '__sleep' => \true, '__wakeup' => \true, '__tostring' => \true, '__set_state' => \true, '__clone' => \true, '__invoke' => \true, '__debuginfo' => \true];
|
||||
private static $magicNames = ['__construct' => \true, '__destruct' => \true, '__call' => \true, '__callstatic' => \true, '__get' => \true, '__set' => \true, '__isset' => \true, '__unset' => \true, '__sleep' => \true, '__wakeup' => \true, '__tostring' => \true, '__set_state' => \true, '__clone' => \true, '__invoke' => \true, '__debuginfo' => \true, '__serialize' => \true, '__unserialize' => \true];
|
||||
/**
|
||||
* Constructs a class method node.
|
||||
*
|
||||
|
@ -10,7 +10,7 @@ class UnionType extends \PhpParser\Node\ComplexType
|
||||
/**
|
||||
* Constructs a union type.
|
||||
*
|
||||
* @param (Identifier|Name)[] $types Types
|
||||
* @param (Identifier|Name|IntersectionType)[] $types Types
|
||||
* @param array $attributes Additional attributes
|
||||
*/
|
||||
public function __construct(array $types, array $attributes = [])
|
||||
|
File diff suppressed because one or more lines are too long
@ -557,7 +557,7 @@ abstract class ParserAbstract implements \PhpParser\Parser
|
||||
}
|
||||
protected function handleBuiltinTypes(Name $name)
|
||||
{
|
||||
$builtinTypes = ['bool' => \true, 'int' => \true, 'float' => \true, 'string' => \true, 'iterable' => \true, 'void' => \true, 'object' => \true, 'null' => \true, 'false' => \true, 'mixed' => \true, 'never' => \true];
|
||||
$builtinTypes = ['bool' => \true, 'int' => \true, 'float' => \true, 'string' => \true, 'iterable' => \true, 'void' => \true, 'object' => \true, 'null' => \true, 'false' => \true, 'mixed' => \true, 'never' => \true, 'true' => \true];
|
||||
if (!$name->isUnqualified()) {
|
||||
return $name;
|
||||
}
|
||||
|
@ -38,7 +38,15 @@ class Standard extends PrettyPrinterAbstract
|
||||
}
|
||||
protected function pUnionType(Node\UnionType $node)
|
||||
{
|
||||
return $this->pImplode($node->types, '|');
|
||||
$types = [];
|
||||
foreach ($node->types as $typeNode) {
|
||||
if ($typeNode instanceof Node\IntersectionType) {
|
||||
$types[] = '(' . $this->p($typeNode) . ')';
|
||||
continue;
|
||||
}
|
||||
$types[] = $this->p($typeNode);
|
||||
}
|
||||
return \implode('|', $types);
|
||||
}
|
||||
protected function pIntersectionType(Node\IntersectionType $node)
|
||||
{
|
||||
|
@ -823,11 +823,14 @@ abstract class PrettyPrinterAbstract
|
||||
foreach ($delayedAdd as $delayedAddNode) {
|
||||
if (!$first) {
|
||||
$result .= $insertStr;
|
||||
if ($insertNewline) {
|
||||
$result .= $this->nl;
|
||||
}
|
||||
}
|
||||
$result .= $this->p($delayedAddNode, \true);
|
||||
$first = \false;
|
||||
}
|
||||
$result .= $extraRight;
|
||||
$result .= $extraRight === "\n" ? $this->nl : $extraRight;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -1206,7 +1209,7 @@ abstract class PrettyPrinterAbstract
|
||||
}
|
||||
// TODO Insertion into empty statement lists.
|
||||
// [$find, $extraLeft, $extraRight]
|
||||
$this->emptyListInsertionMap = ['Expr_ArrowFunction->params' => ['(', '', ''], 'Expr_Closure->uses' => [')', ' use(', ')'], 'Expr_Closure->params' => ['(', '', ''], 'Expr_FuncCall->args' => ['(', '', ''], 'Expr_MethodCall->args' => ['(', '', ''], 'Expr_NullsafeMethodCall->args' => ['(', '', ''], 'Expr_New->args' => ['(', '', ''], 'Expr_PrintableNewAnonClass->args' => ['(', '', ''], 'Expr_PrintableNewAnonClass->implements' => [null, ' implements ', ''], 'Expr_StaticCall->args' => ['(', '', ''], 'Stmt_Class->implements' => [null, ' implements ', ''], 'Stmt_Enum->implements' => [null, ' implements ', ''], 'Stmt_ClassMethod->params' => ['(', '', ''], 'Stmt_Interface->extends' => [null, ' extends ', ''], 'Stmt_Function->params' => ['(', '', '']];
|
||||
$this->emptyListInsertionMap = ['Expr_ArrowFunction->params' => ['(', '', ''], 'Expr_Closure->uses' => [')', ' use(', ')'], 'Expr_Closure->params' => ['(', '', ''], 'Expr_FuncCall->args' => ['(', '', ''], 'Expr_MethodCall->args' => ['(', '', ''], 'Expr_NullsafeMethodCall->args' => ['(', '', ''], 'Expr_New->args' => ['(', '', ''], 'Expr_PrintableNewAnonClass->args' => ['(', '', ''], 'Expr_PrintableNewAnonClass->implements' => [null, ' implements ', ''], 'Expr_StaticCall->args' => ['(', '', ''], 'Stmt_Class->implements' => [null, ' implements ', ''], 'Stmt_Enum->implements' => [null, ' implements ', ''], 'Stmt_ClassMethod->params' => ['(', '', ''], 'Stmt_Interface->extends' => [null, ' extends ', ''], 'Stmt_Function->params' => ['(', '', ''], 'Stmt_Interface->attrGroups' => [null, '', "\n"], 'Stmt_Class->attrGroups' => [null, '', "\n"], 'Stmt_ClassConst->attrGroups' => [null, '', "\n"], 'Stmt_ClassMethod->attrGroups' => [null, '', "\n"], 'Stmt_Function->attrGroups' => [null, '', "\n"], 'Stmt_Property->attrGroups' => [null, '', "\n"], 'Stmt_Trait->attrGroups' => [null, '', "\n"], 'Expr_ArrowFunction->attrGroups' => [null, '', ' '], 'Expr_Closure->attrGroups' => [null, '', ' '], 'Expr_PrintableNewAnonClass->attrGroups' => [\T_NEW, ' ', '']];
|
||||
}
|
||||
protected function initializeModifierChangeMap()
|
||||
{
|
||||
|
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
Binary file not shown.
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
@ -1,16 +1,16 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmMQz1kACgkQzxoQjQ56
|
||||
5yC1Vg/8D2IVVjPtejDaIb19jO/g8MfwK/utEW1q12k4yKNeLRYh44gLh72s05ib
|
||||
NhlxVcWjRF3B5i/cDF6m/rIEKX8zwHiN2zi7t6GueU/h5/wU822IMTM8MoVmSN/L
|
||||
43vtIcOJIoWu5I/IMm2hu55GORNtFcDk6r7KVkq0wqa78QcykSqjWAHTEUOwLEMy
|
||||
EE/1j2cRxfD25YpR/zlQA7WidG1UD0mARn+50pGqtZMYUKy/avkZGBA2XijM4SQn
|
||||
Bqf3XORyhxNUePP1k7KdnCg2pQDmc4u3JW/cKY4IGNlLwhwpIE2iRrj1K7uz+d7l
|
||||
71lM2fBNBNP+f21flGiYW3L+TYbaObi98qOtmAs/7OYM5lMDG1rEBCiVIkYaYjSv
|
||||
9offoxUAVOgsKQO/Lhn4dDvImeXibkX0c0jWzYnoO9hxMMJABEovmHAWTeSVzkZF
|
||||
kXQoSLQokn9MdyFtiAgNjLhkpAUyqxMkp6jsdyzsS2D7ALssVt3Ym3VWHMibqMNJ
|
||||
nzDfjrcr75lc8+vNQEEbeSnH81yPMQ3J+3UJL4rrXDsbID7croqnZ5QaRdRqWBYZ
|
||||
DmWhEg6hwUjHgzyQSMFgvH49uI0ufWBOKNYZfCkGHEK+DmJbcfd0+m78d3PaUGYa
|
||||
nysLQYtS1hlQVLBYaZuvRfGtd0HgO9V8c5uvjZKuJ5WQSuAazNA=
|
||||
=3o8/
|
||||
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmMTUacACgkQzxoQjQ56
|
||||
5yBSUBAAgtZtDPGvm8q7QhtoerfbsV4Y+7ZD0VVis9z0/DEVGKzhVBIOpfta8yS9
|
||||
AOj8tVVdMsNAsaDYS/h1wMQ+hy+1svmg0sO37/DAVpS/r62DgnKz+aPYIjHYV0H6
|
||||
75Z/ytBKifhsv3Z0qFhOu2G/JgX8/FlOnr277L4g5ipgebE00dk+jO0cYe1hDUoE
|
||||
e8W82PODglcmSNehprd5w2Gw9Ce15gjI9osIFbKh1bVbQQxRAy1GXzXrlx1ApAlE
|
||||
nZXHlZaqmA+ztnzQ7A0Un87AAxe8o+GaLRELyc+pwEumpQv2hbQfPHxAX5/OE7z+
|
||||
DvqB6ZajwIBs1KpnvKl4+OIdofaq5E3cycyhWVZ4oY5lMULDa9VM25a2CyeaWndw
|
||||
LIYvSoV4AUqex9V9p/BhTjfznpOOEHFeBcIjw6UesIlRdGDiDcMdRc+Ib/K9Rpiy
|
||||
MQOfM2vEIP9lqVqQniAPI4MV7Bo9G6zXJh1KiX5HWAII8FTKaJjzOl0S9n1ZghBq
|
||||
p+g98HbnmHQVT8yO0XdFsHh9s0HTrI53av2kOFaIti+gp81RSUNFFs36pEjuqADH
|
||||
CV1Umoyqgr3bwgB/RTO4UXEcd67tyMUlis/jgQrS5ILdpEU62X6kQcrOptAj5tZA
|
||||
bUHyPl0Gd5m//smhIMePRLPL8tajTl4MFYhDzH4vrxLigmf39pQ=
|
||||
=hQUs
|
||||
-----END PGP SIGNATURE-----
|
||||
|
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
||||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a489bf0'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 23593a2'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b4b49bf'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 2decdcf'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 294de0c'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3f58e44'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 8c0ac2e'));
|
||||
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a489bf0'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 79161af'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main def9fd5'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 2decdcf'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 294de0c'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3f58e44'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 8c0ac2e'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\BinaryOp\BitwiseOr;
|
||||
use PhpParser\Node\Expr\ConstFetch;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Scalar\LNumber;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
@ -68,7 +68,7 @@ final class JsonConstCleaner
|
||||
/**
|
||||
* @param string[] $constants
|
||||
*/
|
||||
private function cleanByConstFetch(ConstFetch $constFetch, array $constants) : ?ConstFetch
|
||||
private function cleanByConstFetch(ConstFetch $constFetch, array $constants) : ?LNumber
|
||||
{
|
||||
if (!$this->nodeNameResolver->isNames($constFetch, $constants)) {
|
||||
return null;
|
||||
@ -80,12 +80,13 @@ final class JsonConstCleaner
|
||||
if ($this->hasDefinedCheck($constFetch, $constants)) {
|
||||
return null;
|
||||
}
|
||||
return new ConstFetch(new Name('0'));
|
||||
return new LNumber(0);
|
||||
}
|
||||
/**
|
||||
* @param string[] $constants
|
||||
* @return null|\PhpParser\Node\Expr|\PhpParser\Node\Scalar\LNumber
|
||||
*/
|
||||
private function cleanByBitwiseOr(BitwiseOr $bitwiseOr, array $constants) : ?Expr
|
||||
private function cleanByBitwiseOr(BitwiseOr $bitwiseOr, array $constants)
|
||||
{
|
||||
$isLeftTransformed = $this->isTransformed($bitwiseOr->left, $constants);
|
||||
$isRightTransformed = $this->isTransformed($bitwiseOr->right, $constants);
|
||||
@ -101,7 +102,7 @@ final class JsonConstCleaner
|
||||
if (!$isRightTransformed) {
|
||||
return $bitwiseOr->right;
|
||||
}
|
||||
return new ConstFetch(new Name('0'));
|
||||
return new LNumber(0);
|
||||
}
|
||||
/**
|
||||
* @param string[] $constants
|
||||
|
Loading…
x
Reference in New Issue
Block a user