public function doWrite($message, $newline)
{
$pipe = $this->getPipe();
- if (false === @fwrite($pipe, $message . ($newline ? PHP_EOL : ''))) {
+ if (false === @\fwrite($pipe, $message . ($newline ? PHP_EOL : ''))) {
// @codeCoverageIgnoreStart
// should never happen
throw new \RuntimeException('Unable to write output');
// @codeCoverageIgnoreEnd
}
- fflush($pipe);
+ \fflush($pipe);
}
/**
public function close()
{
if (isset($this->pipe)) {
- fclose($this->pipe);
+ \fclose($this->pipe);
}
if (isset($this->proc)) {
- $exit = proc_close($this->proc);
+ $exit = \proc_close($this->proc);
if ($exit !== 0) {
throw new \RuntimeException('Error closing output stream');
}
private function getPipe()
{
if (!isset($this->pipe) || !isset($this->proc)) {
- $desc = [['pipe', 'r'], $this->stream, fopen('php://stderr', 'w')];
- $this->proc = proc_open($this->cmd, $desc, $pipes);
+ $desc = [['pipe', 'r'], $this->stream, \fopen('php://stderr', 'w')];
+ $this->proc = \proc_open($this->cmd, $desc, $pipes);
- if (!is_resource($this->proc)) {
+ if (!\is_resource($this->proc)) {
throw new \RuntimeException('Error opening output stream');
}