Skip to content

Commit

Permalink
Fix phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrkidn committed Aug 5, 2024
1 parent 99add81 commit d30674e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ parameters:
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:search\\(\\).$#"
count: 1
path: src/Resources/AttachmentResource.php
-
message: "#^Call to an undefined method Livewire\\\\Features\\\\SupportFileUploads\\\\TemporaryUploadedFile\\:\\:save\\(\\).$#"
count: 2
path: src/Filament/Actions/Traits/CanUploadAttachment.php
3 changes: 2 additions & 1 deletion src/Formats/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Codedor\MediaLibrary\Models\Attachment;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Str;
use Spatie\Image\Drivers\ImageDriver;

abstract class Format implements Arrayable
{
Expand All @@ -18,7 +19,7 @@ abstract class Format implements Arrayable

protected string $description;

abstract public function definition(): Manipulations;
abstract public function definition(): Manipulations|ImageDriver;

abstract public function registerModelsForFormatter(): void;

Expand Down
3 changes: 2 additions & 1 deletion src/Formats/Thumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Codedor\MediaLibrary\Formats;

use Codedor\MediaLibrary\Models\Attachment;
use Spatie\Image\Drivers\ImageDriver;
use Spatie\Image\Enums\Fit;

class Thumbnail extends Format
Expand All @@ -13,7 +14,7 @@ class Thumbnail extends Format

protected string $description = 'Used in the CMS to display low-res images';

public function definition(): Manipulations
public function definition(): Manipulations|ImageDriver
{
return $this->manipulations->fit(Fit::Crop, 350, 350);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Mixins/UploadedFileMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;

/**
* @mixin UploadedFile
* @mixin TemporaryUploadedFile
*/
class UploadedFileMixin
{
Expand Down

0 comments on commit d30674e

Please sign in to comment.