Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ChangesReporting/Output/ConsoleOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ private function reportErrors(array $errors, bool $absoluteFilePath): void
foreach ($errors as $error) {
$errorMessage = $error->getMessage();
$errorMessage = $this->normalizePathsToRelativeWithLine($errorMessage);
$errorMessage = str_replace("\r\n", "\n", $errorMessage);

$filePath = $absoluteFilePath ? $error->getAbsoluteFilePath() : $error->getRelativeFilePath();

$message = sprintf(
'Could not process %s%s, due to: %s"%s".',
$filePath !== null ? '"' . $filePath . '" file' : 'some files',
$error->getRectorClass() !== null ? ' by "' . $error->getRectorClass() . '"' : '',
PHP_EOL,
"\n",
$errorMessage
);

Expand Down
10 changes: 5 additions & 5 deletions src/Console/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($setAndRulesDuplicatedRegistrations !== []) {
$this->symfonyStyle->warning(sprintf(
'These rules are registered in both sets and "withRules()". Remove them from "withRules()" to avoid duplications: %s* %s',
PHP_EOL . PHP_EOL,
implode(' * ', $setAndRulesDuplicatedRegistrations) . PHP_EOL
"\n\n",
implode(' * ', $setAndRulesDuplicatedRegistrations) . "\n"
));
}

Expand All @@ -145,8 +145,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$isSingular ? 'es' : '',
$isSingular ? '' : 's',
$isSingular ? 'y' : 'ies',
PHP_EOL . PHP_EOL . ' - ',
implode(PHP_EOL . ' - ', $paths)
"\n\n" . ' - ',
implode("\n" . ' - ', $paths)
)
);

Expand Down Expand Up @@ -253,7 +253,7 @@ private function reportLevelOverflow(LevelOverflow $levelOverflow): void
$levelOverflow->getConfigurationName(),
$levelOverflow->getRuleCount(),
$levelOverflow->getLevel(),
PHP_EOL,
"\n",
$suggestedSetMethod,
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/SetupCICommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$noteMessage = sprintf(
'Only GitHub and GitLab are currently supported.%s Contribute your CI template to Rector to make this work: %s',
PHP_EOL,
"\n",
'https://github.com/rectorphp/rector-src/'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct()
} catch (Throwable $throwable) {
if ($throwable->getMessage() === "File 'phar://phpstan.phar/conf/bleedingEdge.neon' is missing or is not readable.") {
$symfonyStyle = new SymfonyStyle(new ArrayInput([]), new ConsoleOutput());
$symfonyStyle->error(sprintf(self::INVALID_BLEEDING_EDGE_PATH_MESSAGE, $throwable->getMessage()));
$symfonyStyle->error(str_replace("\r\n", "\n", sprintf(self::INVALID_BLEEDING_EDGE_PATH_MESSAGE, $throwable->getMessage())));

exit(-1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Reporting/MissConfigurationReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function reportVendorInPaths(array $filePaths): void

$this->symfonyStyle->warning(sprintf(
'Rector has detected a "/vendor" directory in your configured paths. If this is Composer\'s vendor directory, this is not necessary as it will be autoloaded. Scanning the Composer /vendor directory will cause Rector to run much slower and possibly with errors.%sRemove "/vendor" from Rector paths and run again.',
PHP_EOL . PHP_EOL
"\n\n"
));

sleep(3);
Expand All @@ -69,12 +69,12 @@ public function reportStartWithShortOpenTag(): void
}

$suffix = count($files) > 1 ? 's were' : ' was';
$fileList = implode(PHP_EOL, $files);
$fileList = implode("\n", $files);

$this->symfonyStyle->warning(sprintf(
'The following file%s skipped as starting with short open tag. Migrate to long open PHP tag first: %s%s',
$suffix,
PHP_EOL . PHP_EOL,
"\n\n",
$fileList
));

Expand Down
Loading