public function DebugFormatterHelper::stop in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Helper/DebugFormatterHelper.php \Symfony\Component\Console\Helper\DebugFormatterHelper::stop()
Stops a formatting session.
Parameters
string $id The id of the formatting session:
string $message The message to display:
bool $successful Whether to consider the result as success:
string $prefix The prefix for the end output:
Return value
string
File
- vendor/
symfony/ console/ Helper/ DebugFormatterHelper.php, line 95
Class
- DebugFormatterHelper
- Helps outputting debug information when running an external program from a command.
Namespace
Symfony\Component\Console\HelperCode
public function stop($id, $message, $successful, $prefix = 'RES') {
$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;
}