Fix all level 2 issues.

This commit is contained in:
James Cole
2023-11-05 09:40:45 +01:00
parent 9002365e6d
commit 1b978d41e0
32 changed files with 53 additions and 56 deletions

View File

@@ -250,7 +250,7 @@ class AccountRepository implements AccountRepositoryInterface
static function (Attachment $attachment) use ($disk) {
$notes = $attachment->notes()->first();
$attachment->file_exists = $disk->exists($attachment->fileName());
$attachment->notes_text = $notes ? $notes->text : '';
$attachment->notes_text = null !== $notes ? $notes->text : '';
return $attachment;
}

View File

@@ -199,7 +199,7 @@ class BillRepository implements BillRepositoryInterface
static function (Attachment $attachment) use ($disk) {
$notes = $attachment->notes()->first();
$attachment->file_exists = $disk->exists($attachment->fileName());
$attachment->notes_text = $notes ? $notes->text : '';
$attachment->notes_text = null !== $notes ? $notes->text : '';
return $attachment;
}
@@ -373,12 +373,12 @@ class BillRepository implements BillRepositoryInterface
return $bill->transactionJournals()
->before($end)->after($start)->get(
[
[
'transaction_journals.id',
'transaction_journals.date',
'transaction_journals.transaction_group_id',
]
);
);
}
/**

View File

@@ -589,7 +589,7 @@ class BudgetRepository implements BudgetRepositoryInterface
static function (Attachment $attachment) use ($disk) {
$notes = $attachment->notes()->first();
$attachment->file_exists = $disk->exists($attachment->fileName());
$attachment->notes_text = $notes ? $notes->text : '';
$attachment->notes_text = null !== $notes ? $notes->text : '';
return $attachment;
}

View File

@@ -306,7 +306,7 @@ class CategoryRepository implements CategoryRepositoryInterface
static function (Attachment $attachment) use ($disk) {
$notes = $attachment->notes()->first();
$attachment->file_exists = $disk->exists($attachment->fileName());
$attachment->notes_text = $notes ? $notes->text : '';
$attachment->notes_text = null !== $notes ? $notes->text : '';
return $attachment;
}

View File

@@ -74,7 +74,7 @@ class JournalAPIRepository implements JournalAPIRepositoryInterface
static function (Attachment $attachment) use ($disk) {
$notes = $attachment->notes()->first();
$attachment->file_exists = $disk->exists($attachment->fileName());
$attachment->notes_text = $notes ? $notes->text : ''; // TODO should not set notes like this.
$attachment->notes_text = null !== $notes ? $notes->text : ''; // TODO should not set notes like this.
return $attachment;
}

View File

@@ -125,7 +125,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
static function (Attachment $attachment) use ($disk) {
$notes = $attachment->notes()->first();
$attachment->file_exists = $disk->exists($attachment->fileName());
$attachment->notes_text = $notes ? $notes->text : '';
$attachment->notes_text = null !== $notes ? $notes->text : '';
return $attachment;
}

View File

@@ -335,7 +335,7 @@ class UserRepository implements UserRepositoryInterface
public function redeemCode(string $code): void
{
$obj = InvitedUser::where('invite_code', $code)->where('redeemed', 0)->first();
if ($obj) {
if (null !== $obj) {
$obj->redeemed = true;
$obj->save();
}