upgraded dependencies
This commit is contained in:
@@ -20,22 +20,18 @@ namespace Symfony\Component\Console\Helper;
|
||||
*/
|
||||
class DebugFormatterHelper extends Helper
|
||||
{
|
||||
private $colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default'];
|
||||
private const COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default'];
|
||||
private $started = [];
|
||||
private $count = -1;
|
||||
|
||||
/**
|
||||
* Starts a debug formatting session.
|
||||
*
|
||||
* @param string $id The id of the formatting session
|
||||
* @param string $message The message to display
|
||||
* @param string $prefix The prefix to use
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function start($id, $message, $prefix = 'RUN')
|
||||
public function start(string $id, string $message, string $prefix = 'RUN')
|
||||
{
|
||||
$this->started[$id] = ['border' => ++$this->count % \count($this->colors)];
|
||||
$this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)];
|
||||
|
||||
return sprintf("%s<bg=blue;fg=white> %s </> <fg=blue>%s</>\n", $this->getBorder($id), $prefix, $message);
|
||||
}
|
||||
@@ -43,15 +39,9 @@ class DebugFormatterHelper extends Helper
|
||||
/**
|
||||
* Adds progress to a formatting session.
|
||||
*
|
||||
* @param string $id The id of the formatting session
|
||||
* @param string $buffer The message to display
|
||||
* @param bool $error Whether to consider the buffer as error
|
||||
* @param string $prefix The prefix for output
|
||||
* @param string $errorPrefix The prefix for error output
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function progress($id, $buffer, $error = false, $prefix = 'OUT', $errorPrefix = 'ERR')
|
||||
public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR')
|
||||
{
|
||||
$message = '';
|
||||
|
||||
@@ -85,14 +75,9 @@ class DebugFormatterHelper extends Helper
|
||||
/**
|
||||
* Stops a formatting session.
|
||||
*
|
||||
* @param string $id The id of the formatting session
|
||||
* @param string $message The message to display
|
||||
* @param bool $successful Whether to consider the result as success
|
||||
* @param string $prefix The prefix for the end output
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function stop($id, $message, $successful, $prefix = 'RES')
|
||||
public function stop(string $id, string $message, bool $successful, string $prefix = 'RES')
|
||||
{
|
||||
$trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : '';
|
||||
|
||||
@@ -109,7 +94,7 @@ class DebugFormatterHelper extends Helper
|
||||
|
||||
private function getBorder(string $id): string
|
||||
{
|
||||
return sprintf('<bg=%s> </>', $this->colors[$this->started[$id]['border']]);
|
||||
return sprintf('<bg=%s> </>', self::COLORS[$this->started[$id]['border']]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user