Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Nov 7, 2025
1 parent ebdf7c5 commit e202357
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
11 changes: 4 additions & 7 deletions app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -409,15 +406,15 @@ 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) {
// If we can't find a value for mapping we skip the record
// (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) {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 4 additions & 12 deletions app/plugins/Transmogrify/src/Lib/Util/CommandLinePrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

/**
Expand Down Expand Up @@ -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())
*
Expand Down

0 comments on commit e202357

Please sign in to comment.