Skip to content

Commit

Permalink
Update psalm baseline and QA
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksei Khudiakov <[email protected]>
  • Loading branch information
Xerkus committed Sep 10, 2024
1 parent b270b28 commit 969d169
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@
<PossiblyNullArgument>
<code><![CDATA[$resource]]></code>
<code><![CDATA[$this->resource]]></code>
<code><![CDATA[$this->resource]]></code>
<code><![CDATA[$this->resource]]></code>
</PossiblyNullArgument>
<PossiblyUnusedProperty>
<code><![CDATA[$stream]]></code>
Expand Down
14 changes: 7 additions & 7 deletions src/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
use function is_resource;
use function is_string;
use function sprintf;
use function str_contains;
use function stream_get_contents;
use function stream_get_meta_data;
use function strstr;

use const SEEK_SET;

Expand Down Expand Up @@ -210,11 +210,11 @@ public function isWritable(): bool
$meta = stream_get_meta_data($this->resource);
$mode = $meta['mode'];

return strstr($mode, 'x') !== false
|| strstr($mode, 'w') !== false
|| strstr($mode, 'c') !== false
|| strstr($mode, 'a') !== false
|| strstr($mode, '+') !== false;
return str_contains($mode, 'x')
|| str_contains($mode, 'w')
|| str_contains($mode, 'c')
|| str_contains($mode, 'a')
|| str_contains($mode, '+');
}

/**
Expand Down Expand Up @@ -251,7 +251,7 @@ public function isReadable(): bool
$meta = stream_get_meta_data($this->resource);
$mode = $meta['mode'];

return strstr($mode, 'r') !== false || strstr($mode, '+') !== false;
return str_contains($mode, 'r') || str_contains($mode, '+');
}

/**
Expand Down

0 comments on commit 969d169

Please sign in to comment.