feat: install phpstan and resolving reported errors in PHPStan

This commit is contained in:
amir-ys
2024-11-07 01:41:19 +03:30
parent b7efa6b24a
commit 865d565a91
27 changed files with 1023 additions and 642 deletions
+10 -6
View File
@@ -2,18 +2,22 @@
namespace App\Services\Media;
use Spatie\MediaLibrary\Models\Media;
use Spatie\MediaLibrary\PathGenerator\PathGenerator as BasePathGenerator;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\MediaLibrary\Support\PathGenerator\DefaultPathGenerator;
class PathGenerator implements BasePathGenerator
class PathGenerator extends DefaultPathGenerator
{
/*
* Get the path for the given media, relative to the root storage path.
*/
/**
* @param Media $media
* @return string
*/
public function getPath(Media $media): string
{
return md5($media->id).'/';
return md5($media->id) . '/';
}
/*
@@ -21,7 +25,7 @@ class PathGenerator implements BasePathGenerator
*/
public function getPathForConversions(Media $media): string
{
return $this->getPath($media).'conversions/';
return $this->getPath($media) . 'conversions/';
}
/*
@@ -29,7 +33,7 @@ class PathGenerator implements BasePathGenerator
*/
public function getPathForResponsiveImages(Media $media): string
{
return $this->getPath($media).'responsive-images/';
return $this->getPath($media) . 'responsive-images/';
}
}