Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| ActiveLanguage | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
2.50 | |
0.00% |
0 / 1 |
| requiresActive | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\IanaValueObjects; |
| 3 | |
| 4 | use Apie\Core\ValueObjects\Interfaces\StringValueObjectInterface; |
| 5 | |
| 6 | /** |
| 7 | * All language tags registered in the IANA Language Subtag Registry. |
| 8 | * |
| 9 | * This one only contains the main languages, so no regions like "en-US" or "zh-yue" are included. |
| 10 | * @see https://www.iana.org/assignments/language-subtag-registry |
| 11 | * |
| 12 | * Only active languages can be used. |
| 13 | */ |
| 14 | final class ActiveLanguage implements StringValueObjectInterface |
| 15 | { |
| 16 | use IsLanguageSubtag; |
| 17 | |
| 18 | protected static function requiresActive(): bool |
| 19 | { |
| 20 | return true; |
| 21 | } |
| 22 | |
| 23 | protected static function getData(): array |
| 24 | { |
| 25 | return require __DIR__ . '/../fixtures/languages.php'; |
| 26 | } |
| 27 | } |