Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
5 / 5
CRAP
100.00% covered (success)
100.00%
1 / 1
IsHttpStatus
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
5 / 5
6
100.00% covered (success)
100.00%
1 / 1
 getData
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getValue
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDescription
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getReference
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
 isActive
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\IanaValueObjects\HttpStatus;
3
4use Apie\Core\ValueObjects\NonEmptyString;
5
6trait IsHttpStatus
7{
8    protected static function getData(): array
9    {
10        return require __DIR__ . '/../../fixtures/http-status-codes.php';
11    }
12
13    public function getValue(): string
14    {
15        return $this->getFieldValue('Value');
16    }
17
18    public function getDescription(): string
19    {
20        return $this->getFieldValue('Description');
21    }
22
23    public function getReference(): ?NonEmptyString
24    {
25        $reference = $this->getFieldValue('Reference');
26        return $reference ? NonEmptyString::fromNative($reference) : null;
27    }
28
29    public function isActive(): bool
30    {
31        return (bool) $this->getFieldValue('Active');
32    }
33}