Updated Rector to commit e5d927505714bcffd0d8a1a334bd07aa6361ed1c

e5d9275057 [Doctrine] Handle Partial removal annotation has annotation below on RemoveRedundantDefaultPropertyAnnotationValuesRector (#2914)
This commit is contained in:
Tomas Votruba 2022-09-06 03:11:46 +00:00
parent 94c101e7d9
commit c58bcae308
8 changed files with 27 additions and 45 deletions

View File

@ -14,8 +14,6 @@ use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\ThrowsTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use PHPStan\PhpDocParser\Lexer\Lexer;
use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocNodeVisitor\ChangedPhpDocNodeVisitor;
use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey;
@ -52,11 +50,6 @@ final class PhpDocInfoPrinter
* @var string Uses a hardcoded unix-newline since most codes use it (even on windows) - otherwise we would need to normalize newlines
*/
private const NEWLINE_WITH_ASTERISK = "\n" . ' *';
/**
* @see https://regex101.com/r/WR3goY/1/
* @var string
*/
private const TAG_AND_SPACE_REGEX = '#(@.*?) \\(#';
/**
* @var int
*/
@ -184,25 +177,14 @@ final class PhpDocInfoPrinter
{
$output = '';
$shouldReprintChildNode = $this->shouldReprint($phpDocChildNode);
if ($phpDocChildNode instanceof PhpDocTagNode) {
if ($shouldReprintChildNode && ($phpDocChildNode->value instanceof ParamTagValueNode || $phpDocChildNode->value instanceof ThrowsTagValueNode || $phpDocChildNode->value instanceof VarTagValueNode || $phpDocChildNode->value instanceof ReturnTagValueNode || $phpDocChildNode->value instanceof PropertyTagValueNode)) {
// the type has changed → reprint
$phpDocChildNodeStartEnd = $phpDocChildNode->getAttribute(PhpDocAttributeKey::START_AND_END);
// bump the last position of token after just printed node
if ($phpDocChildNodeStartEnd instanceof StartAndEnd) {
$this->currentTokenPosition = $phpDocChildNodeStartEnd->getEnd();
}
return $this->standardPrintPhpDocChildNode($phpDocChildNode);
}
if ($phpDocChildNode->value instanceof DoctrineAnnotationTagValueNode && $shouldReprintChildNode) {
$silentValueArrayItemNode = $phpDocChildNode->value->getSilentValue();
if (!$silentValueArrayItemNode instanceof ArrayItemNode) {
$printedNode = (string) $phpDocChildNode;
// remove extra space between tags
$printedNode = Strings::replace($printedNode, self::TAG_AND_SPACE_REGEX, '$1(');
return self::NEWLINE_WITH_ASTERISK . ($printedNode === '' ? '' : ' ' . $printedNode);
}
if ($phpDocChildNode instanceof PhpDocTagNode && ($shouldReprintChildNode && ($phpDocChildNode->value instanceof ParamTagValueNode || $phpDocChildNode->value instanceof ThrowsTagValueNode || $phpDocChildNode->value instanceof VarTagValueNode || $phpDocChildNode->value instanceof ReturnTagValueNode || $phpDocChildNode->value instanceof PropertyTagValueNode))) {
// the type has changed → reprint
$phpDocChildNodeStartEnd = $phpDocChildNode->getAttribute(PhpDocAttributeKey::START_AND_END);
// bump the last position of token after just printed node
if ($phpDocChildNodeStartEnd instanceof StartAndEnd) {
$this->currentTokenPosition = $phpDocChildNodeStartEnd->getEnd();
}
return $this->standardPrintPhpDocChildNode($phpDocChildNode);
}
/** @var StartAndEnd|null $startAndEnd */
$startAndEnd = $phpDocChildNode->getAttribute(PhpDocAttributeKey::START_AND_END);

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'a638a676b4c23c70ed65e52463a4c193d72d2c7d';
public const PACKAGE_VERSION = 'e5d927505714bcffd0d8a1a334bd07aa6361ed1c';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-09-05 17:48:03';
public const RELEASE_DATE = '2022-09-06 05:07:37';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

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

View File

@ -1922,12 +1922,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "0e30fa8810b90e2024d8f0c6f6d474cb8147fa41"
"reference": "3be7de4a8ada64769c1b3d1b07d099d597316aca"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/0e30fa8810b90e2024d8f0c6f6d474cb8147fa41",
"reference": "0e30fa8810b90e2024d8f0c6f6d474cb8147fa41",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/3be7de4a8ada64769c1b3d1b07d099d597316aca",
"reference": "3be7de4a8ada64769c1b3d1b07d099d597316aca",
"shasum": ""
},
"require": {
@ -1952,7 +1952,7 @@
"symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1"
},
"time": "2022-09-05T17:29:32+00:00",
"time": "2022-09-05T23:42:01+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-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 0e30fa8'), '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 4e464b4'));
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 3be7de4'), '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 4e464b4'));
private function __construct()
{
}