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:
41
vendor/symfony/console/Style/SymfonyStyle.php
vendored
41
vendor/symfony/console/Style/SymfonyStyle.php
vendored
@@ -306,8 +306,14 @@ class SymfonyStyle extends OutputStyle
|
||||
*/
|
||||
public function writeln($messages, $type = self::OUTPUT_NORMAL)
|
||||
{
|
||||
parent::writeln($messages, $type);
|
||||
$this->bufferedOutput->writeln($this->reduceBuffer($messages), $type);
|
||||
if (!is_iterable($messages)) {
|
||||
$messages = array($messages);
|
||||
}
|
||||
|
||||
foreach ($messages as $message) {
|
||||
parent::writeln($message, $type);
|
||||
$this->writeBuffer($message, true, $type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,8 +321,14 @@ class SymfonyStyle extends OutputStyle
|
||||
*/
|
||||
public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
|
||||
{
|
||||
parent::write($messages, $newline, $type);
|
||||
$this->bufferedOutput->write($this->reduceBuffer($messages), $newline, $type);
|
||||
if (!is_iterable($messages)) {
|
||||
$messages = array($messages);
|
||||
}
|
||||
|
||||
foreach ($messages as $message) {
|
||||
parent::write($message, $newline, $type);
|
||||
$this->writeBuffer($message, $newline, $type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,10 +350,7 @@ class SymfonyStyle extends OutputStyle
|
||||
return new self($this->input, $this->getErrorOutput());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ProgressBar
|
||||
*/
|
||||
private function getProgressBar()
|
||||
private function getProgressBar(): ProgressBar
|
||||
{
|
||||
if (!$this->progressBar) {
|
||||
throw new RuntimeException('The ProgressBar is not started.');
|
||||
@@ -350,18 +359,20 @@ class SymfonyStyle extends OutputStyle
|
||||
return $this->progressBar;
|
||||
}
|
||||
|
||||
private function autoPrependBlock()
|
||||
private function autoPrependBlock(): void
|
||||
{
|
||||
$chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
|
||||
|
||||
if (!isset($chars[0])) {
|
||||
return $this->newLine(); //empty history, so we should start with a new line.
|
||||
$this->newLine(); //empty history, so we should start with a new line.
|
||||
|
||||
return;
|
||||
}
|
||||
//Prepend new line for each non LF chars (This means no blank line was output before)
|
||||
$this->newLine(2 - substr_count($chars, "\n"));
|
||||
}
|
||||
|
||||
private function autoPrependText()
|
||||
private function autoPrependText(): void
|
||||
{
|
||||
$fetched = $this->bufferedOutput->fetch();
|
||||
//Prepend new line if last char isn't EOL:
|
||||
@@ -370,16 +381,14 @@ class SymfonyStyle extends OutputStyle
|
||||
}
|
||||
}
|
||||
|
||||
private function reduceBuffer($messages)
|
||||
private function writeBuffer(string $message, bool $newLine, int $type): void
|
||||
{
|
||||
// We need to know if the two last chars are PHP_EOL
|
||||
// Preserve the last 4 chars inserted (PHP_EOL on windows is two chars) in the history buffer
|
||||
return array_map(function ($value) {
|
||||
return substr($value, -4);
|
||||
}, array_merge(array($this->bufferedOutput->fetch()), (array) $messages));
|
||||
$this->bufferedOutput->write(substr($message, -4), $newLine, $type);
|
||||
}
|
||||
|
||||
private function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false)
|
||||
private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false)
|
||||
{
|
||||
$indentLength = 0;
|
||||
$prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
|
||||
|
Reference in New Issue
Block a user