Level 7 yay!

This commit is contained in:
James Cole
2025-01-04 19:43:58 +01:00
parent 1aa8ebe57f
commit 0f69e0d672
27 changed files with 76 additions and 76 deletions

View File

@@ -107,7 +107,7 @@ class AccountRepository implements AccountRepositoryInterface
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
->where('accounts.active', true)
->where(
static function (EloquentBuilder $q1) use ($number): void { // @phpstan-ignore-line
static function (EloquentBuilder $q1) use ($number): void {
$json = json_encode($number);
$q1->where('account_meta.name', '=', 'account_number');
$q1->where('account_meta.data', '=', $json);
@@ -188,7 +188,7 @@ class AccountRepository implements AccountRepositoryInterface
{
$query = $this->user->accounts()->with(
[ // @phpstan-ignore-line
'accountmeta' => static function (HasMany $query): void { // @phpstan-ignore-line
'accountmeta' => static function (HasMany $query): void {
$query->where('name', 'account_role');
},
'attachments',
@@ -260,7 +260,7 @@ class AccountRepository implements AccountRepositoryInterface
{
$query = $this->user->accounts()->with(
[ // @phpstan-ignore-line
'accountmeta' => static function (HasMany $query): void { // @phpstan-ignore-line
'accountmeta' => static function (HasMany $query): void {
$query->where('name', 'account_role');
},
]
@@ -617,7 +617,7 @@ class AccountRepository implements AccountRepositoryInterface
foreach ($parts as $part) {
$search = sprintf('%%%s%%', $part);
$dbQuery->where(
static function (EloquentBuilder $q1) use ($search): void { // @phpstan-ignore-line
static function (EloquentBuilder $q1) use ($search): void {
$q1->whereLike('accounts.iban', $search);
$q1->orWhere(
static function (EloquentBuilder $q2) use ($search): void {

View File

@@ -36,7 +36,7 @@ class ALERepository implements ALERepositoryInterface
public function getForObject(Model $model): Collection
{
// all Models have an ID.
return AuditLogEntry::where('auditable_id', $model->id)->where('auditable_type', get_class($model))->get(); // @phpstan-ignore-line
return AuditLogEntry::where('auditable_id', $model->id)->where('auditable_type', get_class($model))->get();
}
public function store(array $data): AuditLogEntry

View File

@@ -67,7 +67,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
$query = $this->user->availableBudgets()->with(['transactionCurrency']);
if (null !== $start && null !== $end) {
$query->where(
static function (Builder $q1) use ($start, $end): void { // @phpstan-ignore-line
static function (Builder $q1) use ($start, $end): void {
$q1->where('start_date', '=', $start->format('Y-m-d'));
$q1->where('end_date', '=', $end->format('Y-m-d'));
}

View File

@@ -223,7 +223,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
// when both dates are set:
return $budget->budgetlimits()
->where(
static function (Builder $q5) use ($start, $end): void { // @phpstan-ignore-line
static function (Builder $q5) use ($start, $end): void {
$q5->where(
static function (Builder $q1) use ($start, $end): void {
// budget limit ends within period

View File

@@ -156,7 +156,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
$current['file_exists'] = true;
$current['notes'] = $repository->getNoteText($attachment);
// already determined that this attachable is a TransactionJournal.
$current['journal_title'] = $attachment->attachable->description; // @phpstan-ignore-line
$current['journal_title'] = $attachment->attachable->description;
$result[$journalId][] = $current;
}
@@ -220,7 +220,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
'link' => $entry->outward,
'group' => $entry->destination->transaction_group_id,
'description' => $entry->destination->description,
'editable' => 1 === (int) $entry->editable, // @phpstan-ignore-line
'editable' => 1 === (int) $entry->editable,
'amount' => $amount,
'foreign_amount' => $foreignAmount,
];
@@ -233,7 +233,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
'link' => $entry->inward,
'group' => $entry->source->transaction_group_id,
'description' => $entry->source->description,
'editable' => 1 === (int) $entry->editable, // @phpstan-ignore-line
'editable' => 1 === (int) $entry->editable,
'amount' => $amount,
'foreign_amount' => $foreignAmount,
];

View File

@@ -63,7 +63,7 @@ class AccountRepository implements AccountRepositoryInterface
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
->where('accounts.active', true)
->where(
static function (EloquentBuilder $q1) use ($number): void { // @phpstan-ignore-line
static function (EloquentBuilder $q1) use ($number): void {
$json = json_encode($number);
$q1->where('account_meta.name', '=', 'account_number');
$q1->where('account_meta.data', '=', $json);