Clean up some code.

This commit is contained in:
James Cole
2021-04-08 10:13:35 +02:00
parent a0c98c7d9f
commit 115639a004
3 changed files with 12 additions and 23 deletions

View File

@@ -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());

View File

@@ -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