Updated Rector to commit 8ddb48097219683f23faa75e2365c5161cc623a8

8ddb480972 [PHPStanStaticTypeMapper] Handle crash on OversizedArrayType (#3306)
This commit is contained in:
Tomas Votruba 2023-01-26 16:13:48 +00:00
parent d28a86773d
commit 16e7e0d008
9 changed files with 48 additions and 17 deletions

2
vendor/autoload.php vendored
View File

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

View File

@ -1750,6 +1750,7 @@ return array(
'Rector\\DowngradePhp73\\Rector\\String_\\DowngradeFlexibleHeredocSyntaxRector' => $vendorDir . '/rector/rector-downgrade-php/rules/DowngradePhp73/Rector/String_/DowngradeFlexibleHeredocSyntaxRector.php',
'Rector\\DowngradePhp73\\Rector\\Unset_\\DowngradeTrailingCommasInUnsetRector' => $vendorDir . '/rector/rector-downgrade-php/rules/DowngradePhp73/Rector/Unset_/DowngradeTrailingCommasInUnsetRector.php',
'Rector\\DowngradePhp73\\Tokenizer\\FollowedByCommaAnalyzer' => $vendorDir . '/rector/rector-downgrade-php/rules/DowngradePhp73/Tokenizer/FollowedByCommaAnalyzer.php',
'Rector\\DowngradePhp73\\Tokenizer\\FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer' => $vendorDir . '/rector/rector-downgrade-php/rules/DowngradePhp73/Tokenizer/FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer.php',
'Rector\\DowngradePhp74\\Rector\\Array_\\DowngradeArraySpreadRector' => $vendorDir . '/rector/rector-downgrade-php/rules/DowngradePhp74/Rector/Array_/DowngradeArraySpreadRector.php',
'Rector\\DowngradePhp74\\Rector\\ArrowFunction\\ArrowFunctionToAnonymousFunctionRector' => $vendorDir . '/rector/rector-downgrade-php/rules/DowngradePhp74/Rector/ArrowFunction/ArrowFunctionToAnonymousFunctionRector.php',
'Rector\\DowngradePhp74\\Rector\\ClassMethod\\DowngradeContravariantArgumentTypeRector' => $vendorDir . '/rector/rector-downgrade-php/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitaece8384fb060524c28552402acad6fd
class ComposerAutoloaderInit3fcd2dd16bcaa0931dbfcf64b2af461f
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitaece8384fb060524c28552402acad6fd
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitaece8384fb060524c28552402acad6fd', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit3fcd2dd16bcaa0931dbfcf64b2af461f', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitaece8384fb060524c28552402acad6fd', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit3fcd2dd16bcaa0931dbfcf64b2af461f', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitaece8384fb060524c28552402acad6fd::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit3fcd2dd16bcaa0931dbfcf64b2af461f::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitaece8384fb060524c28552402acad6fd::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit3fcd2dd16bcaa0931dbfcf64b2af461f::$files;
$requireFile = 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 ComposerStaticInitaece8384fb060524c28552402acad6fd
class ComposerStaticInit3fcd2dd16bcaa0931dbfcf64b2af461f
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -1995,6 +1995,7 @@ class ComposerStaticInitaece8384fb060524c28552402acad6fd
'Rector\\DowngradePhp73\\Rector\\String_\\DowngradeFlexibleHeredocSyntaxRector' => __DIR__ . '/..' . '/rector/rector-downgrade-php/rules/DowngradePhp73/Rector/String_/DowngradeFlexibleHeredocSyntaxRector.php',
'Rector\\DowngradePhp73\\Rector\\Unset_\\DowngradeTrailingCommasInUnsetRector' => __DIR__ . '/..' . '/rector/rector-downgrade-php/rules/DowngradePhp73/Rector/Unset_/DowngradeTrailingCommasInUnsetRector.php',
'Rector\\DowngradePhp73\\Tokenizer\\FollowedByCommaAnalyzer' => __DIR__ . '/..' . '/rector/rector-downgrade-php/rules/DowngradePhp73/Tokenizer/FollowedByCommaAnalyzer.php',
'Rector\\DowngradePhp73\\Tokenizer\\FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer' => __DIR__ . '/..' . '/rector/rector-downgrade-php/rules/DowngradePhp73/Tokenizer/FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer.php',
'Rector\\DowngradePhp74\\Rector\\Array_\\DowngradeArraySpreadRector' => __DIR__ . '/..' . '/rector/rector-downgrade-php/rules/DowngradePhp74/Rector/Array_/DowngradeArraySpreadRector.php',
'Rector\\DowngradePhp74\\Rector\\ArrowFunction\\ArrowFunctionToAnonymousFunctionRector' => __DIR__ . '/..' . '/rector/rector-downgrade-php/rules/DowngradePhp74/Rector/ArrowFunction/ArrowFunctionToAnonymousFunctionRector.php',
'Rector\\DowngradePhp74\\Rector\\ClassMethod\\DowngradeContravariantArgumentTypeRector' => __DIR__ . '/..' . '/rector/rector-downgrade-php/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php',
@ -3077,9 +3078,9 @@ class ComposerStaticInitaece8384fb060524c28552402acad6fd
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitaece8384fb060524c28552402acad6fd::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitaece8384fb060524c28552402acad6fd::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitaece8384fb060524c28552402acad6fd::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit3fcd2dd16bcaa0931dbfcf64b2af461f::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit3fcd2dd16bcaa0931dbfcf64b2af461f::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit3fcd2dd16bcaa0931dbfcf64b2af461f::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1914,12 +1914,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "3ecbb02aa92b1bbd1cbec76c5c31297452c45c61"
"reference": "215026f1e63415188b6ac772af65976d8f1af5a7"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/3ecbb02aa92b1bbd1cbec76c5c31297452c45c61",
"reference": "3ecbb02aa92b1bbd1cbec76c5c31297452c45c61",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/215026f1e63415188b6ac772af65976d8f1af5a7",
"reference": "215026f1e63415188b6ac772af65976d8f1af5a7",
"shasum": ""
},
"require": {
@ -1948,7 +1948,7 @@
"tomasvotruba\/type-coverage": "^0.0.9",
"tomasvotruba\/unused-public": "^0.0.34"
},
"time": "2023-01-26T00:24:52+00:00",
"time": "2023-01-26T16:05:06+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('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 f0c3c11'), '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 3ecbb02'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ea5f62'), '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 2cfc0a5'), '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 368c1fa'));
public const EXTENSIONS = array('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 f0c3c11'), '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 215026f'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ea5f62'), '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 2cfc0a5'), '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 368c1fa'));
private function __construct()
{
}

View File

@ -7,6 +7,7 @@ use PhpParser\Node;
use PhpParser\Node\Scalar\Encapsed;
use PhpParser\Node\Scalar\String_;
use Rector\Core\Rector\AbstractRector;
use Rector\DowngradePhp73\Tokenizer\FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -19,6 +20,15 @@ final class DowngradeFlexibleHeredocSyntaxRector extends AbstractRector
* @var int[]
*/
private const HERENOW_DOC_KINDS = [String_::KIND_HEREDOC, String_::KIND_NOWDOC];
/**
* @readonly
* @var \Rector\DowngradePhp73\Tokenizer\FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer
*/
private $followedByNewlineOnlyMaybeWithSemicolonAnalyzer;
public function __construct(FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer $followedByNewlineOnlyMaybeWithSemicolonAnalyzer)
{
$this->followedByNewlineOnlyMaybeWithSemicolonAnalyzer = $followedByNewlineOnlyMaybeWithSemicolonAnalyzer;
}
public function getRuleDefinition() : RuleDefinition
{
return new RuleDefinition('Remove indentation from heredoc/nowdoc', [new CodeSample(<<<'CODE_SAMPLE'
@ -55,7 +65,7 @@ CODE_SAMPLE
}
// skip correctly indented
$docIndentation = (string) $node->getAttribute(AttributeKey::DOC_INDENTATION);
if ($docIndentation === '') {
if ($docIndentation === '' && $this->followedByNewlineOnlyMaybeWithSemicolonAnalyzer->isFollowed($this->file, $node)) {
return null;
}
$node->setAttribute(AttributeKey::DOC_INDENTATION, '');

View File

@ -0,0 +1,19 @@
<?php
declare (strict_types=1);
namespace Rector\DowngradePhp73\Tokenizer;
use PhpParser\Node;
use Rector\Core\ValueObject\Application\File;
final class FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer
{
public function isFollowed(File $file, Node $node) : bool
{
$oldTokens = $file->getOldTokens();
$nextTokenPosition = $node->getEndTokenPos() + 1;
if (isset($oldTokens[$nextTokenPosition]) && $oldTokens[$nextTokenPosition] === ';') {
++$nextTokenPosition;
}
return !isset($oldTokens[$nextTokenPosition]) || isset($oldTokens[$nextTokenPosition][1]) && \strncmp((string) $oldTokens[$nextTokenPosition][1], "\n", \strlen("\n")) === 0;
}
}