Laravel 5.6 updates
Travis config update Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
@@ -65,9 +65,9 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
* @param bool $decorated Whether this formatter should actually decorate strings
|
||||
* @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
|
||||
*/
|
||||
public function __construct($decorated = false, array $styles = array())
|
||||
public function __construct(bool $decorated = false, array $styles = array())
|
||||
{
|
||||
$this->decorated = (bool) $decorated;
|
||||
$this->decorated = $decorated;
|
||||
|
||||
$this->setStyle('error', new OutputFormatterStyle('white', 'red'));
|
||||
$this->setStyle('info', new OutputFormatterStyle('green'));
|
||||
@@ -186,11 +186,9 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
/**
|
||||
* Tries to create new style instance from string.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return OutputFormatterStyle|false false if string is not format string
|
||||
* @return OutputFormatterStyle|false False if string is not format string
|
||||
*/
|
||||
private function createStyleFromString($string)
|
||||
private function createStyleFromString(string $string)
|
||||
{
|
||||
if (isset($this->styles[$string])) {
|
||||
return $this->styles[$string];
|
||||
@@ -212,13 +210,7 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
preg_match_all('([^,;]+)', $match[1], $options);
|
||||
$options = array_shift($options);
|
||||
foreach ($options as $option) {
|
||||
try {
|
||||
$style->setOption($option);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
@trigger_error(sprintf('Unknown style options are deprecated since Symfony 3.2 and will be removed in 4.0. Exception "%s".', $e->getMessage()), E_USER_DEPRECATED);
|
||||
|
||||
return false;
|
||||
}
|
||||
$style->setOption($option);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
@@ -230,12 +222,8 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
|
||||
/**
|
||||
* Applies current style from stack to text, if must be applied.
|
||||
*
|
||||
* @param string $text Input text
|
||||
*
|
||||
* @return string Styled text
|
||||
*/
|
||||
private function applyCurrentStyle($text)
|
||||
private function applyCurrentStyle(string $text): string
|
||||
{
|
||||
return $this->isDecorated() && \strlen($text) > 0 ? $this->styleStack->getCurrent()->apply($text) : $text;
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
* @param string|null $background The style background color name
|
||||
* @param array $options The style options
|
||||
*/
|
||||
public function __construct($foreground = null, $background = null, array $options = array())
|
||||
public function __construct(string $foreground = null, string $background = null, array $options = array())
|
||||
{
|
||||
if (null !== $foreground) {
|
||||
$this->setForeground($foreground);
|
||||
|
Reference in New Issue
Block a user