Total Complexity | 6 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
22 | class Variant implements VariantInterface |
||
23 | { |
||
24 | protected string $name = ''; |
||
25 | protected array $operations = []; |
||
26 | protected string $path = ''; |
||
27 | protected string $url = ''; |
||
28 | |||
29 | /** |
||
30 | * @return array |
||
31 | */ |
||
32 | 1 | public function toArray(): array |
|
39 | ]; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | 2 | public function name(): string |
|
46 | { |
||
47 | 2 | return $this->name; |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function path(): string |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return bool |
||
60 | */ |
||
61 | 1 | public function hasOperations(): bool |
|
62 | { |
||
63 | 1 | return count($this->operations) > 0; |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param string $url Path |
||
68 | * @return self |
||
69 | */ |
||
70 | 1 | public function withUrl(string $url): self |
|
76 | } |
||
77 | |||
78 | /** |
||
79 | * @param string $path Path |
||
80 | * @return self |
||
81 | */ |
||
82 | 1 | public function withPath(string $path): self |
|
90 |