Aggiornato Composer
This commit is contained in:
44
vendor/symfony/var-dumper/Dumper/CliDumper.php
vendored
44
vendor/symfony/var-dumper/Dumper/CliDumper.php
vendored
@@ -64,7 +64,7 @@ class CliDumper extends AbstractDumper
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct($output = null, string $charset = null, int $flags = 0)
|
||||
public function __construct($output = null, ?string $charset = null, int $flags = 0)
|
||||
{
|
||||
parent::__construct($output, $charset, $flags);
|
||||
|
||||
@@ -83,7 +83,7 @@ class CliDumper extends AbstractDumper
|
||||
]);
|
||||
}
|
||||
|
||||
$this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
|
||||
$this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,6 +128,7 @@ class CliDumper extends AbstractDumper
|
||||
public function dumpScalar(Cursor $cursor, string $type, $value)
|
||||
{
|
||||
$this->dumpKey($cursor);
|
||||
$this->collapseNextHash = $this->expandNextHash = false;
|
||||
|
||||
$style = 'const';
|
||||
$attr = $cursor->attr;
|
||||
@@ -191,6 +192,7 @@ class CliDumper extends AbstractDumper
|
||||
public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut)
|
||||
{
|
||||
$this->dumpKey($cursor);
|
||||
$this->collapseNextHash = $this->expandNextHash = false;
|
||||
$attr = $cursor->attr;
|
||||
|
||||
if ($bin) {
|
||||
@@ -198,6 +200,9 @@ class CliDumper extends AbstractDumper
|
||||
}
|
||||
if ('' === $str) {
|
||||
$this->line .= '""';
|
||||
if ($cut) {
|
||||
$this->line .= '…'.$cut;
|
||||
}
|
||||
$this->endValue($cursor);
|
||||
} else {
|
||||
$attr += [
|
||||
@@ -283,6 +288,7 @@ class CliDumper extends AbstractDumper
|
||||
}
|
||||
|
||||
$this->dumpKey($cursor);
|
||||
$this->expandNextHash = false;
|
||||
$attr = $cursor->attr;
|
||||
|
||||
if ($this->collapseNextHash) {
|
||||
@@ -445,7 +451,8 @@ class CliDumper extends AbstractDumper
|
||||
|
||||
if (null === $this->handlesHrefGracefully) {
|
||||
$this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR')
|
||||
&& (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100);
|
||||
&& (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100)
|
||||
&& !isset($_SERVER['IDEA_INITIAL_DIRECTORY']);
|
||||
}
|
||||
|
||||
if (isset($attr['ellipsis'], $attr['ellipsis-type'])) {
|
||||
@@ -557,6 +564,10 @@ class CliDumper extends AbstractDumper
|
||||
*/
|
||||
protected function dumpLine(int $depth, bool $endOfValue = false)
|
||||
{
|
||||
if (null === $this->colors) {
|
||||
$this->colors = $this->supportsColors();
|
||||
}
|
||||
|
||||
if ($this->colors) {
|
||||
$this->line = sprintf("\033[%sm%s\033[m", $this->styles['default'], $this->line);
|
||||
}
|
||||
@@ -599,19 +610,30 @@ class CliDumper extends AbstractDumper
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('Hyper' === getenv('TERM_PROGRAM')) {
|
||||
// Detect msysgit/mingw and assume this is a tty because detection
|
||||
// does not work correctly, see https://github.com/composer/composer/issues/9690
|
||||
if (!@stream_isatty($stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($stream)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (\DIRECTORY_SEPARATOR === '\\') {
|
||||
return (\function_exists('sapi_windows_vt100_support')
|
||||
&& @sapi_windows_vt100_support($stream))
|
||||
|| false !== getenv('ANSICON')
|
||||
|| 'ON' === getenv('ConEmuANSI')
|
||||
|| 'xterm' === getenv('TERM');
|
||||
if ('Hyper' === getenv('TERM_PROGRAM')
|
||||
|| false !== getenv('COLORTERM')
|
||||
|| false !== getenv('ANSICON')
|
||||
|| 'ON' === getenv('ConEmuANSI')
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return stream_isatty($stream);
|
||||
if ('dumb' === $term = (string) getenv('TERM')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
|
||||
return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user