Passed
Pull Request — main (#69)
by
unknown
05:36 queued 02:49
created

VisitorLog::viewable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 2
b 1
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace CSlant\Blog\Api\Models;
4
5
use Carbon\Carbon;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\Relations\MorphTo;
8
9
/**
10
 * @property int $id
11
 * @property string $viewable_type
12
 * @property int $viewable_id
13
 * @property string $ip_address
14
 * @property null|string $user_agent
15
 * @property Carbon $expired_at
16
 * @property Carbon $created_at
17
 * @property Carbon $updated_at
18
 */
19
class VisitorLog extends Model
20
{
21
    /**
22
     * The attributes that are mass assignable.
23
     *
24
     * @var list<string>
0 ignored issues
show
Bug introduced by
The type CSlant\Blog\Api\Models\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
     */
26
    protected $fillable = [
27
        'viewable_type',
28
        'viewable_id',
29
        'ip_address',
30
        'user_agent',
31
        'expired_at',
32
    ];
33
34
    /**
35
     * The attributes that should be cast.
36
     *
37
     * @var array<string, string>
38
     */
39
    protected $casts = [
40
        'expired_at' => 'datetime',
41
    ];
42
43
    /**
44
     * @return MorphTo<Model, $this>
45
     */
46
    public function viewable(): MorphTo
47
    {
48
        return $this->morphTo();
49
    }
50
}
51