N°5122 - Update libs to new PHP requirements

This commit is contained in:
Molkobain
2022-08-08 14:10:26 +02:00
parent 30021d9236
commit 57c36d0e51
585 changed files with 62279 additions and 20427 deletions

View File

@@ -1,13 +1,22 @@
<?php
/**
* @see https://github.com/laminas/laminas-stdlib for the canonical source repository
* @copyright https://github.com/laminas/laminas-stdlib/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-stdlib/blob/master/LICENSE.md New BSD License
*/
declare(strict_types=1);
namespace Laminas\Stdlib;
use function function_exists;
use function fwrite;
use function getenv;
use function posix_isatty;
use function preg_replace;
use function sprintf;
use function str_replace;
use const DIRECTORY_SEPARATOR;
use const PHP_EOL;
use const STDERR;
use const STDOUT;
/**
* Utilities for console tooling.
*
@@ -28,31 +37,29 @@ namespace Laminas\Stdlib;
*/
class ConsoleHelper
{
const COLOR_GREEN = "\033[32m";
const COLOR_RED = "\033[31m";
const COLOR_RESET = "\033[0m";
public const COLOR_GREEN = "\033[32m";
public const COLOR_RED = "\033[31m";
public const COLOR_RESET = "\033[0m";
const HIGHLIGHT_INFO = 'info';
const HIGHLIGHT_ERROR = 'error';
public const HIGHLIGHT_INFO = 'info';
public const HIGHLIGHT_ERROR = 'error';
/**
* @var array
* @psalm-var array<ConsoleHelper::HIGHLIGHT_*, ConsoleHelper::COLOR_GREEN|ConsoleHelper::COLOR_RED>
*/
private $highlightMap = [
self::HIGHLIGHT_INFO => self::COLOR_GREEN,
self::HIGHLIGHT_ERROR => self::COLOR_RED,
];
/**
* @var string Exists only for testing.
*/
/** @var string Exists only for testing. */
private $eol = PHP_EOL;
/**
* @var resource Exists only for testing.
*/
/** @var resource Exists only for testing. */
private $stderr = STDERR;
/**
* @var bool
*/
/** @var bool */
private $supportsColor;
/**
@@ -147,7 +154,7 @@ class ConsoleHelper
/**
* Ensure newlines are appropriate for the current terminal.
*
* @param string
* @param string $string
* @return string
*/
private function formatNewlines($string)