mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-16 05:14:35 +02:00
Fixed some more psalm issues.
This commit is contained in:
parent
cb0aa7bc7a
commit
a28e81065f
11 changed files with 25 additions and 18 deletions
|
@ -130,7 +130,7 @@ class AttachmentURLGenerator
|
|||
throw new InvalidArgumentException('Thumbnail creation only works for picture attachments!');
|
||||
}
|
||||
|
||||
if ($attachment->isExternal()) {
|
||||
if ($attachment->isExternal() && !empty($attachment->getURL())) {
|
||||
return $attachment->getURL();
|
||||
}
|
||||
|
||||
|
|
|
@ -43,10 +43,10 @@ declare(strict_types=1);
|
|||
namespace App\Services\Attachments;
|
||||
|
||||
use App\Entity\Attachments\Attachment;
|
||||
use Psr\Cache\InvalidArgumentException;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Contracts\Cache\CacheInterface;
|
||||
use Psr\Cache\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* This service is used to find builtin attachment ressources.
|
||||
|
|
|
@ -174,7 +174,7 @@ class FileTypeFilterTools
|
|||
$extensions = array_merge($extensions, static::IMAGE_EXTS);
|
||||
} elseif ('audio/*' === $element) {
|
||||
$extensions = array_merge($extensions, static::AUDIO_EXTS);
|
||||
} elseif ('image/*' === $element) {
|
||||
} elseif ('video/*' === $element) {
|
||||
$extensions = array_merge($extensions, static::VIDEO_EXTS);
|
||||
} elseif (preg_match('#^[-\w.]+\/[-\w.*]+#', $element)) {
|
||||
$extensions = array_merge($extensions, $this->mimeTypes->getExtensions($element));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue