Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/process/Pipes/AbstractPipes.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | c2387f117808 |
children |
line wrap: on
line diff
--- a/vendor/symfony/process/Pipes/AbstractPipes.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/symfony/process/Pipes/AbstractPipes.php Thu Feb 28 13:21:36 2019 +0000 @@ -20,7 +20,7 @@ */ abstract class AbstractPipes implements PipesInterface { - public $pipes = array(); + public $pipes = []; private $inputBuffer = ''; private $input; @@ -32,9 +32,9 @@ */ public function __construct($input) { - if (is_resource($input) || $input instanceof \Iterator) { + if (\is_resource($input) || $input instanceof \Iterator) { $this->input = $input; - } elseif (is_string($input)) { + } elseif (\is_string($input)) { $this->inputBuffer = $input; } else { $this->inputBuffer = (string) $input; @@ -49,7 +49,7 @@ foreach ($this->pipes as $pipe) { fclose($pipe); } - $this->pipes = array(); + $this->pipes = []; } /** @@ -78,7 +78,7 @@ foreach ($this->pipes as $pipe) { stream_set_blocking($pipe, 0); } - if (is_resource($this->input)) { + if (\is_resource($this->input)) { stream_set_blocking($this->input, 0); } @@ -100,12 +100,12 @@ if ($input instanceof \Iterator) { if (!$input->valid()) { $input = null; - } elseif (is_resource($input = $input->current())) { + } elseif (\is_resource($input = $input->current())) { stream_set_blocking($input, 0); } elseif (!isset($this->inputBuffer[0])) { - if (!is_string($input)) { + if (!\is_string($input)) { if (!is_scalar($input)) { - throw new InvalidArgumentException(sprintf('%s yielded a value of type "%s", but only scalars and stream resources are supported', get_class($this->input), gettype($input))); + throw new InvalidArgumentException(sprintf('%s yielded a value of type "%s", but only scalars and stream resources are supported', \get_class($this->input), \gettype($input))); } $input = (string) $input; } @@ -117,8 +117,8 @@ } } - $r = $e = array(); - $w = array($this->pipes[0]); + $r = $e = []; + $w = [$this->pipes[0]]; // let's have a look if something changed in streams if (false === @stream_select($r, $w, $e, 0, 0)) { @@ -130,7 +130,7 @@ $written = fwrite($stdin, $this->inputBuffer); $this->inputBuffer = substr($this->inputBuffer, $written); if (isset($this->inputBuffer[0])) { - return array($this->pipes[0]); + return [$this->pipes[0]]; } } @@ -145,7 +145,7 @@ if (isset($data[0])) { $this->inputBuffer = $data; - return array($this->pipes[0]); + return [$this->pipes[0]]; } } if (feof($input)) { @@ -164,7 +164,7 @@ fclose($this->pipes[0]); unset($this->pipes[0]); } elseif (!$w) { - return array($this->pipes[0]); + return [$this->pipes[0]]; } }