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

@@ -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,
);
}
}