mirror of
https://github.com/danog/byte-stream.git
synced 2024-11-26 20:04:51 +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