Refactor phpstan errors.

This commit is contained in:
James Cole
2023-10-29 17:41:14 +01:00
parent 5e32878d01
commit 12675dd950
60 changed files with 297 additions and 386 deletions

View File

@@ -78,19 +78,17 @@ class AccountMeta extends Model
/**
* @param mixed $value
*
* @return mixed
* @return string
*/
public function getDataAttribute($value): string
public function getDataAttribute(mixed $value): string
{
return (string)json_decode($value, true);
}
/**
* @param mixed $value
*
*/
public function setDataAttribute($value): void
public function setDataAttribute(mixed $value): void
{
$this->attributes['data'] = json_encode($value);
}

View File

@@ -30,6 +30,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Carbon;
@@ -145,7 +146,7 @@ class PiggyBank extends Model
}
/**
* Get all of the piggy bank's notes.
* Get all the piggy bank's notes.
*/
public function notes(): MorphMany
{
@@ -155,7 +156,7 @@ class PiggyBank extends Model
/**
* Get all the tags for the post.
*/
public function objectGroups()
public function objectGroups(): MorphToMany
{
return $this->morphToMany(ObjectGroup::class, 'object_groupable');
}