Skip to content

Commit 7189e31

Browse files
committed
ecs fix
1 parent 957a621 commit 7189e31

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

packages/ChangesReporting/Output/ConsoleOutputFormatter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Rector\ChangesReporting\Annotation\RectorsChangelogResolver;
99
use Rector\ChangesReporting\Contract\Output\OutputFormatterInterface;
1010
use Rector\Core\Contract\Console\OutputStyleInterface;
11-
use Rector\Core\Exception\ShouldNotHappenException;
1211
use Rector\Core\ValueObject\Configuration;
1312
use Rector\Core\ValueObject\Error\SystemError;
1413
use Rector\Core\ValueObject\ProcessResult;

packages/ChangesReporting/Output/WorkerOutputFormatter.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@
44

55
namespace Rector\ChangesReporting\Output;
66

7-
use Nette\Utils\Json;
8-
use Rector\ChangesReporting\Annotation\RectorsChangelogResolver;
97
use Rector\ChangesReporting\Contract\Output\OutputFormatterInterface;
10-
use Rector\Core\Exception\ShouldNotHappenException;
118
use Rector\Core\ValueObject\Configuration;
12-
use Rector\Core\ValueObject\Error\SystemError;
139
use Rector\Core\ValueObject\ProcessResult;
14-
use Rector\Parallel\ValueObject\Bridge;
1510

1611
final class WorkerOutputFormatter implements OutputFormatterInterface
1712
{

packages/ChangesReporting/ValueObjectFactory/FileDiffFactory.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Rector\ChangesReporting\ValueObjectFactory;
66

77
use Rector\ChangesReporting\Output\ConsoleOutputFormatter;
8-
use Rector\ChangesReporting\Output\JsonOutputFormatter;
98
use Rector\ChangesReporting\Output\WorkerOutputFormatter;
109
use Rector\Core\Console\Formatter\ConsoleDiffer;
1110
use Rector\Core\Differ\DefaultDiffer;
@@ -23,10 +22,17 @@ public function __construct(
2322
) {
2423
}
2524

26-
public function createFileDiff(File $file, string $oldContent, string $newContent, Configuration $configuration): FileDiff
27-
{
28-
if (in_array($configuration->getOutputFormat(), [ConsoleOutputFormatter::NAME, WorkerOutputFormatter::NAME], true))
29-
{
25+
public function createFileDiff(
26+
File $file,
27+
string $oldContent,
28+
string $newContent,
29+
Configuration $configuration
30+
): FileDiff {
31+
if (in_array(
32+
$configuration->getOutputFormat(),
33+
[ConsoleOutputFormatter::NAME, WorkerOutputFormatter::NAME],
34+
true
35+
)) {
3036
return $this->createConsoleFileDiff($file, $oldContent, $newContent);
3137
}
3238

@@ -58,5 +64,4 @@ private function createDefaultFileDiff(File $file, string $oldContent, string $n
5864
$file->getRectorWithLineChanges()
5965
);
6066
}
61-
6267
}

packages/Parallel/Command/WorkerCommandLineFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Rector\Parallel\Command;
66

7-
use Rector\ChangesReporting\Output\JsonOutputFormatter;
87
use Rector\ChangesReporting\Output\WorkerOutputFormatter;
98
use Rector\Core\Configuration\Option;
109
use Symfony\Component\Console\Command\Command;

src/Console/Command/ProcessCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6060

6161
$configuration = $this->configurationFactory->createFromInput($input);
6262
$this->memoryLimiter->adjust($configuration);
63-
63+
6464
// disable console output in case of json output formatter
65-
if (in_array($configuration->getOutputFormat(), [JsonOutputFormatter::NAME, WorkerOutputFormatter::NAME], true)) {
65+
if (in_array(
66+
$configuration->getOutputFormat(),
67+
[JsonOutputFormatter::NAME, WorkerOutputFormatter::NAME],
68+
true
69+
)) {
6670
$this->rectorOutputStyle->setVerbosity(OutputInterface::VERBOSITY_QUIET);
6771
}
6872

src/Console/Formatter/ConsoleDiffer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct(
1717
) {
1818
// @see https://github.com/sebastianbergmann/diff#strictunifieddiffoutputbuilder
1919
// @see https://github.com/sebastianbergmann/diff/compare/4.0.4...5.0.0#diff-251edf56a6344c03fa264a4926b06c2cee43c25f66192d5f39ebee912b7442dc for upgrade
20-
$unifiedDiffOutputBuilder = new UnifiedDiffOutputBuilder( "--- Original\n+++ New\n", true);
20+
$unifiedDiffOutputBuilder = new UnifiedDiffOutputBuilder("--- Original\n+++ New\n", true);
2121
$this->differ = new Differ($unifiedDiffOutputBuilder);
2222
}
2323

src/ValueObject/Reporting/FileDiff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public function getDiff(): string
4141
return $this->diff;
4242
}
4343

44-
public function isConsoleFormatted(): bool {
44+
public function isConsoleFormatted(): bool
45+
{
4546
return $this->isConsoleFormatted;
4647
}
4748

0 commit comments

Comments
 (0)