Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fix phpstan lvl5 error for AwsS3 adapter #713

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
Loading