SeoTag   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 2
b 0
f 0
dl 0
loc 34
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrlColumnName() 0 3 1
A getTagsColumnName() 0 3 1
1
<?php
2
3
namespace MichaelRubel\SeoManager\Models;
4
5
use Illuminate\Database\Eloquent\Casts\AsCollection;
6
use Illuminate\Database\Eloquent\Factories\HasFactory;
7
use Illuminate\Database\Eloquent\Model;
8
use MichaelRubel\SeoManager\Contracts\SeoTagContract;
9
10
class SeoTag extends Model implements SeoTagContract
11
{
12
    use HasFactory;
13
14
    /**
15
     * The attributes that aren't mass assignable.
16
     *
17
     * @var array<string>|bool
18
     */
19
    protected $guarded = [];
20
21
    /**
22
     * The attributes that should be cast.
23
     *
24
     * @var array
25
     */
26
    protected $casts = [
27
        'tags' => AsCollection::class,
28
    ];
29
30
    /**
31
     * @return string
32
     */
33 8
    public function getUrlColumnName(): string
34
    {
35 8
        return 'url';
36
    }
37
38
    /**
39
     * @return string
40
     */
41 8
    public function getTagsColumnName(): string
42
    {
43 8
        return 'tags';
44
    }
45
}
46