mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-02 08:09:19 +08:00
Add Warnings for feedback
This commit is contained in:
parent
d98d898ca9
commit
d109a37fe0
2 changed files with 24 additions and 0 deletions
|
@ -63,6 +63,10 @@ class Feedback
|
|||
* @var array
|
||||
*/
|
||||
public $errors = [];
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $warnings = [];
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
|
@ -209,4 +213,16 @@ class Feedback
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWarnings(): array
|
||||
{
|
||||
return $this->warnings;
|
||||
}
|
||||
|
||||
public function setWarnings(array $warnings): Feedback
|
||||
{
|
||||
$this->warnings = $warnings;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,6 +188,7 @@ abstract class BaseCommand extends Command
|
|||
$output->writeln('step: ' . $step . ' | status: ' . $status);
|
||||
|
||||
$this->writeFeedbackMessages($output, $feedback);
|
||||
$this->writeFeedbackWarnings($output, $feedback);
|
||||
$this->writeFeedbackErrors($output, $feedback);
|
||||
}
|
||||
|
||||
|
@ -250,6 +251,13 @@ abstract class BaseCommand extends Command
|
|||
}
|
||||
}
|
||||
|
||||
protected function writeFeedbackWarnings(OutputInterface $output, Feedback $feedback): void {
|
||||
$warnings = $feedback->getWarnings() ?? [];
|
||||
foreach ($warnings as $warning) {
|
||||
$output->writeln('<warning>' . $warning . '</warning>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Feedback $feedback
|
||||
* @param string $message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue