Conditions | 4 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function convert(): int | string |
||
18 | { |
||
19 | return match ($this->inputFormat) { |
||
20 | IPAddressFormat::DECIMAL => $this->withDotNotation |
||
21 | ? $this->fromDecimalToDottedBinary($this->address) |
||
22 | : $this->fromDecimalToBinary($this->address), |
||
23 | IPAddressFormat::HEXADECIMAL => $this->withDotNotation |
||
24 | ? $this->fromHexadecimalToDottedBinary($this->address) |
||
25 | : $this->fromHexadecimalToBinary($this->address), |
||
26 | IPAddressFormat::LONG => $this->withDotNotation |
||
27 | ? $this->fromLongToDottedBinary($this->address) |
||
28 | : $this->fromLongToBinary($this->address), |
||
|
|||
29 | default => $this->address, |
||
30 | }; |
||
33 |