mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 04:03:55 +01:00
Updated Rector to commit 836fa59076134ade1403f84a0b89b1de7578e5a5
836fa59076
[Printer] Apply add node before node before HTML take 3 (#3287)
This commit is contained in:
parent
2c3af6740f
commit
9ef9a43884
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '833ac7279b9fe8ecdc20dbc225f9cc28230ef929';
|
||||
public const PACKAGE_VERSION = '836fa59076134ade1403f84a0b89b1de7578e5a5';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-01-15 02:07:45';
|
||||
public const RELEASE_DATE = '2023-01-15 15:39:25';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -118,9 +118,7 @@ final class BetterStandardPrinter extends Standard implements NodePrinterInterfa
|
||||
if (!$firstStmt instanceof InlineHTML && !$lastStmt instanceof InlineHTML) {
|
||||
return $content;
|
||||
}
|
||||
if ($lastStmt instanceof InlineHTML && \substr_compare($content, '<?php ' . $this->nl, -\strlen('<?php ' . $this->nl)) === 0) {
|
||||
$content = \substr($content, 0, -7);
|
||||
}
|
||||
$content = $this->cleanEndWithPHPOpenTag($lastStmt, $content);
|
||||
/** @var Node $firstStmt */
|
||||
$isFirstStmtReprinted = $firstStmt->getAttribute(AttributeKey::ORIGINAL_NODE) === null;
|
||||
if (!$isFirstStmtReprinted) {
|
||||
@ -414,6 +412,16 @@ final class BetterStandardPrinter extends Standard implements NodePrinterInterfa
|
||||
{
|
||||
return $this->pAttrGroups($param->attrGroups) . $this->pModifiers($param->flags) . ($param->type instanceof Node ? $this->p($param->type) . ' ' : '') . ($param->byRef ? '&' : '') . ($param->variadic ? '...' : '') . $this->p($param->var) . ($param->default instanceof Expr ? ' = ' . $this->p($param->default) : '');
|
||||
}
|
||||
private function cleanEndWithPHPOpenTag(Node $node, string $content) : string
|
||||
{
|
||||
if ($node instanceof InlineHTML && \substr_compare($content, '<?php ' . $this->nl, -\strlen('<?php ' . $this->nl)) === 0) {
|
||||
$content = \substr($content, 0, -7);
|
||||
}
|
||||
if ($node instanceof InlineHTML && \substr_compare($content, '<?php ', -\strlen('<?php ')) === 0) {
|
||||
return \substr($content, 0, -6);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
private function cleanSurplusTag(string $content) : string
|
||||
{
|
||||
if (\strncmp($content, '<?php' . $this->nl . $this->nl . '?>', \strlen('<?php' . $this->nl . $this->nl . '?>')) === 0) {
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInita04d371e551f75b4149cf058c96b2a52::getLoader();
|
||||
return ComposerAutoloaderInit2ee76fe9d4b05e5ad94e2aff85d81e14::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInita04d371e551f75b4149cf058c96b2a52
|
||||
class ComposerAutoloaderInit2ee76fe9d4b05e5ad94e2aff85d81e14
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInita04d371e551f75b4149cf058c96b2a52
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInita04d371e551f75b4149cf058c96b2a52', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit2ee76fe9d4b05e5ad94e2aff85d81e14', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita04d371e551f75b4149cf058c96b2a52', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit2ee76fe9d4b05e5ad94e2aff85d81e14', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita04d371e551f75b4149cf058c96b2a52::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit2ee76fe9d4b05e5ad94e2aff85d81e14::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInita04d371e551f75b4149cf058c96b2a52::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit2ee76fe9d4b05e5ad94e2aff85d81e14::$files;
|
||||
$requireFile = static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInita04d371e551f75b4149cf058c96b2a52
|
||||
class ComposerStaticInit2ee76fe9d4b05e5ad94e2aff85d81e14
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3066,9 +3066,9 @@ class ComposerStaticInita04d371e551f75b4149cf058c96b2a52
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita04d371e551f75b4149cf058c96b2a52::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita04d371e551f75b4149cf058c96b2a52::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita04d371e551f75b4149cf058c96b2a52::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit2ee76fe9d4b05e5ad94e2aff85d81e14::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit2ee76fe9d4b05e5ad94e2aff85d81e14::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit2ee76fe9d4b05e5ad94e2aff85d81e14::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user