mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 05:29:53 +09:00
update to laravel 5.7 and try getting autologin saved
This commit is contained in:
@@ -50,10 +50,10 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
public static function escapeTrailingBackslash($text)
|
||||
{
|
||||
if ('\\' === substr($text, -1)) {
|
||||
$len = strlen($text);
|
||||
$len = \strlen($text);
|
||||
$text = rtrim($text, '\\');
|
||||
$text = str_replace("\0", '', $text);
|
||||
$text .= str_repeat("\0", $len - strlen($text));
|
||||
$text .= str_repeat("\0", $len - \strlen($text));
|
||||
}
|
||||
|
||||
return $text;
|
||||
@@ -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'));
|
||||
@@ -145,7 +145,7 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
|
||||
// add the text up to the next tag
|
||||
$output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset));
|
||||
$offset = $pos + strlen($text);
|
||||
$offset = $pos + \strlen($text);
|
||||
|
||||
// opening tag?
|
||||
if ($open = '/' != $text[1]) {
|
||||
@@ -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,13 +222,9 @@ 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;
|
||||
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);
|
||||
@@ -69,7 +69,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
if (null !== $background) {
|
||||
$this->setBackground($background);
|
||||
}
|
||||
if (count($options)) {
|
||||
if (\count($options)) {
|
||||
$this->setOptions($options);
|
||||
}
|
||||
}
|
||||
@@ -90,11 +90,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
}
|
||||
|
||||
if (!isset(static::$availableForegroundColors[$color])) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'Invalid foreground color specified: "%s". Expected one of (%s)',
|
||||
$color,
|
||||
implode(', ', array_keys(static::$availableForegroundColors))
|
||||
));
|
||||
throw new InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableForegroundColors))));
|
||||
}
|
||||
|
||||
$this->foreground = static::$availableForegroundColors[$color];
|
||||
@@ -116,11 +112,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
}
|
||||
|
||||
if (!isset(static::$availableBackgroundColors[$color])) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'Invalid background color specified: "%s". Expected one of (%s)',
|
||||
$color,
|
||||
implode(', ', array_keys(static::$availableBackgroundColors))
|
||||
));
|
||||
throw new InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableBackgroundColors))));
|
||||
}
|
||||
|
||||
$this->background = static::$availableBackgroundColors[$color];
|
||||
@@ -136,14 +128,10 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
public function setOption($option)
|
||||
{
|
||||
if (!isset(static::$availableOptions[$option])) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'Invalid option specified: "%s". Expected one of (%s)',
|
||||
$option,
|
||||
implode(', ', array_keys(static::$availableOptions))
|
||||
));
|
||||
throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
|
||||
}
|
||||
|
||||
if (!in_array(static::$availableOptions[$option], $this->options)) {
|
||||
if (!\in_array(static::$availableOptions[$option], $this->options)) {
|
||||
$this->options[] = static::$availableOptions[$option];
|
||||
}
|
||||
}
|
||||
@@ -158,11 +146,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
public function unsetOption($option)
|
||||
{
|
||||
if (!isset(static::$availableOptions[$option])) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'Invalid option specified: "%s". Expected one of (%s)',
|
||||
$option,
|
||||
implode(', ', array_keys(static::$availableOptions))
|
||||
));
|
||||
throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
|
||||
}
|
||||
|
||||
$pos = array_search(static::$availableOptions[$option], $this->options);
|
||||
@@ -203,14 +187,14 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
$setCodes[] = $this->background['set'];
|
||||
$unsetCodes[] = $this->background['unset'];
|
||||
}
|
||||
if (count($this->options)) {
|
||||
if (\count($this->options)) {
|
||||
foreach ($this->options as $option) {
|
||||
$setCodes[] = $option['set'];
|
||||
$unsetCodes[] = $option['unset'];
|
||||
}
|
||||
}
|
||||
|
||||
if (0 === count($setCodes)) {
|
||||
if (0 === \count($setCodes)) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class OutputFormatterStyleStack
|
||||
|
||||
foreach (array_reverse($this->styles, true) as $index => $stackedStyle) {
|
||||
if ($style->apply('') === $stackedStyle->apply('')) {
|
||||
$this->styles = array_slice($this->styles, 0, $index);
|
||||
$this->styles = \array_slice($this->styles, 0, $index);
|
||||
|
||||
return $stackedStyle;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class OutputFormatterStyleStack
|
||||
return $this->emptyStyle;
|
||||
}
|
||||
|
||||
return $this->styles[count($this->styles) - 1];
|
||||
return $this->styles[\count($this->styles) - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user