| Total Complexity | 6 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | class Variant implements VariantInterface |
||
| 23 | { |
||
| 24 | protected string $name = ''; |
||
| 25 | /** |
||
| 26 | * @var array<string, mixed> |
||
| 27 | */ |
||
| 28 | protected array $operations = []; |
||
| 29 | protected string $path = ''; |
||
| 30 | protected string $url = ''; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return array<string, mixed> |
||
| 34 | */ |
||
| 35 | public function toArray(): array |
||
| 42 | ]; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | public function name(): string |
||
| 49 | { |
||
| 50 | return $this->name; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function path(): string |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | public function hasOperations(): bool |
||
| 65 | { |
||
| 66 | return count($this->operations) > 0; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param string $url Path |
||
| 71 | * @return self |
||
| 72 | */ |
||
| 73 | public function withUrl(string $url): self |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @param string $path Path |
||
| 83 | * @return self |
||
| 84 | */ |
||
| 85 | public function withPath(string $path): self |
||
| 93 |