Updated Rector to commit 59720a1105eeec521130754510b7b1c8d4da50c1

59720a1105 Fix phpstan notice (#3653)
This commit is contained in:
Tomas Votruba 2023-04-22 15:32:02 +00:00
parent ec5e44e489
commit 4564073a8a
10 changed files with 42 additions and 21 deletions

View File

@ -85,7 +85,7 @@ final class BetterTokenIterator extends TokenIterator
return $this->privatesAccessor->getPrivateProperty($this, self::INDEX);
}
/**
* @return array<array{0: string, 1: int}>
* @return array<int, array{string, int, int}>
*/
public function getTokens() : array
{

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '61f2c4288bc6027fcdb347ace448d0936bbdcda4';
public const PACKAGE_VERSION = '59720a1105eeec521130754510b7b1c8d4da50c1';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-04-22 15:28:53';
public const RELEASE_DATE = '2023-04-22 22:27:18';
/**
* @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 ComposerAutoloaderInit0640375f0318181d90fa99ade89d1447::getLoader();
return ComposerAutoloaderInit465190ac2dda6f1974ba11849e62c34a::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit0640375f0318181d90fa99ade89d1447
class ComposerAutoloaderInit465190ac2dda6f1974ba11849e62c34a
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit0640375f0318181d90fa99ade89d1447
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit0640375f0318181d90fa99ade89d1447', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit465190ac2dda6f1974ba11849e62c34a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit0640375f0318181d90fa99ade89d1447', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit465190ac2dda6f1974ba11849e62c34a', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit0640375f0318181d90fa99ade89d1447::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit465190ac2dda6f1974ba11849e62c34a::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit0640375f0318181d90fa99ade89d1447::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit465190ac2dda6f1974ba11849e62c34a::$files;
$requireFile = \Closure::bind(static function ($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 ComposerStaticInit0640375f0318181d90fa99ade89d1447
class ComposerStaticInit465190ac2dda6f1974ba11849e62c34a
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3149,9 +3149,9 @@ class ComposerStaticInit0640375f0318181d90fa99ade89d1447
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit0640375f0318181d90fa99ade89d1447::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0640375f0318181d90fa99ade89d1447::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit0640375f0318181d90fa99ade89d1447::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit465190ac2dda6f1974ba11849e62c34a::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit465190ac2dda6f1974ba11849e62c34a::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit465190ac2dda6f1974ba11849e62c34a::$classMap;
}, null, ClassLoader::class);
}

View File

@ -821,17 +821,17 @@
},
{
"name": "phpstan\/phpdoc-parser",
"version": "1.20.0",
"version_normalized": "1.20.0.0",
"version": "1.20.1",
"version_normalized": "1.20.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpdoc-parser.git",
"reference": "10553ab3f0337ff1a71433c3417d7eb2a3eec1fd"
"reference": "57f6787f0bb6431905a18aa7caea25dcd2bd59e0"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/10553ab3f0337ff1a71433c3417d7eb2a3eec1fd",
"reference": "10553ab3f0337ff1a71433c3417d7eb2a3eec1fd",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/57f6787f0bb6431905a18aa7caea25dcd2bd59e0",
"reference": "57f6787f0bb6431905a18aa7caea25dcd2bd59e0",
"shasum": ""
},
"require": {
@ -846,7 +846,7 @@
"phpunit\/phpunit": "^9.5",
"symfony\/process": "^5.2"
},
"time": "2023-04-20T11:18:07+00:00",
"time": "2023-04-22T09:05:52+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -863,7 +863,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.20.0"
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.20.1"
},
"install-path": "..\/phpstan\/phpdoc-parser"
},

File diff suppressed because one or more lines are too long

View File

@ -95,6 +95,13 @@ class PhpDocParser
$tag->setAttribute(Ast\Attribute::END_LINE, $endLine);
}
if ($this->useIndexAttributes) {
$tokensArray = $tokens->getTokens();
if ($tokensArray[$endIndex][Lexer::TYPE_OFFSET] === Lexer::TOKEN_CLOSE_PHPDOC) {
$endIndex--;
if ($tokensArray[$endIndex][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) {
$endIndex--;
}
}
$tag->setAttribute(Ast\Attribute::START_INDEX, $startIndex);
$tag->setAttribute(Ast\Attribute::END_INDEX, $endIndex);
}

View File

@ -29,6 +29,13 @@ class TokenIterator
}
$this->index++;
}
/**
* @return list<array{string, int, int}>
*/
public function getTokens() : array
{
return $this->tokens;
}
public function currentTokenValue() : string
{
return $this->tokens[$this->index][Lexer::VALUE_OFFSET];

View File

@ -55,6 +55,13 @@ class TypeParser
$type->setAttribute(Ast\Attribute::END_LINE, $endLine);
}
if ($this->useIndexAttributes) {
$tokensArray = $tokens->getTokens();
if ($tokensArray[$endIndex][Lexer::TYPE_OFFSET] === Lexer::TOKEN_CLOSE_PHPDOC) {
$endIndex--;
if ($tokensArray[$endIndex][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) {
$endIndex--;
}
}
$type->setAttribute(Ast\Attribute::START_INDEX, $startIndex);
$type->setAttribute(Ast\Attribute::END_INDEX, $endIndex);
}