| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | class IpType |
||
| 32 | { |
||
| 33 | public const IP_V4 = 'A'; |
||
| 34 | public const IP_V6 = 'AAAA'; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var string |
||
| 38 | */ |
||
| 39 | private $type; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * IpType constructor. |
||
| 43 | * |
||
| 44 | * @param string $type |
||
| 45 | * |
||
| 46 | * @throws LogicException |
||
| 47 | */ |
||
| 48 | 34 | public function __construct(string $type) |
|
| 49 | { |
||
| 50 | 34 | $this->setType($type); |
|
| 51 | 33 | } |
|
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | 6 | public function getType(): string |
|
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @param string $type |
||
| 63 | * |
||
| 64 | * @return void |
||
| 65 | * @throws LogicException |
||
| 66 | */ |
||
| 67 | 34 | private function setType(string $type): void |
|
| 80 |