bug #19508 [Process] Fix AbstractPipes::write() for a situation seen on HHVM (at least) (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Process] Fix AbstractPipes::write() for a situation seen on HHVM (at least)

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/composer/composer/issues/5381, https://github.com/composer/composer/issues/5566
| License       | MIT
| Doc PR        | -

Even if I tried with my local hhvm, I can't reproduce the reported issues, yet it looks like some versions of HHVM trigger a notice here.

Commits
-------

2bb2b9b [Process] Fix AbstractPipes::write() for a situation seen on HHVM (at least)
This commit is contained in:
Nicolas Grekas 2016-08-03 08:42:43 +02:00
commit 05c9f6c5db
1 changed files with 1 additions and 3 deletions

View File

@ -134,9 +134,7 @@ abstract class AbstractPipes implements PipesInterface
if (null === $this->input && !isset($this->inputBuffer[0])) {
fclose($this->pipes[0]);
unset($this->pipes[0]);
}
if (!$w) {
} elseif (!$w) {
return array($this->pipes[0]);
}
}