Skip to content

Commit 1c169b1

Browse files
committed
Add more european codes; Refactoring
1 parent b7dac71 commit 1c169b1

File tree

11 files changed

+537
-198
lines changed

11 files changed

+537
-198
lines changed

src/Constants/Country.php

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ixnode/php-timezone project.
5+
*
6+
* (c) Björn Hempel <https://www.hempel.li/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Ixnode\PhpTimezone\Constants;
15+
16+
/**
17+
* Class Country
18+
*
19+
* @author Björn Hempel <bjoern@hempel.li>
20+
* @version 0.1.0 (2023-07-01)
21+
* @since 0.1.0 (2023-07-01) First version.
22+
*/
23+
class Country
24+
{
25+
public const COUNTRY_NAMES = [
26+
/*
27+
* Africa
28+
*/
29+
CountryAfrica::COUNTRY_CODE_CI => CountryAfrica::COUNTRY_NAME_CI,
30+
CountryAfrica::COUNTRY_CODE_GH => CountryAfrica::COUNTRY_NAME_GH,
31+
32+
/*
33+
* America
34+
*/
35+
CountryAmerica::COUNTRY_CODE_AR => CountryAmerica::COUNTRY_NAME_AR,
36+
37+
/*
38+
* Asia
39+
*/
40+
CountryAsia::COUNTRY_CODE_AE => CountryAsia::COUNTRY_NAME_AE,
41+
CountryAsia::COUNTRY_CODE_IN => CountryAsia::COUNTRY_NAME_IN,
42+
CountryAsia::COUNTRY_CODE_KZ => CountryAsia::COUNTRY_NAME_KZ,
43+
CountryAsia::COUNTRY_CODE_RU => CountryAsia::COUNTRY_NAME_RU,
44+
45+
/*
46+
* Australia
47+
*/
48+
CountryAustralia::COUNTRY_CODE_AU => CountryAustralia::COUNTRY_NAME_AU,
49+
50+
/*
51+
* Europe
52+
*/
53+
CountryEurope::COUNTRY_CODE_AD => CountryEurope::COUNTRY_NAME_AD,
54+
CountryEurope::COUNTRY_CODE_AT => CountryEurope::COUNTRY_NAME_AT,
55+
CountryEurope::COUNTRY_CODE_BE => CountryEurope::COUNTRY_NAME_BE,
56+
CountryEurope::COUNTRY_CODE_CH => CountryEurope::COUNTRY_NAME_CH,
57+
CountryEurope::COUNTRY_CODE_CZ => CountryEurope::COUNTRY_NAME_CZ,
58+
CountryEurope::COUNTRY_CODE_DE => CountryEurope::COUNTRY_NAME_DE,
59+
CountryEurope::COUNTRY_CODE_DK => CountryEurope::COUNTRY_NAME_DK,
60+
CountryEurope::COUNTRY_CODE_ES => CountryEurope::COUNTRY_NAME_ES,
61+
CountryEurope::COUNTRY_CODE_FR => CountryEurope::COUNTRY_NAME_FR,
62+
CountryEurope::COUNTRY_CODE_IT => CountryEurope::COUNTRY_NAME_IT,
63+
CountryEurope::COUNTRY_CODE_NL => CountryEurope::COUNTRY_NAME_NL,
64+
CountryEurope::COUNTRY_CODE_LU => CountryEurope::COUNTRY_NAME_LU,
65+
CountryEurope::COUNTRY_CODE_PL => CountryEurope::COUNTRY_NAME_PL,
66+
CountryEurope::COUNTRY_CODE_RS => CountryEurope::COUNTRY_NAME_RS,
67+
CountryEurope::COUNTRY_CODE_SK => CountryEurope::COUNTRY_NAME_SK,
68+
69+
/*
70+
* Pacific
71+
*/
72+
CountryPacific::COUNTRY_CODE_PG => CountryPacific::COUNTRY_NAME_PG,
73+
74+
/*
75+
* Unknown/Invalid
76+
*/
77+
CountryUnknown::COUNTRY_CODE_UK => CountryUnknown::COUNTRY_NAME_UK,
78+
CountryUnknown::COUNTRY_CODE_IV => CountryUnknown::COUNTRY_NAME_IV,
79+
];
80+
}

