Skip to content

Commit

Permalink
shmop_read() no longer can return false
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Aug 19, 2023
1 parent cc440e4 commit f6fe35f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/SharedMemoryParcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,7 @@ private function readSegment(int $offset, int $size): string
\assert($this->handle !== null);

/** @psalm-suppress InvalidArgument Psalm needs to be updated for ext-shmop using objects. */
$data = \shmop_read($this->handle, $offset, $size);
if ($data === false) {
$error = \error_get_last();
throw new ParcelException(
'Failed to read from shared memory block: ' . ($error['message'] ?? 'unknown error')
);
}
return $data;
return \shmop_read($this->handle, $offset, $size);
}

/**
Expand Down

0 comments on commit f6fe35f

Please sign in to comment.