Updated Rector to commit bf9d5ab5056bb08317308707c035a45b5b658ea7

bf9d5ab505 Update to phpdoc-parser 1.5.2 (#3205)
This commit is contained in:
Tomas Votruba 2022-12-16 10:54:11 +00:00
parent 6544cfc63c
commit addbe36147
9 changed files with 43 additions and 35 deletions

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'dec1dddede5713915f90b41f932ebbaaf0996a5a';
public const PACKAGE_VERSION = 'bf9d5ab5056bb08317308707c035a45b5b658ea7';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-12-16 07:37:34';
public const RELEASE_DATE = '2022-12-16 10:48:53';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

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

View File

@ -685,17 +685,17 @@
},
{
"name": "phpstan\/phpdoc-parser",
"version": "1.15.0",
"version_normalized": "1.15.0.0",
"version": "1.15.2",
"version_normalized": "1.15.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpdoc-parser.git",
"reference": "6ff970a7101acfe99b3048e4bbfbc094e55c5b04"
"reference": "5941477f100993652218928039d530b75a13a9ca"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/6ff970a7101acfe99b3048e4bbfbc094e55c5b04",
"reference": "6ff970a7101acfe99b3048e4bbfbc094e55c5b04",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/5941477f100993652218928039d530b75a13a9ca",
"reference": "5941477f100993652218928039d530b75a13a9ca",
"shasum": ""
},
"require": {
@ -710,7 +710,7 @@
"phpunit\/phpunit": "^9.5",
"symfony\/process": "^5.2"
},
"time": "2022-12-07T16:12:39+00:00",
"time": "2022-12-16T06:42:48+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -727,7 +727,7 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpdoc-parser\/issues",
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.15.0"
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.15.2"
},
"install-path": "..\/phpstan\/phpdoc-parser"
},

File diff suppressed because one or more lines are too long

View File

@ -10,12 +10,19 @@ class ArrayShapeNode implements \PHPStan\PhpDocParser\Ast\Type\TypeNode
use NodeAttributes;
/** @var ArrayShapeItemNode[] */
public $items;
public function __construct(array $items)
/** @var bool */
public $sealed;
public function __construct(array $items, bool $sealed = \true)
{
$this->items = $items;
$this->sealed = $sealed;
}
public function __toString() : string
{
return 'array{' . implode(', ', $this->items) . '}';
$items = $this->items;
if (!$this->sealed) {
$items[] = '...';
}
return 'array{' . implode(', ', $items) . '}';
}
}

View File

@ -5,6 +5,7 @@ namespace PHPStan\PhpDocParser\Ast\Type;
use PHPStan\PhpDocParser\Ast\Node;
use PHPStan\PhpDocParser\Ast\NodeAttributes;
use function trim;
class CallableTypeParameterNode implements Node
{
use NodeAttributes;
@ -32,6 +33,6 @@ class CallableTypeParameterNode implements Node
$isReference = $this->isReference ? '&' : '';
$isVariadic = $this->isVariadic ? '...' : '';
$default = $this->isOptional ? ' = default' : '';
return "{$type}{$isReference}{$isVariadic}{$this->parameterName}{$default}";
return trim("{$type}{$isReference}{$isVariadic}{$this->parameterName}") . $default;
}
}

View File

@ -375,24 +375,24 @@ class TypeParser
private function parseArrayShape(\PHPStan\PhpDocParser\Parser\TokenIterator $tokens, Ast\Type\TypeNode $type) : Ast\Type\ArrayShapeNode
{
$tokens->consumeTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET);
if ($tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET)) {
return new Ast\Type\ArrayShapeNode([]);
}
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
$items = [$this->parseArrayShapeItem($tokens)];
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) {
$items = [];
$sealed = \true;
do {
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
if ($tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET)) {
// trailing comma case
return new Ast\Type\ArrayShapeNode($items);
}
if ($tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC)) {
$sealed = \false;
$tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA);
break;
}
$items[] = $this->parseArrayShapeItem($tokens);
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
}
} while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA));
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET);
return new Ast\Type\ArrayShapeNode($items);
return new Ast\Type\ArrayShapeNode($items, $sealed);
}
/** @phpstan-impure */
private function parseArrayShapeItem(\PHPStan\PhpDocParser\Parser\TokenIterator $tokens) : Ast\Type\ArrayShapeItemNode