| Total Complexity | 8 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | final class DefaultStatuses extends BaseModel implements Statuses |
||
| 15 | { |
||
| 16 | 6 | public function __construct( |
|
| 17 | private string $carrier, |
||
| 18 | private string $carrierId, |
||
| 19 | private StatusCollection $states, |
||
| 20 | ) { |
||
| 21 | 6 | foreach ($states as $status) { |
|
| 22 | 6 | $this->validateCarrierId($status); |
|
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @throws \InvalidArgumentException |
||
| 28 | */ |
||
| 29 | 6 | private function validateCarrierId(Status $item): void |
|
| 37 | ) |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | 4 | public function getCarrier(): string |
|
| 43 | { |
||
| 44 | 4 | return $this->carrier; |
|
| 45 | } |
||
| 46 | |||
| 47 | 1 | public function getCarrierId(): string |
|
| 48 | { |
||
| 49 | 1 | return $this->carrierId; |
|
| 50 | } |
||
| 51 | |||
| 52 | 1 | public function getStates(): StatusCollection |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return array<string,string|array<int,array<string,mixed>>> |
||
| 59 | */ |
||
| 60 | 1 | public function __toArray(): array |
|
| 66 | ]; |
||
| 67 | } |
||
| 68 | } |
||
| 69 |