1
0
mirror of https://github.com/danog/process.git synced 2025-01-22 13:51:43 +01:00

Use close() on object instead of fclose() on resource

This commit is contained in:
Aaron Piotrowski 2017-11-08 21:34:11 -06:00
parent 5aa6040fcf
commit c07c27f882
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -94,16 +94,16 @@ class Process {
Loop::cancel($this->watcher);
}
if ($this->stdin && \is_resource($resource = $this->stdin->getResource())) {
\fclose($resource);
if ($this->stdin) {
$this->stdin->close();
}
if ($this->stdout && \is_resource($resource = $this->stdout->getResource())) {
\fclose($resource);
if ($this->stdout) {
$this->stdout->close();
}
if ($this->stderr && \is_resource($resource = $this->stderr->getResource())) {
\fclose($resource);
if ($this->stderr) {
$this->stderr->close();
}
if (\is_resource($this->process)) {