Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| HttpHeader | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
2.50 | |
0.00% |
0 / 1 |
| requiresActive | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getOptions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\IanaValueObjects\HttpHeader; |
| 3 | |
| 4 | use Apie\Core\Lists\StringSet; |
| 5 | use Apie\Core\ValueObjects\Interfaces\LimitedOptionsInterface; |
| 6 | use Apie\Core\ValueObjects\Interfaces\StringValueObjectInterface; |
| 7 | use Apie\IanaValueObjects\StaticDataValueObject; |
| 8 | |
| 9 | /** |
| 10 | * All message headers (HTTP fields) registered in the IANA HTTP Field Names Registry. |
| 11 | * |
| 12 | * @see https://www.iana.org/assignments/http-fields/http-fields.xhtml |
| 13 | * |
| 14 | * Any header that is not active/valid anymore (e.g. deprecated/obsoleted) can be used as well (for data integrity). |
| 15 | */ |
| 16 | final class HttpHeader implements StringValueObjectInterface, LimitedOptionsInterface |
| 17 | { |
| 18 | use IsHttpHeader, StaticDataValueObject { |
| 19 | IsHttpHeader::convert insteadof StaticDataValueObject; |
| 20 | } |
| 21 | |
| 22 | protected static function requiresActive(): bool |
| 23 | { |
| 24 | return false; |
| 25 | } |
| 26 | |
| 27 | public static function getOptions(): StringSet |
| 28 | { |
| 29 | return new StringSet(array_keys(static::getData())); |
| 30 | } |
| 31 | } |