Auto commit for release 'develop' on 2025-03-14

This commit is contained in:
github-actions
2025-03-14 17:45:16 +01:00
parent f6642c075d
commit fc98d66ef4
90 changed files with 1933 additions and 1840 deletions

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Repositories\Attachment;
use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\AttachmentFactory;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -36,7 +35,6 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Storage;
use League\Flysystem\UnableToDeleteFile;
use LogicException;
/**
* Class AttachmentRepository.
@@ -46,14 +44,14 @@ class AttachmentRepository implements AttachmentRepositoryInterface, UserGroupIn
use UserGroupTrait;
/**
* @throws Exception
* @throws \Exception
*/
public function destroy(Attachment $attachment): bool
{
/** @var AttachmentHelperInterface $helper */
$helper = app(AttachmentHelperInterface::class);
$path = $helper->getAttachmentLocation($attachment);
$path = $helper->getAttachmentLocation($attachment);
try {
Storage::disk('upload')->delete($path);
@@ -120,7 +118,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface, UserGroupIn
/** @var AttachmentFactory $factory */
$factory = app(AttachmentFactory::class);
$factory->setUser($this->user);
$result = $factory->create($data);
$result = $factory->create($data);
if (null === $result) {
throw new FireflyException('Could not store attachment.');
}
@@ -160,14 +158,14 @@ class AttachmentRepository implements AttachmentRepositoryInterface, UserGroupIn
if (null !== $dbNote) {
try {
$dbNote->delete();
} catch (LogicException $e) {
} catch (\LogicException $e) {
app('log')->error($e->getMessage());
}
}
return true;
}
$dbNote = $attachment->notes()->first();
$dbNote = $attachment->notes()->first();
if (null === $dbNote) {
$dbNote = new Note();
$dbNote->noteable()->associate($attachment);