PHP 8 Compatibility
This commit is contained in:
13
vendor/symfony/console/Output/StreamOutput.php
vendored
13
vendor/symfony/console/Output/StreamOutput.php
vendored
@@ -12,7 +12,6 @@
|
||||
namespace Symfony\Component\Console\Output;
|
||||
|
||||
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Console\Exception\RuntimeException;
|
||||
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
||||
|
||||
/**
|
||||
@@ -71,13 +70,10 @@ class StreamOutput extends Output
|
||||
protected function doWrite($message, $newline)
|
||||
{
|
||||
if ($newline) {
|
||||
$message .= PHP_EOL;
|
||||
$message .= \PHP_EOL;
|
||||
}
|
||||
|
||||
if (false === @fwrite($this->stream, $message)) {
|
||||
// should never happen
|
||||
throw new RuntimeException('Unable to write output.');
|
||||
}
|
||||
@fwrite($this->stream, $message);
|
||||
|
||||
fflush($this->stream);
|
||||
}
|
||||
@@ -97,6 +93,11 @@ class StreamOutput extends Output
|
||||
*/
|
||||
protected function hasColorSupport()
|
||||
{
|
||||
// Follow https://no-color.org/
|
||||
if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('Hyper' === getenv('TERM_PROGRAM')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user