Skip to content

Commit 32354f6

Browse files
Don't use is_resource() on non-streams
1 parent deedcb3 commit 32354f6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Process.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public function start(?callable $callback = null, array $env = [])
352352

353353
$this->process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options);
354354

355-
if (!\is_resource($this->process)) {
355+
if (!$this->process) {
356356
throw new RuntimeException('Unable to launch a new process.');
357357
}
358358
$this->status = self::STATUS_STARTED;
@@ -1456,8 +1456,9 @@ private function readPipes(bool $blocking, bool $close)
14561456
private function close(): int
14571457
{
14581458
$this->processPipes->close();
1459-
if (\is_resource($this->process)) {
1459+
if ($this->process) {
14601460
proc_close($this->process);
1461+
$this->process = null;
14611462
}
14621463
$this->exitcode = $this->processInformation['exitcode'];
14631464
$this->status = self::STATUS_TERMINATED;

0 commit comments

Comments
 (0)