mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 05:29:53 +09:00
Update to laravel 7
This commit is contained in:
@@ -50,7 +50,7 @@ class ConsoleSectionOutput extends StreamOutput
|
||||
}
|
||||
|
||||
if ($lines) {
|
||||
\array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content
|
||||
array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content
|
||||
} else {
|
||||
$lines = $this->lines;
|
||||
$this->content = [];
|
||||
@@ -82,20 +82,22 @@ class ConsoleSectionOutput extends StreamOutput
|
||||
*/
|
||||
public function addContent(string $input)
|
||||
{
|
||||
foreach (explode(PHP_EOL, $input) as $lineContent) {
|
||||
foreach (explode(\PHP_EOL, $input) as $lineContent) {
|
||||
$this->lines += ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1;
|
||||
$this->content[] = $lineContent;
|
||||
$this->content[] = PHP_EOL;
|
||||
$this->content[] = \PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doWrite($message, $newline)
|
||||
protected function doWrite(string $message, bool $newline)
|
||||
{
|
||||
if (!$this->isDecorated()) {
|
||||
return parent::doWrite($message, $newline);
|
||||
parent::doWrite($message, $newline);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$erasedContent = $this->popStreamContentUntilCurrentSection();
|
||||
@@ -134,8 +136,8 @@ class ConsoleSectionOutput extends StreamOutput
|
||||
return implode('', array_reverse($erasedContent));
|
||||
}
|
||||
|
||||
private function getDisplayLength(string $text): string
|
||||
private function getDisplayLength(string $text): int
|
||||
{
|
||||
return Helper::strlenWithoutDecoration($this->getFormatter(), str_replace("\t", ' ', $text));
|
||||
return Helper::width(Helper::removeDecoration($this->getFormatter(), str_replace("\t", ' ', $text)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user