Skip to content

Commit

Permalink
refactor: fix phpstan lvl5 error for AwsS3 adapter (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroTroller authored Feb 26, 2024
1 parent 45e6f3b commit c2dc7fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
20 changes: 0 additions & 20 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Call to function is_resource\\(\\) with string will always evaluate to false\\.$#"
count: 2
path: src/Gaufrette/Adapter/AwsS3.php

-
message: "#^Method Gaufrette\\\\Adapter\\\\AwsS3\\:\\:write\\(\\) should return bool\\|int but returns string\\.$#"
count: 1
path: src/Gaufrette/Adapter/AwsS3.php

-
message: "#^Method Gaufrette\\\\Adapter\\\\AwsS3\\:\\:size\\(\\) should return int but returns false\\.$#"
count: 1
path: src/Gaufrette/Adapter/AwsS3.php

-
message: "#^Method Gaufrette\\\\Adapter\\\\AwsS3\\:\\:mimeType\\(\\) should return string but returns false\\.$#"
count: 1
path: src/Gaufrette/Adapter/AwsS3.php

-
message: "#^Parameter \\$options of method Gaufrette\\\\Adapter\\\\AzureBlobStorage\\:\\:deleteContainer\\(\\) has invalid typehint type MicrosoftAzure\\\\Storage\\\\Blob\\\\Models\\\\DeleteContainerOptions\\.$#"
count: 2
Expand Down
2 changes: 1 addition & 1 deletion src/Gaufrette/Adapter/AwsS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function mtime(string $key): int|bool
/**
* {@inheritdoc}
*/
public function size(string $key): int
public function size(string $key): bool|int
{
try {
$result = $this->service->headObject($this->getOptions($key));
Expand Down
4 changes: 2 additions & 2 deletions src/Gaufrette/Adapter/SizeCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
interface SizeCalculator
{
/**
* Returns the size of the specified key.
* @return false|int size of the specified key.
*/
public function size(string $key): int;
public function size(string $key): bool|int;
}

0 comments on commit c2dc7fd

Please sign in to comment.