mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 03:43:07 +00:00
Clean up some code.
This commit is contained in:
@@ -42,16 +42,11 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
*/
|
||||
class AttachmentHelper implements AttachmentHelperInterface
|
||||
{
|
||||
/** @var Collection All attachments */
|
||||
public $attachments;
|
||||
/** @var MessageBag All errors */
|
||||
public $errors;
|
||||
/** @var MessageBag All messages */
|
||||
public $messages;
|
||||
/** @var array Allowed mimes */
|
||||
protected $allowedMimes = [];
|
||||
/** @var int Max upload size. */
|
||||
protected $maxUploadSize = 0;
|
||||
public Collection $attachments;
|
||||
public MessageBag $errors;
|
||||
public MessageBag $messages;
|
||||
protected array $allowedMimes = [];
|
||||
protected int $maxUploadSize = 0;
|
||||
|
||||
/** @var Filesystem The disk where attachments are stored. */
|
||||
protected $uploadDisk;
|
||||
@@ -204,7 +199,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
public function saveAttachmentsForModel(object $model, ?array $files): bool
|
||||
{
|
||||
if (!($model instanceof Model)) {
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', get_class($model)));
|
||||
@@ -263,7 +258,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
$fileObject->rewind();
|
||||
|
||||
if (0 === $file->getSize()) {
|
||||
throw new FireflyException('Cannot upload empty or non-existent file.');
|
||||
throw new FireflyException('Cannot upload empty or non-existent file.');
|
||||
}
|
||||
|
||||
$content = $fileObject->fread($file->getSize());
|
||||
|
@@ -103,6 +103,9 @@ class InterestingMessage
|
||||
if ('deleted' === $message) {
|
||||
session()->flash('success', (string)trans('firefly.account_deleted', ['name' => $account->name]));
|
||||
}
|
||||
if('created' === $message) {
|
||||
session()->flash('success', (string)trans('firefly.stored_new_account', ['name' => $account->name]));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param Request $request
|
||||
|
Reference in New Issue
Block a user