mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 11:31:06 +03:30
feat: install phpstan and resolving reported errors in PHPStan
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
namespace App\Services\Media\UrlGenerator;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Spatie\MediaLibrary\UrlGenerator\BaseUrlGenerator;
|
||||
use Spatie\MediaLibrary\Exceptions\UrlCannotBeDetermined;
|
||||
use Spatie\MediaLibrary\MediaCollections\Exceptions\InvalidUrlGenerator;
|
||||
use Spatie\MediaLibrary\Support\UrlGenerator\BaseUrlGenerator;
|
||||
|
||||
class FtpUrlGenerator extends BaseUrlGenerator
|
||||
{
|
||||
@@ -15,7 +15,7 @@ class FtpUrlGenerator extends BaseUrlGenerator
|
||||
*/
|
||||
public function getUrl(): string
|
||||
{
|
||||
return config( 'media-library.wm-cdn' ) . '/' . $this->getPathRelativeToRoot();
|
||||
return config('media-library.wm-cdn') . '/' . $this->getPathRelativeToRoot();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,13 +23,11 @@ class FtpUrlGenerator extends BaseUrlGenerator
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws UrlCannotBeDetermined
|
||||
* @throws InvalidUrlGenerator
|
||||
*/
|
||||
public function getTemporaryUrl( DateTimeInterface $expiration , array $options = [] ): string
|
||||
public function getTemporaryUrl(DateTimeInterface $expiration, array $options = []): string
|
||||
{
|
||||
throw UrlCannotBeDetermined::filesystemDoesNotSupportTemporaryUrls();
|
||||
return 'done';
|
||||
throw new InvalidUrlGenerator();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,7 +36,7 @@ class FtpUrlGenerator extends BaseUrlGenerator
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
public function getPath()
|
||||
public function getPath(): string
|
||||
{
|
||||
return $this->getPathRelativeToRoot();
|
||||
}
|
||||
@@ -50,6 +48,6 @@ class FtpUrlGenerator extends BaseUrlGenerator
|
||||
*/
|
||||
public function getResponsiveImagesDirectoryUrl(): string
|
||||
{
|
||||
return config( 'media-library.wm-cdn' ) . '/' . $this->pathGenerator->getPathForResponsiveImages( $this->media );
|
||||
return config('media-library.wm-cdn') . '/' . $this->pathGenerator->getPathForResponsiveImages($this->media);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user