From e20235768548bbae8852cbbc378ae644bfe8c0ac Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Sat, 18 Oct 2025 16:51:16 +0300 Subject: [PATCH] cleaning --- .../src/Command/TransmogrifyCommand.php | 11 ++++------- .../src/Lib/Util/CommandLinePrinter.php | 16 ++++------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php b/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php index 9bd4daaa8..17377e906 100644 --- a/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php +++ b/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php @@ -210,9 +210,6 @@ public function execute(Arguments $args, ConsoleIo $io): int $this->args = $args; $this->io = $io; - // Info is forced to be white - $io->setStyle('info', ['text' => '0;39']); - // Now that BaseCommand set verbosity, construct the printer so it can detect it correctly $this->cmdPrinter = new CommandLinePrinter($io, 'green', 50, true); @@ -409,7 +406,7 @@ public function execute(Arguments $args, ConsoleIo $io): int // not linked to a CO Person that was not migrated. $warns++; $this->cache['rejected'][$outboundQualifiedTableName][$row['id']] = $row; - $this->cmdPrinter->warn("Skipping $t record " . $row['id'] . " due to invalid foreign key: " . $e->getMessage()); + $this->cmdPrinter->warning("Skipping $t record " . $row['id'] . " due to invalid foreign key: " . $e->getMessage()); $this->cmdPrinter->pause(); } catch(\InvalidArgumentException $e) { @@ -417,7 +414,7 @@ public function execute(Arguments $args, ConsoleIo $io): int // (ie: mapLegacyFieldNames basically requires a successful mapping) $warns++; $this->cache['rejected'][$outboundQualifiedTableName][$row['id']] = $row; - $this->cmdPrinter->warn("Skipping $t record " . $row['id'] . ": " . $e->getMessage()); + $this->cmdPrinter->warning("Skipping $t record " . $row['id'] . ": " . $e->getMessage()); $this->cmdPrinter->pause(); } catch(\Exception $e) { @@ -678,7 +675,7 @@ private function skipIfRejectedParent(string $currentTable, array $row): bool if ($childId !== null) { $this->cache['rejected'][$qualifiedCurrent][$childId] = $row; } - $this->cmdPrinter->warn(sprintf( + $this->cmdPrinter->warning(sprintf( 'Skipping record %d in table %s - parent %s(%d) was rejected (self-reference)', (int)($childId ?? 0), $currentTable, @@ -711,7 +708,7 @@ private function skipIfRejectedParent(string $currentTable, array $row): bool if ($childId !== null) { $this->cache['rejected'][$qualifiedCurrent][$childId] = $row; } - $this->cmdPrinter->warn(sprintf( + $this->cmdPrinter->warning(sprintf( 'Skipping record %d in table %s - parent %s(%d) was rejected', (int)($childId ?? 0), $currentTable, diff --git a/app/plugins/Transmogrify/src/Lib/Util/CommandLinePrinter.php b/app/plugins/Transmogrify/src/Lib/Util/CommandLinePrinter.php index 052d5646f..80f2f5a04 100644 --- a/app/plugins/Transmogrify/src/Lib/Util/CommandLinePrinter.php +++ b/app/plugins/Transmogrify/src/Lib/Util/CommandLinePrinter.php @@ -91,6 +91,10 @@ public function __construct(?ConsoleIo $io = null, string $barColor = 'blue', in $this->barColor = in_array($barColor, ['blue', 'green'], true) ? $barColor : 'blue'; $this->barWidth = max(10, $barWidth); $this->useColors = $useColors; + + // Info is forced to be white + $this->io->setStyle('info', ['text' => '0;39']); + $this->io->setStyle('question', ['text' => '0;39']); } /** @@ -208,18 +212,6 @@ public function info(string $message): void $this->message($message, 'info'); } - /** - * Display a warning level message - * - * @param string $message Message to display - * @return void - * @since COmanage Registry v5.2.0 - */ - public function warn(string $message): void - { - $this->message($message, 'warn'); - } - /** * Display a warning level message (alias of warn()) *