PHP 7.2 specific code.

This commit is contained in:
James Cole
2018-09-23 06:57:37 +02:00
parent fe8f5573d2
commit 6ed31dc4c9
2 changed files with 8 additions and 5 deletions

View File

@@ -182,13 +182,17 @@ class AttachmentHelper implements AttachmentHelperInterface
/**
* Save attachments that get uploaded with models, through the app.
*
* @param Model $model
* @param object $model
* @param array|null $files
*
* @return bool
* @throws \Illuminate\Contracts\Encryption\EncryptException
*/
public function saveAttachmentsForModel(Model $model, ?array $files): bool
public function saveAttachmentsForModel(object $model, ?array $files): bool
{
if(!($model instanceof Model)) {
return false;
}
Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', \get_class($model)));
if (\is_array($files)) {
Log::debug('$files is an array.');

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Attachments;
use FireflyIII\Models\Attachment;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
@@ -84,10 +83,10 @@ interface AttachmentHelperInterface
/**
* Save attachments that got uploaded.
*
* @param Model $model
* @param object $model
* @param null|array $files
*
* @return bool
*/
public function saveAttachmentsForModel(Model $model, ?array $files): bool;
public function saveAttachmentsForModel(object $model, ?array $files): bool;
}