src/Constants/CountryAfrica.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ixnode/php-timezone project.
5+
*
6+
* (c) Björn Hempel <https://www.hempel.li/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Ixnode\PhpTimezone\Constants;
15+
16+
/**
17+
* Class CountryAfrica
18+
*
19+
* @author Björn Hempel <bjoern@hempel.li>
20+
* @version 0.1.0 (2023-07-01)
21+
* @since 0.1.0 (2023-07-01) First version.
22+
*/
23+
class CountryAfrica
24+
{
25+
/*
26+
* Codes Africa
27+
*/
28+
public const COUNTRY_CODE_CI = 'CI';
29+
public const COUNTRY_CODE_GH = 'GH';
30+
31+
/*
32+
* Countries Africa
33+
*/
34+
public const COUNTRY_NAME_CI = [
35+
Language::DE_DE => 'Elfenbeinküste',
36+
Language::EN_GB => 'Ivory Coast',
37+
];
38+
public const COUNTRY_NAME_GH = [
39+
Language::DE_DE => 'Ghana',
40+
Language::EN_GB => 'Ghana',
41+
];
42+
}

src/Constants/CountryAmerica.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ixnode/php-timezone project.
5+
*
6+
* (c) Björn Hempel <https://www.hempel.li/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Ixnode\PhpTimezone\Constants;
15+
16+
/**
17+
* Class CountryAmerica
18+
*
19+
* @author Björn Hempel <bjoern@hempel.li>
20+
* @version 0.1.0 (2023-07-01)
21+
* @since 0.1.0 (2023-07-01) First version.
22+
*/
23+
class CountryAmerica
24+
{
25+
/*
26+
* Codes America
27+
*/
28+
public const COUNTRY_CODE_AR = 'AR';
29+
30+
/*
31+
* Countries America
32+
*/
33+
public const COUNTRY_NAME_AR = [
34+
Language::DE_DE => 'Argentinien',
35+
Language::EN_GB => 'Argentina',
36+
];
37+
}

src/Constants/CountryAsia.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ixnode/php-timezone project.
5+
*
6+
* (c) Björn Hempel <https://www.hempel.li/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Ixnode\PhpTimezone\Constants;
15+
16+
/**
17+
* Class CountryAsia
18+
*
19+
* @author Björn Hempel <bjoern@hempel.li>
20+
* @version 0.1.0 (2023-07-01)
21+
* @since 0.1.0 (2023-07-01) First version.
22+
*/
23+
class CountryAsia
24+
{
25+
/*
26+
* Codes Asia
27+
*/
28+
public const COUNTRY_CODE_AE = 'AE';
29+
public const COUNTRY_CODE_IN = 'IN';
30+
public const COUNTRY_CODE_KZ = 'KZ';
31+
public const COUNTRY_CODE_RU = 'RU';
32+
33+
/*
34+
* Countries Asia
35+
*/
36+
public const COUNTRY_NAME_AE = [
37+
Language::DE_DE => 'Vereinigte Arabische Emirate',
38+
Language::EN_GB => 'United Arab Emirates',
39+
];
40+
public const COUNTRY_NAME_IN = [
41+
Language::DE_DE => 'Indien',
42+
Language::EN_GB => 'India',
43+
];
44+
public const COUNTRY_NAME_KZ = [
45+
Language::DE_DE => 'Kasachstan',
46+
Language::EN_GB => 'Kazakhstan',
47+
];
48+
public const COUNTRY_NAME_RU = [
49+
Language::DE_DE => 'Russland',
50+
Language::EN_GB => 'Russia',
51+
];
52+
}

src/Constants/CountryAustralia.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ixnode/php-timezone project.
5+
*
6+
* (c) Björn Hempel <https://www.hempel.li/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Ixnode\PhpTimezone\Constants;
15+
16+
/**
17+
* Class CountryAustralia
18+
*
19+
* @author Björn Hempel <bjoern@hempel.li>
20+
* @version 0.1.0 (2023-07-01)
21+
* @since 0.1.0 (2023-07-01) First version.
22+
*/
23+
class CountryAustralia
24+
{
25+
/*
26+
* Codes Australia
27+
*/
28+
public const COUNTRY_CODE_AU = 'AU';
29+
30+
/*
31+
* Countries Australia
32+
*/
33+
public const COUNTRY_NAME_AU = [
34+
Language::DE_DE => 'Australien',
35+
Language::EN_GB => 'Australia',
36+
];
37+
}

