Fixed some inspection issues

This commit is contained in:
Jan Böhmer 2022-12-18 19:45:04 +01:00
parent c6f1758a18
commit 8ae4e9fe05
39 changed files with 46 additions and 56 deletions

View file

@ -166,16 +166,11 @@ class EntityURLGenerator
public function viewURL(Attachment $entity): ?string
{
if ($entity instanceof Attachment) {
if ($entity->isExternal()) { //For external attachments, return the link to external path
return $entity->getURL();
}
//return $this->urlGenerator->generate('attachment_view', ['id' => $entity->getID()]);
return $this->attachmentURLGenerator->getViewURL($entity);
if ($entity->isExternal()) { //For external attachments, return the link to external path
return $entity->getURL();
}
//Otherwise throw an error
throw new EntityNotSupportedException('The given entity is not supported yet!');
//return $this->urlGenerator->generate('attachment_view', ['id' => $entity->getID()]);
return $this->attachmentURLGenerator->getViewURL($entity);
}
public function downloadURL($entity): ?string