| Total Complexity | 6 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 |
||
| 46 | } |
||
| 47 | |||
| 48 | public function setOverwriteOnUpdate(bool $flag = true): self |
||
| 53 | } |
||
| 54 | } |
||
| 55 |