Skip to content

Commit

Permalink
fix(files): Ensure that the hash method does not return null
Browse files Browse the repository at this point in the history
  • Loading branch information
artonge committed Jul 1, 2024
1 parent beececf commit 4269166
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ public function fopen($path, $mode) {
return $result;
}

public function hash($type, $path, $raw = false) {
return hash_file($type, $this->getSourcePath($path), $raw);
public function hash($type, $path, $raw = false): string|false {
return hash_file($type, $this->getSourcePath($path), $raw) ?? false;

Check failure on line 403 in lib/private/Files/Storage/Local.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

RedundantCondition

lib/private/Files/Storage/Local.php:403:10: RedundantCondition: Type false|non-empty-string for $<tmp coalesce var>11272 is never null (see https://psalm.dev/122)

Check failure on line 403 in lib/private/Files/Storage/Local.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

TypeDoesNotContainNull

lib/private/Files/Storage/Local.php:403:65: TypeDoesNotContainNull: Cannot resolve types for $<tmp coalesce var>11272 - false|string does not contain null (see https://psalm.dev/090)

Check failure

Code scanning / Psalm

RedundantCondition Error

Type false|non-empty-string for $11272 is never null

Check failure

Code scanning / Psalm

TypeDoesNotContainNull Error

Cannot resolve types for $11272 - false|string does not contain null
}

public function free_space($path) {
Expand Down

0 comments on commit 4269166

Please sign in to comment.