1 | <?php |
||
9 | class Countries |
||
10 | { |
||
11 | /** @var LoggerInterface */ |
||
12 | protected $logger; |
||
13 | |||
14 | protected $iso; |
||
15 | |||
16 | /** @var array */ |
||
17 | protected $countriesMapping = []; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $otherCountryCode; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $otherCountryLabel; |
||
24 | |||
25 | /** |
||
26 | * Countries constructor. |
||
27 | * |
||
28 | * @param LoggerInterface $logger |
||
29 | * @param array $countriesMapping |
||
30 | * @param string $otherCountryCode |
||
31 | * @param string $otherCountryLabel |
||
32 | */ |
||
33 | 151 | public function __construct( |
|
54 | |||
55 | |||
56 | /** |
||
57 | * Get 3-letter country code from full country name |
||
58 | * |
||
59 | * @param $country |
||
60 | * @return mixed|string |
||
61 | */ |
||
62 | 1 | public function getCodeFromCountry($country) |
|
71 | |||
72 | /** |
||
73 | * Get full country name from 3-letter country code |
||
74 | * |
||
75 | * @param string $code |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getCountryFromCode($code) |
||
93 | |||
94 | /** |
||
95 | * Parses country from maniaplanet player objects' path |
||
96 | * |
||
97 | * @param string $path Maniaplanet path from player object |
||
98 | * @return string long country name |
||
99 | */ |
||
100 | public function parseCountryFromPath($path) |
||
109 | |||
110 | /** |
||
111 | * Get iso2 code from Maniaplanet Country name |
||
112 | * |
||
113 | * @param $name |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | 1 | public function getIsoAlpha2FromName($name) |
|
135 | } |
||
136 |