Skip to content

Commit efe844c

Browse files
committed
Add more european codes
1 parent d8594f4 commit efe844c

File tree

4 files changed

+86
-4
lines changed

4 files changed

+86
-4
lines changed

src/Constants/CountryAll.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,21 @@ class CountryAll
5959
CountryEurope::COUNTRY_CODE_DK => CountryEurope::COUNTRY_NAME_DK,
6060
CountryEurope::COUNTRY_CODE_ES => CountryEurope::COUNTRY_NAME_ES,
6161
CountryEurope::COUNTRY_CODE_FR => CountryEurope::COUNTRY_NAME_FR,
62+
CountryEurope::COUNTRY_CODE_GB => CountryEurope::COUNTRY_NAME_GB,
63+
CountryEurope::COUNTRY_CODE_HR => CountryEurope::COUNTRY_NAME_HR,
64+
CountryEurope::COUNTRY_CODE_HU => CountryEurope::COUNTRY_NAME_HU,
6265
CountryEurope::COUNTRY_CODE_IT => CountryEurope::COUNTRY_NAME_IT,
66+
CountryEurope::COUNTRY_CODE_LI => CountryEurope::COUNTRY_NAME_LI,
67+
CountryEurope::COUNTRY_CODE_MC => CountryEurope::COUNTRY_NAME_MC,
6368
CountryEurope::COUNTRY_CODE_NL => CountryEurope::COUNTRY_NAME_NL,
69+
CountryEurope::COUNTRY_CODE_NO => CountryEurope::COUNTRY_NAME_NO,
6470
CountryEurope::COUNTRY_CODE_LU => CountryEurope::COUNTRY_NAME_LU,
6571
CountryEurope::COUNTRY_CODE_PL => CountryEurope::COUNTRY_NAME_PL,
6672
CountryEurope::COUNTRY_CODE_RS => CountryEurope::COUNTRY_NAME_RS,
73+
CountryEurope::COUNTRY_CODE_SE => CountryEurope::COUNTRY_NAME_SE,
74+
CountryEurope::COUNTRY_CODE_SI => CountryEurope::COUNTRY_NAME_SI,
6775
CountryEurope::COUNTRY_CODE_SK => CountryEurope::COUNTRY_NAME_SK,
76+
CountryEurope::COUNTRY_CODE_VA => CountryEurope::COUNTRY_NAME_VA,
6877

