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:
parent
161c73471d
commit
93540890fd
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user