upgraded dependencies
This commit is contained in:
@@ -36,11 +36,9 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
/**
|
||||
* Escapes "<" and ">" special chars in given text.
|
||||
*
|
||||
* @param string $text Text to escape
|
||||
*
|
||||
* @return string Escaped text
|
||||
* @return string
|
||||
*/
|
||||
public static function escape($text)
|
||||
public static function escape(string $text)
|
||||
{
|
||||
$text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text);
|
||||
|
||||
@@ -88,9 +86,9 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setDecorated($decorated)
|
||||
public function setDecorated(bool $decorated)
|
||||
{
|
||||
$this->decorated = (bool) $decorated;
|
||||
$this->decorated = $decorated;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +102,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setStyle($name, OutputFormatterStyleInterface $style)
|
||||
public function setStyle(string $name, OutputFormatterStyleInterface $style)
|
||||
{
|
||||
$this->styles[strtolower($name)] = $style;
|
||||
}
|
||||
@@ -112,7 +110,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hasStyle($name)
|
||||
public function hasStyle(string $name)
|
||||
{
|
||||
return isset($this->styles[strtolower($name)]);
|
||||
}
|
||||
@@ -120,7 +118,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getStyle($name)
|
||||
public function getStyle(string $name)
|
||||
{
|
||||
if (!$this->hasStyle($name)) {
|
||||
throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name));
|
||||
@@ -132,16 +130,20 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function format($message)
|
||||
public function format(?string $message)
|
||||
{
|
||||
return $this->formatAndWrap((string) $message, 0);
|
||||
return $this->formatAndWrap($message, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function formatAndWrap(string $message, int $width)
|
||||
public function formatAndWrap(?string $message, int $width)
|
||||
{
|
||||
if (null === $message) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$offset = 0;
|
||||
$output = '';
|
||||
$openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*';
|
||||
|
Reference in New Issue
Block a user