| Total Complexity | 9 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class UrlSlugField extends InputField |
||
| 8 | { |
||
| 9 | private $urlRecord; |
||
| 10 | |||
| 11 | private $baseUrlSegment; |
||
| 12 | |||
| 13 | 21 | public function setUrlRecord(UrlRecord $urlRecord) |
|
| 14 | { |
||
| 15 | 21 | $this->urlRecord = $urlRecord; |
|
| 16 | |||
| 17 | 21 | return $this; |
|
| 18 | } |
||
| 19 | |||
| 20 | 70 | public function setBaseUrlSegment($baseUrlSegment = null) |
|
| 25 | } |
||
| 26 | |||
| 27 | 5 | public function value() |
|
| 28 | { |
||
| 29 | 5 | return old($this->key, $this->rawSlugValue()); |
|
|
|
|||
| 30 | } |
||
| 31 | |||
| 32 | 5 | private function rawSlugValue(): string |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param $value |
||
| 47 | * @return bool |
||
| 48 | */ |
||
| 49 | 4 | private function startsWithBaseUrlSegment($value): bool |
|
| 52 | } |
||
| 53 | |||
| 54 | 2 | public function toArray(): array |
|
| 65 | } |