Passed
Push — master ( b755a8...4573fd )
by Gabriel
02:16
created

SeoOptions::setDescriptionField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Giuga\LaravelSeoMetaBox\Traits;
4
5
class SeoOptions
6
{
7
    public bool $hasSlug = false;
8
    public string $slugField;
9
    public string $titleField;
10
    public string $descriptionField;
11
    public bool $overwriteOnUpdate = false;
12
    public string $routePrefix;
13
14
    public static function create(): self
15
    {
16
        return new static();
17
    }
18
19
    public function setSlugField(string $field): self
20
    {
21
        $this->hasSlug = true;
22
        $this->slugField = $field;
23
24
        return $this;
25
    }
26
27
    public function setRoutePrefix(string $prefix): self
28
    {
29
        $this->routePrefix = $prefix;
30
31
        return $this;
32
    }
33
34
    public function setTitleField(string $field): self
35
    {
36
        $this->titleField = $field;
37
38
        return $this;
39
    }
40
41
    public function setDescriptionField(string $field): self
42
    {
43
        $this->descriptionField = $field;
44
45
        return $this;
46
    }
47
48
    public function setOverwriteOnUpdate(bool $flag = true): self
49
    {
50
        $this->overwriteOnUpdate = $flag;
51
52
        return $this;
53
    }
54
}
55