Skip to content

Commit

Permalink
Merge pull request #154 from l0gicgate/FixFstatBoolBug
Browse files Browse the repository at this point in the history
Fix Fstat() assertion
  • Loading branch information
l0gicgate committed May 1, 2020
2 parents 316ff1c + ac8ef9c commit 3c76899
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use function fstat;
use function ftell;
use function fwrite;
use function is_array;
use function is_resource;
use function is_string;
use function pclose;
Expand Down Expand Up @@ -408,7 +409,7 @@ public function isPipe(): bool
if ($this->stream) {
$stats = fstat($this->stream);

if ($stats) {
if (is_array($stats)) {
$this->isPipe = isset($stats['mode']) && ($stats['mode'] & self::FSTAT_MODE_S_IFIFO) !== 0;
}
}
Expand Down

0 comments on commit 3c76899

Please sign in to comment.