6978
/*
7079
* Pacific

src/Constants/CountryEurope.php

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,21 @@ class CountryEurope
3434
public const COUNTRY_CODE_DK = 'DK';
3535
public const COUNTRY_CODE_ES = 'ES';
3636
public const COUNTRY_CODE_FR = 'FR';
37+
public const COUNTRY_CODE_GB = 'GB';
38+
public const COUNTRY_CODE_HR = 'HR';
39+
public const COUNTRY_CODE_HU = 'HU';
3740
public const COUNTRY_CODE_IT = 'IT';
38-
public const COUNTRY_CODE_NL = 'NL';
41+
public const COUNTRY_CODE_LI = 'LI';
3942
public const COUNTRY_CODE_LU = 'LU';
43+
public const COUNTRY_CODE_MC = 'MC';
44+
public const COUNTRY_CODE_NL = 'NL';
45+
public const COUNTRY_CODE_NO = 'NO';
4046
public const COUNTRY_CODE_PL = 'PL';
4147
public const COUNTRY_CODE_RS = 'RS';
48+
public const COUNTRY_CODE_SE = 'SE';
49+
public const COUNTRY_CODE_SI = 'SI';
4250
public const COUNTRY_CODE_SK = 'SK';
51+
public const COUNTRY_CODE_VA = 'VA';
4352

4453
/*
4554
* Countries Europe
@@ -80,18 +89,42 @@ class CountryEurope
8089
Language::DE_DE => 'Frankreich',
8190
Language::EN_GB => 'France',
8291
];
92+
public const COUNTRY_NAME_GB = [
93+
Language::DE_DE => 'Vereinigtes Königreich',
94+
Language::EN_GB => 'United Kingdom',
95+
];
96+
public const COUNTRY_NAME_HR = [
97+
Language::DE_DE => 'Kroatien',
98+
Language::EN_GB => 'Croatia',
99+
];
100+
public const COUNTRY_NAME_HU = [
101+
Language::DE_DE => 'Ungarn',
102+
Language::EN_GB => 'Hungary',
103+
];
83104
public const COUNTRY_NAME_IT = [
84105
Language::DE_DE => 'Italien',
85106
Language::EN_GB => 'Italy',
86107
];
87-
public const COUNTRY_NAME_NL = [
88-
Language::DE_DE => 'Niederland',
89-
Language::EN_GB => 'Netherlands',
108+
public const COUNTRY_NAME_LI = [
109+
Language::DE_DE => 'Liechtenstein',
110+
Language::EN_GB => 'Liechtenstein',
90111
];
91112
public const COUNTRY_NAME_LU = [
92113
Language::DE_DE => 'Luxemburg',
93114
Language::EN_GB => 'Luxembourg',
94115
];
116+
public const COUNTRY_NAME_MC = [
117+
Language::DE_DE => 'Monaco',
118+
Language::EN_GB => 'Monaco',
119+
];
120+
public const COUNTRY_NAME_NL = [
121+
Language::DE_DE => 'Niederland',
122+
Language::EN_GB => 'Netherlands',
123+
];
124+
public const COUNTRY_NAME_NO = [
125+
Language::DE_DE => 'Norwegen',
126+
Language::EN_GB => 'Norway',
127+
];
95128
public const COUNTRY_NAME_PL = [
96129
Language::DE_DE => 'Polen',
97130
Language::EN_GB => 'Poland',
@@ -100,8 +133,20 @@ class CountryEurope
100133
Language::DE_DE => 'Serbien',
101134
Language::EN_GB => 'Serbia',
102135
];
136+
public const COUNTRY_NAME_SE = [
137+
Language::DE_DE => 'Schweden',
138+
Language::EN_GB => 'Sweden',
139+
];
140+
public const COUNTRY_NAME_SI = [
141+
Language::DE_DE => 'Slovenien',
142+
Language::EN_GB => 'Slovenia',
143+
];
103144
public const COUNTRY_NAME_SK = [
104145
Language::DE_DE => 'Slowakei',
105146
Language::EN_GB => 'Slovakia',
106147
];
148+
public const COUNTRY_NAME_VA = [
149+
Language::DE_DE => 'Vatikanstadt',
150+
Language::EN_GB => 'Vatican City',
151+
];
107152
}

tests/Unit/CountryTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,21 @@ public function dataProvider(): array
123123
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_DK, CountryEurope::COUNTRY_NAME_DK[Language::EN_GB]],
124124
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_ES, CountryEurope::COUNTRY_NAME_ES[Language::EN_GB]],
125125
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_FR, CountryEurope::COUNTRY_NAME_FR[Language::EN_GB]],
126+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_GB, CountryEurope::COUNTRY_NAME_GB[Language::EN_GB]],
126127
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_IT, CountryEurope::COUNTRY_NAME_IT[Language::EN_GB]],
128+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_HR, CountryEurope::COUNTRY_NAME_HR[Language::EN_GB]],
129+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_HU, CountryEurope::COUNTRY_NAME_HU[Language::EN_GB]],
130+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_LI, CountryEurope::COUNTRY_NAME_LI[Language::EN_GB]],
127131
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_LU, CountryEurope::COUNTRY_NAME_LU[Language::EN_GB]],
132+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_MC, CountryEurope::COUNTRY_NAME_MC[Language::EN_GB]],
128133
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_NL, CountryEurope::COUNTRY_NAME_NL[Language::EN_GB]],
134+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_NO, CountryEurope::COUNTRY_NAME_NO[Language::EN_GB]],
129135
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_PL, CountryEurope::COUNTRY_NAME_PL[Language::EN_GB]],
130136
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_RS, CountryEurope::COUNTRY_NAME_RS[Language::EN_GB]],
137+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_SE, CountryEurope::COUNTRY_NAME_SE[Language::EN_GB]],
138+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_SI, CountryEurope::COUNTRY_NAME_SI[Language::EN_GB]],
131139
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_SK, CountryEurope::COUNTRY_NAME_SK[Language::EN_GB]],
140+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_VA, CountryEurope::COUNTRY_NAME_VA[Language::EN_GB]],
132141

133142
/**
134143
* getName: Pacific

tests/Unit/TimezoneTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function wrapper(int $number, string $method, string|null $parameter, str
7272
* Data provider.
7373
*
7474
* @return array<int, array<int, string|int|null>>
75+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
7576
*/
7677
public function dataProvider(): array
7778
{
@@ -122,24 +123,42 @@ public function dataProvider(): array
122123
[++$number, 'getCountryName', Language::DE_DE, 'Europe/Berlin', CountryEurope::COUNTRY_NAME_DE[Language::DE_DE]],
123124
[++$number, 'getCountryCode', null, 'Europe/Bratislava', CountryEurope::COUNTRY_CODE_SK],
124125
[++$number, 'getCountryName', null, 'Europe/Bratislava', CountryEurope::COUNTRY_NAME_SK[Language::EN_GB]],
126+
[++$number, 'getCountryCode', null, 'Europe/Budapest', CountryEurope::COUNTRY_CODE_HU],
127+
[++$number, 'getCountryName', null, 'Europe/Budapest', CountryEurope::COUNTRY_NAME_HU[Language::EN_GB]],
125128
[++$number, 'getCountryCode', null, 'Europe/Brussels', CountryEurope::COUNTRY_CODE_BE],
126129
[++$number, 'getCountryName', null, 'Europe/Brussels', CountryEurope::COUNTRY_NAME_BE[Language::EN_GB]],
127130
[++$number, 'getCountryCode', null, 'Europe/Copenhagen', CountryEurope::COUNTRY_CODE_DK],
128131
[++$number, 'getCountryName', null, 'Europe/Copenhagen', CountryEurope::COUNTRY_NAME_DK[Language::EN_GB]],
132+
[++$number, 'getCountryCode', null, 'Europe/Ljubljana', CountryEurope::COUNTRY_CODE_SI],
133+
[++$number, 'getCountryName', null, 'Europe/Ljubljana', CountryEurope::COUNTRY_NAME_SI[Language::EN_GB]],
134+
[++$number, 'getCountryCode', null, 'Europe/London', CountryEurope::COUNTRY_CODE_GB],
135+
[++$number, 'getCountryName', null, 'Europe/London', CountryEurope::COUNTRY_NAME_GB[Language::EN_GB]],
129136
[++$number, 'getCountryCode', null, 'Europe/Luxembourg', CountryEurope::COUNTRY_CODE_LU],
130137
[++$number, 'getCountryName', null, 'Europe/Luxembourg', CountryEurope::COUNTRY_NAME_LU[Language::EN_GB]],
131138
[++$number, 'getCountryCode', null, 'Europe/Madrid', CountryEurope::COUNTRY_CODE_ES],
132139
[++$number, 'getCountryName', null, 'Europe/Madrid', CountryEurope::COUNTRY_NAME_ES[Language::EN_GB]],
140+
[++$number, 'getCountryCode', null, 'Europe/Monaco', CountryEurope::COUNTRY_CODE_MC],
141+
[++$number, 'getCountryName', null, 'Europe/Monaco', CountryEurope::COUNTRY_NAME_MC[Language::EN_GB]],
133142
[++$number, 'getCountryCode', null, 'Europe/Moscow', CountryAsia::COUNTRY_CODE_RU],
134143
[++$number, 'getCountryName', null, 'Europe/Moscow', CountryAsia::COUNTRY_NAME_RU[Language::EN_GB]],
144+
[++$number, 'getCountryCode', null, 'Europe/Oslo', CountryEurope::COUNTRY_CODE_NO],
145+
[++$number, 'getCountryName', null, 'Europe/Oslo', CountryEurope::COUNTRY_NAME_NO[Language::EN_GB]],
135146
[++$number, 'getCountryCode', null, 'Europe/Paris', CountryEurope::COUNTRY_CODE_FR],
136147
[++$number, 'getCountryName', null, 'Europe/Paris', CountryEurope::COUNTRY_NAME_FR[Language::EN_GB]],
137148
[++$number, 'getCountryCode', null, 'Europe/Prague', CountryEurope::COUNTRY_CODE_CZ],
138149
[++$number, 'getCountryName', null, 'Europe/Prague', CountryEurope::COUNTRY_NAME_CZ[Language::EN_GB]],
139150
[++$number, 'getCountryCode', null, 'Europe/Rome', CountryEurope::COUNTRY_CODE_IT],
140151
[++$number, 'getCountryName', null, 'Europe/Rome', CountryEurope::COUNTRY_NAME_IT[Language::EN_GB]],
152+
[++$number, 'getCountryCode', null, 'Europe/Stockholm', CountryEurope::COUNTRY_CODE_SE],
153+
[++$number, 'getCountryName', null, 'Europe/Stockholm', CountryEurope::COUNTRY_NAME_SE[Language::EN_GB]],
154+
[++$number, 'getCountryCode', null, 'Europe/Vaduz', CountryEurope::COUNTRY_CODE_LI],
155+
[++$number, 'getCountryName', null, 'Europe/Vaduz', CountryEurope::COUNTRY_NAME_LI[Language::EN_GB]],
156+
[++$number, 'getCountryCode', null, 'Europe/Vatican', CountryEurope::COUNTRY_CODE_VA],
157+
[++$number, 'getCountryName', null, 'Europe/Vatican', CountryEurope::COUNTRY_NAME_VA[Language::EN_GB]],
141158
[++$number, 'getCountryCode', null, 'Europe/Warsaw', CountryEurope::COUNTRY_CODE_PL],
142159
[++$number, 'getCountryName', null, 'Europe/Warsaw', CountryEurope::COUNTRY_NAME_PL[Language::EN_GB]],
160+
[++$number, 'getCountryCode', null, 'Europe/Zagreb', CountryEurope::COUNTRY_CODE_HR],
161+
[++$number, 'getCountryName', null, 'Europe/Zagreb', CountryEurope::COUNTRY_NAME_HR[Language::EN_GB]],
143162
[++$number, 'getCountryCode', null, 'Europe/Zurich', CountryEurope::COUNTRY_CODE_CH],
144163
[++$number, 'getCountryName', null, 'Europe/Zurich', CountryEurope::COUNTRY_NAME_CH[Language::EN_GB]],
145164

0 commit comments

Comments
 (0)