Clean up some code

This commit is contained in:
James Cole
2022-12-31 07:33:44 +01:00
parent 27a576ae8a
commit 24696bf800
18 changed files with 29 additions and 26 deletions

View File

@@ -235,7 +235,7 @@ class AttachmentHelper implements AttachmentHelperInterface
$user = $model->user; // @phpstan-ignore-line
// ignore lines about polymorphic calls.
if ($model instanceof PiggyBank) {
$user = $model->account->user; // @phpstan-ignore-line
$user = $model->account->user;
}
$attachment = new Attachment(); // create Attachment object.
@@ -374,7 +374,7 @@ class AttachmentHelper implements AttachmentHelperInterface
$count = 0;
// ignore lines about polymorphic calls.
if ($model instanceof PiggyBank) {
$count = $model->account->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count(); // @phpstan-ignore-line
$count = $model->account->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count();
}
if ($model instanceof PiggyBank) {
$count = $model->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count(); // @phpstan-ignore-line