Skip to content

Commit

Permalink
tweak: improve static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Oct 15, 2024
1 parent 6334819 commit 1c6e38e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Header/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ protected function pregMatchProtocol(string $matchName):string {
$headerLine,
$matches
);
/** @var array<int|string, string> $matches */

return $matches[$matchName];
}
}
2 changes: 1 addition & 1 deletion src/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function read(int $length):string {
throw new StreamException("Stream is not readable");
}

if($length < 0) {
if($length <= 0) {
throw new StreamException("Stream read length must be positive");
}

Expand Down

0 comments on commit 1c6e38e

Please sign in to comment.