Fix code quality with rector [skip ci]

This commit is contained in:
James Cole
2025-11-09 09:08:03 +01:00
parent d2610be790
commit 68183a0a0e
209 changed files with 1021 additions and 1248 deletions

View File

@@ -82,21 +82,21 @@ class RecurrenceRepetition extends Model
protected function recurrenceId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function repetitionSkip(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function weekend(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -91,7 +91,7 @@ class RecurrenceTransaction extends Model
protected function amount(): Attribute
{
return Attribute::make(
get: static fn ($value) => (string)$value,
get: static fn ($value): string => (string)$value,
);
}
@@ -110,42 +110,42 @@ class RecurrenceTransaction extends Model
protected function destinationId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function foreignAmount(): Attribute
{
return Attribute::make(
get: static fn ($value) => (string)$value,
get: static fn ($value): string => (string)$value,
);
}
protected function recurrenceId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function sourceId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function transactionCurrencyId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function userId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -58,7 +58,7 @@ class RecurrenceTransactionMeta extends Model
protected function rtId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -113,20 +113,20 @@ class Rule extends Model
protected function description(): Attribute
{
return Attribute::make(set: fn ($value) => ['description' => e($value)]);
return Attribute::make(set: fn ($value): array => ['description' => e($value)]);
}
protected function order(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function ruleGroupId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -80,14 +80,14 @@ class RuleAction extends Model
protected function order(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function ruleId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -99,7 +99,7 @@ class RuleGroup extends Model
protected function order(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -53,14 +53,14 @@ class RuleTrigger extends Model
protected function order(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function ruleId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -113,7 +113,7 @@ class Transaction extends Model
protected function accountId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
@@ -151,14 +151,14 @@ class Transaction extends Model
protected function amount(): Attribute
{
return Attribute::make(
get: static fn ($value) => (string)$value,
get: static fn ($value): string => (string)$value,
);
}
protected function balanceDirty(): Attribute
{
return Attribute::make(
get: static fn ($value) => 1 === (int)$value,
get: static fn ($value): bool => 1 === (int)$value,
);
}
@@ -201,14 +201,14 @@ class Transaction extends Model
protected function foreignAmount(): Attribute
{
return Attribute::make(
get: static fn ($value) => (string)$value,
get: static fn ($value): string => (string)$value,
);
}
protected function transactionJournalId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}

View File

@@ -115,7 +115,7 @@ class TransactionCurrency extends Model
protected function decimalPlaces(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -232,14 +232,14 @@ class TransactionJournal extends Model
protected function order(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function transactionTypeId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}

View File

@@ -94,21 +94,21 @@ class TransactionJournalLink extends Model
protected function destinationId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function linkTypeId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
protected function sourceId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -57,7 +57,7 @@ class TransactionJournalMeta extends Model
protected function data(): Attribute
{
return Attribute::make(get: fn ($value) => json_decode((string)$value, false), set: function ($value) {
return Attribute::make(get: fn ($value): mixed => json_decode((string)$value, false), set: function ($value): array {
$data = json_encode($value);
return ['data' => $data, 'hash' => hash('sha256', $data)];
@@ -67,7 +67,7 @@ class TransactionJournalMeta extends Model
protected function transactionJournalId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -68,7 +68,7 @@ class WebhookAttempt extends Model
protected function webhookMessageId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -41,7 +41,7 @@ class WebhookDelivery extends Model
protected function key(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -89,14 +89,14 @@ class WebhookMessage extends Model
protected function sent(): Attribute
{
return Attribute::make(
get: static fn ($value) => (bool)$value,
get: static fn ($value): bool => (bool)$value,
);
}
protected function webhookId(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -41,7 +41,7 @@ class WebhookResponse extends Model
protected function key(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}

View File

@@ -41,7 +41,7 @@ class WebhookTrigger extends Model
protected function key(): Attribute
{
return Attribute::make(
get: static fn ($value) => (int)$value,
get: static fn ($value): int => (int)$value,
);
}
}