mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-10 09:18:33 +01:00
Improved typing and phpdoc type annotations
This commit is contained in:
@@ -159,7 +159,7 @@ class EntityURLGenerator
|
||||
public function viewURL(Attachment $entity): string
|
||||
{
|
||||
if ($entity->isExternal()) { //For external attachments, return the link to external path
|
||||
return $entity->getURL();
|
||||
return $entity->getURL() ?? throw new \RuntimeException('External attachment has no URL!');
|
||||
}
|
||||
//return $this->urlGenerator->generate('attachment_view', ['id' => $entity->getID()]);
|
||||
return $this->attachmentURLGenerator->getViewURL($entity) ?? '';
|
||||
@@ -169,7 +169,7 @@ class EntityURLGenerator
|
||||
{
|
||||
if ($entity instanceof Attachment) {
|
||||
if ($entity->isExternal()) { //For external attachments, return the link to external path
|
||||
return $entity->getURL();
|
||||
return $entity->getURL() ?? throw new \RuntimeException('External attachment has no URL!');
|
||||
}
|
||||
|
||||
return $this->attachmentURLGenerator->getDownloadURL($entity);
|
||||
|
||||
Reference in New Issue
Block a user