| Total Complexity | 11 |
| Total Lines | 100 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class NativeHardcoded implements LocalisationInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Monthes names. |
||
| 15 | * |
||
| 16 | * @var array<string> |
||
| 17 | */ |
||
| 18 | protected static $monthes = [ |
||
| 19 | 'January', |
||
| 20 | 'February', |
||
| 21 | 'March', |
||
| 22 | 'April', |
||
| 23 | 'May', |
||
| 24 | 'June', |
||
| 25 | 'July', |
||
| 26 | 'August', |
||
| 27 | 'September', |
||
| 28 | 'October', |
||
| 29 | 'November', |
||
| 30 | 'December', |
||
| 31 | ]; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Week days names. |
||
| 35 | * |
||
| 36 | * @var array<string> |
||
| 37 | */ |
||
| 38 | protected static $days = [ |
||
| 39 | 'Monday', |
||
| 40 | 'Tuesday', |
||
| 41 | 'Wednesday', |
||
| 42 | 'Thursday', |
||
| 43 | 'Friday', |
||
| 44 | 'Saturday', |
||
| 45 | 'Sunday', |
||
| 46 | ]; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Ordinal labels. |
||
| 50 | * |
||
| 51 | * @var array<string> |
||
| 52 | */ |
||
| 53 | protected static $ordinal = [ |
||
| 54 | 'st', |
||
| 55 | 'nd', |
||
| 56 | 'rd', |
||
| 57 | 'th', |
||
| 58 | ]; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @inheritDoc |
||
| 62 | */ |
||
| 63 | public function getMonthName($month) |
||
| 64 | { |
||
| 65 | if (isset(static::$monthes[$month])) { |
||
| 66 | return static::$monthes[$month]; |
||
| 67 | } |
||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @inheritDoc |
||
| 72 | */ |
||
| 73 | public function getMonthShortName($month) |
||
| 74 | { |
||
| 75 | if (isset(static::$monthes[$month])) { |
||
| 76 | return substr(static::$monthes[$month], 0, 3); |
||
| 77 | } |
||
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @inheritDoc |
||
| 82 | */ |
||
| 83 | public function getDayName($day) |
||
| 84 | { |
||
| 85 | if (isset(static::$days[$day])) { |
||
| 86 | return static::$days[$day]; |
||
| 87 | } |
||
| 88 | } |
||
| 89 | |||
| 90 | |||
| 91 | /** |
||
| 92 | * @inheritDoc |
||
| 93 | */ |
||
| 94 | public function getDayShortName($day) |
||
| 95 | { |
||
| 96 | if (isset(static::$days[$day])) { |
||
| 97 | return substr(static::$days[$day], 0, 3); |
||
| 98 | } |
||
| 99 | } |
||
| 100 | |||
| 101 | /** |
||
| 102 | * @inheritDoc |
||
| 103 | */ |
||
| 104 | public function getNumberOrdinalSuffix($number) |
||
| 111 | } |
||
| 112 | } |
||
| 113 |