updated streamline-setup v2

This commit is contained in:
2025-01-15 08:53:49 -08:00
committed by alec.turner
parent a2ce9248f0
commit 4b569f81b0
20228 changed files with 2932048 additions and 63204 deletions
@@ -23,10 +23,13 @@ use Symfony\Component\Console\Output\StreamOutput;
*/
class ProcOutputPager extends StreamOutput implements OutputPager
{
private $proc;
private $pipe;
/** @var ?resource */
private $proc = null;
/** @var ?resource */
private $pipe = null;
/** @var resource */
private $stream;
private $cmd;
private string $cmd;
/**
* Constructor.
@@ -22,13 +22,9 @@ class ShellOutput extends ConsoleOutput
{
const NUMBER_LINES = 128;
private $paging = 0;
/** @var OutputPager */
private $pager;
/** @var Theme */
private $theme;
private int $paging = 0;
private OutputPager $pager;
private Theme $theme;
/**
* Construct a ShellOutput instance.
@@ -38,7 +34,7 @@ class ShellOutput extends ConsoleOutput
* @param OutputFormatterInterface|null $formatter (default: null)
* @param string|OutputPager|null $pager (default: null)
*/
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null, $pager = null, $theme = null)
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, ?OutputFormatterInterface $formatter = null, $pager = null, $theme = null)
{
parent::__construct($verbosity, $decorated, $formatter);
@@ -156,7 +152,8 @@ class ShellOutput extends ConsoleOutput
*/
public function doWrite($message, $newline): void
{
if ($this->paging > 0) {
// @todo Update OutputPager interface to require doWrite
if ($this->paging > 0 && $this->pager instanceof ProcOutputPager) {
$this->pager->doWrite($message, $newline);
} else {
parent::doWrite($message, $newline);
@@ -74,16 +74,16 @@ class Theme
const ERROR_STYLES = ['info', 'warning', 'error', 'whisper', 'class'];
private $compact = false;
private bool $compact = false;
private $prompt = '> ';
private $bufferPrompt = '. ';
private $replayPrompt = '- ';
private $returnValue = '= ';
private string $prompt = '> ';
private string $bufferPrompt = '. ';
private string $replayPrompt = '- ';
private string $returnValue = '= ';
private $grayFallback = 'blue';
private string $grayFallback = 'blue';
private $styles = [];
private array $styles = [];
/**
* @param string|array $config theme name or config options