package and depencies
This commit is contained in:
34
vendor/symfony/console/Cursor.php
vendored
34
vendor/symfony/console/Cursor.php
vendored
@@ -18,7 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
*/
|
||||
final class Cursor
|
||||
{
|
||||
private $output;
|
||||
private OutputInterface $output;
|
||||
private $input;
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function moveUp(int $lines = 1): self
|
||||
public function moveUp(int $lines = 1): static
|
||||
{
|
||||
$this->output->write(sprintf("\x1b[%dA", $lines));
|
||||
|
||||
@@ -43,7 +43,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function moveDown(int $lines = 1): self
|
||||
public function moveDown(int $lines = 1): static
|
||||
{
|
||||
$this->output->write(sprintf("\x1b[%dB", $lines));
|
||||
|
||||
@@ -53,7 +53,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function moveRight(int $columns = 1): self
|
||||
public function moveRight(int $columns = 1): static
|
||||
{
|
||||
$this->output->write(sprintf("\x1b[%dC", $columns));
|
||||
|
||||
@@ -63,7 +63,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function moveLeft(int $columns = 1): self
|
||||
public function moveLeft(int $columns = 1): static
|
||||
{
|
||||
$this->output->write(sprintf("\x1b[%dD", $columns));
|
||||
|
||||
@@ -73,7 +73,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function moveToColumn(int $column): self
|
||||
public function moveToColumn(int $column): static
|
||||
{
|
||||
$this->output->write(sprintf("\x1b[%dG", $column));
|
||||
|
||||
@@ -83,7 +83,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function moveToPosition(int $column, int $row): self
|
||||
public function moveToPosition(int $column, int $row): static
|
||||
{
|
||||
$this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column));
|
||||
|
||||
@@ -93,7 +93,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function savePosition(): self
|
||||
public function savePosition(): static
|
||||
{
|
||||
$this->output->write("\x1b7");
|
||||
|
||||
@@ -103,7 +103,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function restorePosition(): self
|
||||
public function restorePosition(): static
|
||||
{
|
||||
$this->output->write("\x1b8");
|
||||
|
||||
@@ -113,7 +113,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function hide(): self
|
||||
public function hide(): static
|
||||
{
|
||||
$this->output->write("\x1b[?25l");
|
||||
|
||||
@@ -123,7 +123,7 @@ final class Cursor
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function show(): self
|
||||
public function show(): static
|
||||
{
|
||||
$this->output->write("\x1b[?25h\x1b[?0c");
|
||||
|
||||
@@ -135,7 +135,7 @@ final class Cursor
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function clearLine(): self
|
||||
public function clearLine(): static
|
||||
{
|
||||
$this->output->write("\x1b[2K");
|
||||
|
||||
@@ -157,7 +157,7 @@ final class Cursor
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function clearOutput(): self
|
||||
public function clearOutput(): static
|
||||
{
|
||||
$this->output->write("\x1b[0J");
|
||||
|
||||
@@ -169,7 +169,7 @@ final class Cursor
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function clearScreen(): self
|
||||
public function clearScreen(): static
|
||||
{
|
||||
$this->output->write("\x1b[2J");
|
||||
|
||||
@@ -183,11 +183,7 @@ final class Cursor
|
||||
{
|
||||
static $isTtySupported;
|
||||
|
||||
if (null === $isTtySupported && \function_exists('proc_open')) {
|
||||
$isTtySupported = (bool) @proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes);
|
||||
}
|
||||
|
||||
if (!$isTtySupported) {
|
||||
if (!$isTtySupported ??= '/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT)) {
|
||||
return [1, 1];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user