Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
80.00% |
4 / 5 |
|
80.00% |
4 / 5 |
CRAP | |
0.00% |
0 / 1 |
| PortNumberAndTransport | |
80.00% |
4 / 5 |
|
80.00% |
4 / 5 |
5.20 | |
0.00% |
0 / 1 |
| requiresActive | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getDescription | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getServiceName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isActive | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\IanaValueObjects\PortNumber; |
| 3 | |
| 4 | use Apie\Core\ValueObjects\Interfaces\StringValueObjectInterface; |
| 5 | use Apie\IanaValueObjects\StaticDataValueObject; |
| 6 | |
| 7 | class PortNumberAndTransport implements StringValueObjectInterface |
| 8 | { |
| 9 | use StaticDataValueObject; |
| 10 | |
| 11 | protected static function requiresActive(): bool |
| 12 | { |
| 13 | return false; |
| 14 | } |
| 15 | |
| 16 | public function getDescription(): string |
| 17 | { |
| 18 | return $this->getFieldValue('Description'); |
| 19 | } |
| 20 | |
| 21 | public function getServiceName(): string |
| 22 | { |
| 23 | return $this->getFieldValue('Service Name'); |
| 24 | } |
| 25 | |
| 26 | public function isActive(): bool |
| 27 | { |
| 28 | return (bool) $this->getFieldValue('Active'); |
| 29 | } |
| 30 | |
| 31 | protected static function getData(): array |
| 32 | { |
| 33 | return require __DIR__ . '/../../fixtures/port-numbers.php'; |
| 34 | } |
| 35 | } |