mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
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:
parent
20cb65540b
commit
db9dc03ef1
@ -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[]
|
||||
*/
|
||||
|
@ -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
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitd3f863c067155c8f7cafbfbb406580c8::getLoader();
|
||||
return ComposerAutoloaderInit81e95a65116e558f62632747bd5afba4::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 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;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user