src/Constants/CountryEurope.php

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ixnode/php-timezone project.
5+
*
6+
* (c) Björn Hempel <https://www.hempel.li/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Ixnode\PhpTimezone\Constants;
15+
16+
/**
17+
* Class CountryEurope
18+
*
19+
* @author Björn Hempel <bjoern@hempel.li>
20+
* @version 0.1.0 (2023-07-01)
21+
* @since 0.1.0 (2023-07-01) First version.
22+
*/
23+
class CountryEurope
24+
{
25+
/*
26+
* Codes Europe
27+
*/
28+
public const COUNTRY_CODE_AD = 'AD';
29+
public const COUNTRY_CODE_AT = 'AT';
30+
public const COUNTRY_CODE_BE = 'BE';
31+
public const COUNTRY_CODE_CH = 'CH';
32+
public const COUNTRY_CODE_CZ = 'CZ';
33+
public const COUNTRY_CODE_DE = 'DE';
34+
public const COUNTRY_CODE_DK = 'DK';
35+
public const COUNTRY_CODE_ES = 'ES';
36+
public const COUNTRY_CODE_FR = 'FR';
37+
public const COUNTRY_CODE_IT = 'IT';
38+
public const COUNTRY_CODE_NL = 'NL';
39+
public const COUNTRY_CODE_LU = 'LU';
40+
public const COUNTRY_CODE_PL = 'PL';
41+
public const COUNTRY_CODE_RS = 'RS';
42+
public const COUNTRY_CODE_SK = 'SK';
43+
44+
/*
45+
* Countries Europe
46+
*/
47+
public const COUNTRY_NAME_AD = [
48+
Language::DE_DE => 'Andorra',
49+
Language::EN_GB => 'Andorra',
50+
];
51+
public const COUNTRY_NAME_AT = [
52+
Language::DE_DE => 'Österreich',
53+
Language::EN_GB => 'Austria',
54+
];
55+
public const COUNTRY_NAME_BE = [
56+
Language::DE_DE => 'Belgien',
57+
Language::EN_GB => 'Belgium',
58+
];
59+
public const COUNTRY_NAME_CH = [
60+
Language::DE_DE => 'Schweiz',
61+
Language::EN_GB => 'Switzerland',
62+
];
63+
public const COUNTRY_NAME_CZ = [
64+
Language::DE_DE => 'Tschechien',
65+
Language::EN_GB => 'Czech Republic',
66+
];
67+
public const COUNTRY_NAME_DE = [
68+
Language::DE_DE => 'Deutschland',
69+
Language::EN_GB => 'Germany',
70+
];
71+
public const COUNTRY_NAME_DK = [
72+
Language::DE_DE => 'Dänemark',
73+
Language::EN_GB => 'Denmark',
74+
];
75+
public const COUNTRY_NAME_ES = [
76+
Language::DE_DE => 'Spanien',
77+
Language::EN_GB => 'Spain',
78+
];
79+
public const COUNTRY_NAME_FR = [
80+
Language::DE_DE => 'Frankreich',
81+
Language::EN_GB => 'France',
82+
];
83+
public const COUNTRY_NAME_IT = [
84+
Language::DE_DE => 'Italien',
85+
Language::EN_GB => 'Italy',
86+
];
87+
public const COUNTRY_NAME_NL = [
88+
Language::DE_DE => 'Niederland',
89+
Language::EN_GB => 'Netherlands',
90+
];
91+
public const COUNTRY_NAME_LU = [
92+
Language::DE_DE => 'Luxemburg',
93+
Language::EN_GB => 'Luxembourg',
94+
];
95+
public const COUNTRY_NAME_PL = [
96+
Language::DE_DE => 'Polen',
97+
Language::EN_GB => 'Poland',
98+
];
99+
public const COUNTRY_NAME_RS = [
100+
Language::DE_DE => 'Serbien',
101+
Language::EN_GB => 'Serbia',
102+
];
103+
public const COUNTRY_NAME_SK = [
104+
Language::DE_DE => 'Slowakei',
105+
Language::EN_GB => 'Slovakia',
106+
];
107+
}

src/Constants/CountryPacific.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ixnode/php-timezone project.
5+
*
6+
* (c) Björn Hempel <https://www.hempel.li/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Ixnode\PhpTimezone\Constants;
15+
16+
/**
17+
* Class CountryPacific
18+
*
19+
* @author Björn Hempel <bjoern@hempel.li>
20+
* @version 0.1.0 (2023-07-01)
21+
* @since 0.1.0 (2023-07-01) First version.
22+
*/
23+
class CountryPacific
24+
{
25+
/*
26+
* Codes Pacific
27+
*/
28+
public const COUNTRY_CODE_PG = 'PG';
29+
30+
/*
31+
* Countries Pacific
32+
*/
33+
public const COUNTRY_NAME_PG = [
34+
Language::DE_DE => 'Papua-Neuguinea',
35+
Language::EN_GB => 'Papua New Guinea',
36+
];
37+
}

0 commit comments

Comments
 (0)