package and depencies
This commit is contained in:
@@ -20,7 +20,7 @@ use Symfony\Component\Process\Exception\InvalidArgumentException;
|
||||
*/
|
||||
abstract class AbstractPipes implements PipesInterface
|
||||
{
|
||||
public $pipes = [];
|
||||
public array $pipes = [];
|
||||
|
||||
private $inputBuffer = '';
|
||||
private $input;
|
||||
@@ -30,7 +30,7 @@ abstract class AbstractPipes implements PipesInterface
|
||||
/**
|
||||
* @param resource|string|int|float|bool|\Iterator|null $input
|
||||
*/
|
||||
public function __construct($input)
|
||||
public function __construct(mixed $input)
|
||||
{
|
||||
if (\is_resource($input) || $input instanceof \Iterator) {
|
||||
$this->input = $input;
|
||||
@@ -41,9 +41,6 @@ abstract class AbstractPipes implements PipesInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
foreach ($this->pipes as $pipe) {
|
||||
|
19
vendor/symfony/process/Pipes/UnixPipes.php
vendored
19
vendor/symfony/process/Pipes/UnixPipes.php
vendored
@@ -26,7 +26,7 @@ class UnixPipes extends AbstractPipes
|
||||
private $ptyMode;
|
||||
private $haveReadSupport;
|
||||
|
||||
public function __construct(?bool $ttyMode, bool $ptyMode, $input, bool $haveReadSupport)
|
||||
public function __construct(?bool $ttyMode, bool $ptyMode, mixed $input, bool $haveReadSupport)
|
||||
{
|
||||
$this->ttyMode = $ttyMode;
|
||||
$this->ptyMode = $ptyMode;
|
||||
@@ -50,9 +50,6 @@ class UnixPipes extends AbstractPipes
|
||||
$this->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDescriptors(): array
|
||||
{
|
||||
if (!$this->haveReadSupport) {
|
||||
@@ -88,17 +85,11 @@ class UnixPipes extends AbstractPipes
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFiles(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function readAndWrite(bool $blocking, bool $close = false): array
|
||||
{
|
||||
$this->unblock();
|
||||
@@ -109,7 +100,7 @@ class UnixPipes extends AbstractPipes
|
||||
unset($r[0]);
|
||||
|
||||
// let's have a look if something changed in streams
|
||||
set_error_handler([$this, 'handleError']);
|
||||
set_error_handler($this->handleError(...));
|
||||
if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
|
||||
restore_error_handler();
|
||||
// if a system call has been interrupted, forget about it, let's try again
|
||||
@@ -145,17 +136,11 @@ class UnixPipes extends AbstractPipes
|
||||
return $read;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function haveReadSupport(): bool
|
||||
{
|
||||
return $this->haveReadSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function areOpen(): bool
|
||||
{
|
||||
return (bool) $this->pipes;
|
||||
|
20
vendor/symfony/process/Pipes/WindowsPipes.php
vendored
20
vendor/symfony/process/Pipes/WindowsPipes.php
vendored
@@ -35,7 +35,7 @@ class WindowsPipes extends AbstractPipes
|
||||
];
|
||||
private $haveReadSupport;
|
||||
|
||||
public function __construct($input, bool $haveReadSupport)
|
||||
public function __construct(mixed $input, bool $haveReadSupport)
|
||||
{
|
||||
$this->haveReadSupport = $haveReadSupport;
|
||||
|
||||
@@ -103,9 +103,6 @@ class WindowsPipes extends AbstractPipes
|
||||
$this->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDescriptors(): array
|
||||
{
|
||||
if (!$this->haveReadSupport) {
|
||||
@@ -128,17 +125,11 @@ class WindowsPipes extends AbstractPipes
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFiles(): array
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function readAndWrite(bool $blocking, bool $close = false): array
|
||||
{
|
||||
$this->unblock();
|
||||
@@ -171,25 +162,16 @@ class WindowsPipes extends AbstractPipes
|
||||
return $read;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function haveReadSupport(): bool
|
||||
{
|
||||
return $this->haveReadSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function areOpen(): bool
|
||||
{
|
||||
return $this->pipes && $this->fileHandles;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
parent::close();
|
||||
|
Reference in New Issue
Block a user