Fix phpstan issues.

This commit is contained in:
James Cole
2023-11-05 19:55:39 +01:00
parent 1d2e95f5af
commit 6f6b8d9b3e
33 changed files with 151 additions and 69 deletions

View File

@@ -55,7 +55,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property string|null $iban
* @property bool $active
* @property bool $encrypted
* @property int|string $order
* @property int $order
* @property-read Collection|AccountMeta[] $accountMeta
* @property-read int|null $account_meta_count
* @property AccountType $accountType
@@ -324,4 +324,14 @@ class Account extends Model
);
}
/**
* @return Attribute
*/
protected function order(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}

View File

@@ -62,7 +62,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property bool $active
* @property bool $name_encrypted
* @property bool $match_encrypted
* @property int|string $order
* @property int $order
* @property-read Collection|Attachment[] $attachments
* @property-read int|null $attachments_count
* @property-read Collection|Note[] $notes
@@ -269,5 +269,15 @@ class Bill extends Model
);
}
/**
* @return Attribute
*/
protected function order(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}

View File

@@ -28,6 +28,7 @@ use Eloquent;
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -49,7 +50,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property string $name
* @property bool $active
* @property bool $encrypted
* @property int|string $order
* @property int $order
* @property-read Collection|Attachment[] $attachments
* @property-read int|null $attachments_count
* @property-read Collection|AutoBudget[] $autoBudgets
@@ -180,6 +181,14 @@ class Budget extends Model
{
return $this->belongsToMany(Transaction::class, 'budget_transaction', 'budget_id');
}
/**
* @return Attribute
*/
protected function order(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}

View File

@@ -48,7 +48,7 @@ use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
* @property string $targetamount
* @property Carbon|null $startdate
* @property Carbon|null $targetdate
* @property int|string $order
* @property int $order
* @property bool $active
* @property bool $encrypted
* @property-read Account $account
@@ -203,4 +203,15 @@ class PiggyBank extends Model
get: static fn($value) => (int)$value,
);
}
/**
* @return Attribute
*/
protected function order(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}

View File

@@ -39,7 +39,7 @@ use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
* @property int $rule_id
* @property string|null $action_type
* @property string|null $action_value
* @property int|string $order
* @property int $order
* @property bool $active
* @property bool $stop_processing
* @property-read Rule $rule
@@ -90,4 +90,15 @@ class RuleAction extends Model
get: static fn($value) => (int)$value,
);
}
/**
* @return Attribute
*/
protected function order(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}

View File

@@ -27,6 +27,7 @@ use Carbon\Carbon;
use Eloquent;
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -45,7 +46,7 @@ use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
* @property int $user_id
* @property string|null $title
* @property string|null $description
* @property int|string $order
* @property int $order
* @property bool $active
* @property bool $stop_processing
* @property Collection|Rule[] $rules
@@ -129,4 +130,14 @@ class RuleGroup extends Model
{
return $this->hasMany(Rule::class);
}
/**
* @return Attribute
*/
protected function order(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}

View File

@@ -39,7 +39,7 @@ use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
* @property int $rule_id
* @property string|null $trigger_type
* @property string|null $trigger_value
* @property int|string $order
* @property int $order
* @property bool $active
* @property bool $stop_processing
* @property-read Rule $rule
@@ -90,4 +90,15 @@ class RuleTrigger extends Model
get: static fn($value) => (int)$value,
);
}
/**
* @return Attribute
*/
protected function order(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}

View File

@@ -404,4 +404,13 @@ class TransactionJournal extends Model
get: static fn($value) => (int)$value,
);
}
/**
* @return Attribute
*/
protected function order(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}