1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-30 04:19:23 +01:00

Remove unnecessary isset check for stream modes

This commit is contained in:
Niklas Keller 2017-06-18 22:55:44 +02:00
parent 161c73471d
commit 93540890fd
2 changed files with 2 additions and 8 deletions

View File

@ -36,10 +36,7 @@ final class ResourceInputStream implements InputStream {
$meta = \stream_get_meta_data($stream);
if (isset($meta["mode"]) && $meta["mode"] !== ""
&& \strpos($meta["mode"], "r") === false
&& \strpos($meta["mode"], "+") === false
) {
if (\strpos($meta["mode"], "r") === false && \strpos($meta["mode"], "+") === false) {
throw new \Error("Expected a readable stream");
}

View File

@ -38,10 +38,7 @@ final class ResourceOutputStream implements OutputStream {
$meta = \stream_get_meta_data($stream);
if (isset($meta["mode"])
&& \strpos($meta["mode"], "r") !== false
&& \strpos($meta["mode"], "+") === false
) {
if (\strpos($meta["mode"], "r") !== false && \strpos($meta["mode"], "+") === false) {
throw new \Error("Expected a writable stream");
}