| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | final class NameField |
||
| 20 | { |
||
| 21 | private string $name; |
||
| 22 | |||
| 23 | public function __construct(string $name) |
||
| 24 | { |
||
| 25 | if (\strlen($name) > 255) { |
||
| 26 | throw new StringExceeds255Characters(); |
||
| 27 | } |
||
| 28 | |||
| 29 | $this->name = $name; |
||
| 30 | } |
||
| 31 | |||
| 32 | public static function fromString(string $name): self |
||
| 33 | { |
||
| 34 | return new self($name); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function getValue(): string |
||
| 40 | } |
||
| 41 | |||
| 42 | public function slugify(): string |
||
| 49 |