function DebugFormatterHelper::stop
Stops a formatting session.
File
-
vendor/
symfony/ console/ Helper/ DebugFormatterHelper.php, line 74
Class
- DebugFormatterHelper
- Helps outputting debug information when running an external program from a command.
Namespace
Symfony\Component\Console\HelperCode
public function stop(string $id, string $message, bool $successful, string $prefix = 'RES') : string {
$trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : '';
if ($successful) {
return \sprintf("%s%s<bg=green;fg=white> %s </> <fg=green>%s</>\n", $trailingEOL, $this->getBorder($id), $prefix, $message);
}
$message = \sprintf("%s%s<bg=red;fg=white> %s </> <fg=red>%s</>\n", $trailingEOL, $this->getBorder($id), $prefix, $message);
unset($this->started[$id]['out'], $this->started[$id]['err']);
return $message;
}