Updated Rector to commit 61348a86a5a9f113e0bd7d40324b3a0eec6fcd7d

61348a86a5 [e2e][core] Do not print on execute without --dry-run when no change (#3407)
This commit is contained in:
Tomas Votruba 2023-02-23 13:14:36 +00:00
parent 20cb65540b
commit db9dc03ef1
6 changed files with 27 additions and 17 deletions

View File

@ -3,6 +3,7 @@
declare (strict_types=1);
namespace Rector\Core\Application\FileProcessor;
use RectorPrefix202302\Nette\Utils\FileSystem;
use PHPStan\AnalysedCodeException;
use Rector\ChangesReporting\ValueObjectFactory\ErrorFactory;
use Rector\Core\Application\FileDecorator\FileDiffFileDecorator;
@ -118,10 +119,7 @@ final class PhpFileProcessor implements FileProcessorInterface
}
// No Line change and no PostRector change? return early
if ($file->getRectorWithLineChanges() === [] && !$hasChangedOnPostRector) {
return $systemErrorsAndFileDiffs;
}
// return early on diff is empty
if ($fileDiff->getDiff() === '') {
$this->rollbackOriginalFile($file, $configuration);
return $systemErrorsAndFileDiffs;
}
$systemErrorsAndFileDiffs[Bridge::FILE_DIFFS] = [$fileDiff];
@ -139,6 +137,18 @@ final class PhpFileProcessor implements FileProcessorInterface
{
return ['php'];
}
private function rollbackOriginalFile(File $file, Configuration $configuration) : void
{
if ($configuration->isDryRun()) {
return;
}
$filePath = $file->getFilePath();
if ($this->removedAndAddedFilesCollector->isFileRemoved($filePath)) {
// skip, because this file exists no more
return;
}
Filesystem::write($filePath, $file->getOriginalFileContent());
}
/**
* @return SystemError[]
*/

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'a8983ad8685a442077ee716d258ecd2b502a2962';
public const PACKAGE_VERSION = '61348a86a5a9f113e0bd7d40324b3a0eec6fcd7d';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-02-23 11:30:48';
public const RELEASE_DATE = '2023-02-23 13:10:06';
/**
* @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 ComposerAutoloaderInitd3f863c067155c8f7cafbfbb406580c8::getLoader();
return ComposerAutoloaderInit81e95a65116e558f62632747bd5afba4::getLoader();

View File

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

View File

@ -21,7 +21,7 @@ if (!\function_exists('RectorPrefix202302\\trigger_deprecation')) {
*
* @author Nicolas Grekas <p@tchwork.com>
*/
function trigger_deprecation(string $package, string $version, string $message, ...$args) : void
function trigger_deprecation(string $package, string $version, string $message, mixed ...$args) : void
{
// @\trigger_error(($package || $version ? "Since {$package} {$version}: " : '') . ($args ? \vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
}