Passed
Pull Request — main (#69)
by Tan
03:05
created

VisitorLog   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 10
c 2
b 1
f 0
dl 0
loc 30
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A viewable() 0 3 1
1
<?php
2
3
namespace CSlant\Blog\Api\Models;
4
5
use Carbon\Carbon;
6
use CSlant\Blog\Core\Models\Post;
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Database\Eloquent\Relations\MorphTo;
9
use Illuminate\Database\Eloquent\Relations\MorphToMany;
10
11
/**
12
 * @property int $id
13
 * @property string $viewable_type
14
 * @property int $viewable_id
15
 * @property string $ip_address
16
 * @property null|string $user_agent
17
 * @property Carbon $expired_at
18
 * @property Carbon $created_at
19
 * @property Carbon $updated_at
20
 */
21
class VisitorLog extends Model
22
{
23
    /**
24
     * The attributes that are mass assignable.
25
     *
26
     * @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...
27
     */
28
    protected $fillable = [
29
        'viewable_type',
30
        'viewable_id',
31
        'ip_address',
32
        'user_agent',
33
        'expired_at',
34
    ];
35
36
    /**
37
     * The attributes that should be cast.
38
     *
39
     * @var array<string, string>
40
     */
41
    protected $casts = [
42
        'expired_at' => 'datetime',
43
    ];
44
45
    /**
46
     * @return MorphTo<Model, $this>
47
     */
48
    public function viewable(): MorphTo
49
    {
50
        return $this->morphTo();
51
    }
52
}
53