Updated Rector to commit 592ca48295d1cf2bf626a19c94de1c39a474c153

592ca48295 [CodeQuality] Mirror comment on SimplifyIfElseToTernaryRector (#103)
This commit is contained in:
Tomas Votruba 2021-05-25 16:37:18 +00:00
parent cb6003c69e
commit 4ca106e3ef
8 changed files with 34 additions and 20 deletions

View File

@ -418,6 +418,10 @@ final class PhpDocInfo
{
$this->isSingleLine = \false;
}
public function getNode() : \PhpParser\Node
{
return $this->node;
}
private function getTypeOrMixed(?\PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode $phpDocTagValueNode) : \PHPStan\Type\Type
{
if ($phpDocTagValueNode === null) {

View File

@ -4,6 +4,7 @@ declare (strict_types=1);
namespace Rector\BetterPhpDocParser\Printer;
use RectorPrefix20210525\Nette\Utils\Strings;
use PhpParser\Node\Stmt\InlineHTML;
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocChildNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode;
@ -105,6 +106,9 @@ final class PhpDocInfoPrinter
if ($phpDocInfo->isSingleLine()) {
return $this->docBlockInliner->inline($docContent);
}
if ($phpDocInfo->getNode() instanceof \PhpParser\Node\Stmt\InlineHTML) {
return '<?php' . \PHP_EOL . $docContent . \PHP_EOL . '?>';
}
return $docContent;
}
/**
@ -124,6 +128,9 @@ final class PhpDocInfoPrinter
if ($phpDocInfo->getPhpDocNode()->children === []) {
return '';
}
if ($phpDocInfo->getNode() instanceof \PhpParser\Node\Stmt\InlineHTML) {
return '<?php' . \PHP_EOL . $phpDocInfo->getPhpDocNode() . \PHP_EOL . '?>';
}
return (string) $phpDocInfo->getPhpDocNode();
}
$phpDocNode = $phpDocInfo->getPhpDocNode();

View File

@ -9,6 +9,7 @@ use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\Ternary;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\If_;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
@ -95,7 +96,9 @@ CODE_SAMPLE
if ($this->isNodeTooLong($assign)) {
return null;
}
return $assign;
$expression = new \PhpParser\Node\Stmt\Expression($assign);
$this->mirrorComments($expression, $node);
return $expression;
}
/**
* @param Stmt[] $stmts

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '63faa6a33a5efd1371c83d756adfe0353ecddb2f';
public const PACKAGE_VERSION = '592ca48295d1cf2bf626a19c94de1c39a474c153';
/**
* @var string
*/
public const RELEASE_DATE = '2021-05-25 15:16:51';
public const RELEASE_DATE = '2021-05-25 18:28:09';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210525\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc::getLoader();
return ComposerAutoloaderInitda82ad30c69eec08aac590b9b6515279::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc
class ComposerAutoloaderInitda82ad30c69eec08aac590b9b6515279
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitda82ad30c69eec08aac590b9b6515279', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitda82ad30c69eec08aac590b9b6515279', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitf1f7428dabc64f3bc5ce412ff1b4e1fc::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitda82ad30c69eec08aac590b9b6515279::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitf1f7428dabc64f3bc5ce412ff1b4e1fc::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitda82ad30c69eec08aac590b9b6515279::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiref1f7428dabc64f3bc5ce412ff1b4e1fc($fileIdentifier, $file);
composerRequireda82ad30c69eec08aac590b9b6515279($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequiref1f7428dabc64f3bc5ce412ff1b4e1fc($fileIdentifier, $file)
function composerRequireda82ad30c69eec08aac590b9b6515279($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitf1f7428dabc64f3bc5ce412ff1b4e1fc
class ComposerStaticInitda82ad30c69eec08aac590b9b6515279
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3819,9 +3819,9 @@ class ComposerStaticInitf1f7428dabc64f3bc5ce412ff1b4e1fc
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitf1f7428dabc64f3bc5ce412ff1b4e1fc::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitf1f7428dabc64f3bc5ce412ff1b4e1fc::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitf1f7428dabc64f3bc5ce412ff1b4e1fc::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitda82ad30c69eec08aac590b9b6515279::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitda82ad30c69eec08aac590b9b6515279::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitda82ad30c69eec08aac590b9b6515279::$classMap;
}, null, ClassLoader::class);
}

View File

@ -21,8 +21,8 @@ if (!class_exists('SomeTestCase', false) && !interface_exists('SomeTestCase', fa
if (!class_exists('CheckoutEntityFactory', false) && !interface_exists('CheckoutEntityFactory', false) && !trait_exists('CheckoutEntityFactory', false)) {
spl_autoload_call('RectorPrefix20210525\CheckoutEntityFactory');
}
if (!class_exists('ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc', false) && !interface_exists('ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc', false) && !trait_exists('ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc', false)) {
spl_autoload_call('RectorPrefix20210525\ComposerAutoloaderInitf1f7428dabc64f3bc5ce412ff1b4e1fc');
if (!class_exists('ComposerAutoloaderInitda82ad30c69eec08aac590b9b6515279', false) && !interface_exists('ComposerAutoloaderInitda82ad30c69eec08aac590b9b6515279', false) && !trait_exists('ComposerAutoloaderInitda82ad30c69eec08aac590b9b6515279', false)) {
spl_autoload_call('RectorPrefix20210525\ComposerAutoloaderInitda82ad30c69eec08aac590b9b6515279');
}
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
spl_autoload_call('RectorPrefix20210525\Doctrine\Inflector\Inflector');
@ -92,9 +92,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210525\print_node(...func_get_args());
}
}
if (!function_exists('composerRequiref1f7428dabc64f3bc5ce412ff1b4e1fc')) {
function composerRequiref1f7428dabc64f3bc5ce412ff1b4e1fc() {
return \RectorPrefix20210525\composerRequiref1f7428dabc64f3bc5ce412ff1b4e1fc(...func_get_args());
if (!function_exists('composerRequireda82ad30c69eec08aac590b9b6515279')) {
function composerRequireda82ad30c69eec08aac590b9b6515279() {
return \RectorPrefix20210525\composerRequireda82ad30c69eec08aac590b9b6515279(...func_get_args());
}
}
if (!function_exists('parseArgs')) {