Issues (8)

app/Models/UserToken.php (1 issue)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Models;
6
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Database\Eloquent\Relations\BelongsTo;
9
10
final class UserToken extends Model
11
{
12
    protected $fillable = [
13
        'token',
14
    ];
15
16 2
    public function user(): BelongsTo
17
    {
18 2
        return $this->belongsTo(User::class);
19
    }
20
21 2
    public function getUser(): User
22
    {
23 2
        return $this->getRelationValue('user');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getRelationValue('user') could return the type null which is incompatible with the type-hinted return App\Models\User. Consider adding an additional type-check to rule them out.
Loading history...
24
    }
25
}
26