Skip to content

Commit 1a20b83

Browse files
authored
Merge pull request #1 from D0L1K/feature/update
Added missing Regions
2 parents 1e3fc01 + 3b87987 commit 1a20b83

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

src/Base/Definitions/IRegion.php

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ interface IRegion
3333

3434
const ASIA = 'asia';
3535

36+
const SEA = 'sea';
37+
3638
/**
3739
* Returns region list.
3840
*

src/Base/Definitions/Platform.php

+20
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,22 @@ class Platform implements IPlatform
4444
const OCEANIA = 'oc1';
4545
const KOREA = 'kr';
4646
const JAPAN = 'jp1';
47+
const PHILIPPINES = 'ph2';
48+
const SINGAPORE = 'sg2';
49+
const TAIWAN = 'tw2';
50+
const THAILAND = 'th2';
51+
const VIETNAM = 'vn2';
4752

4853
const AMERICAS = 'americas';
4954
const EUROPE = 'europe';
5055
const ASIA = 'asia';
56+
const SEA = 'sea';
5157

5258
public static $list = array(
5359
IRegion::EUROPE => self::EUROPE,
5460
IRegion::AMERICAS => self::AMERICAS,
5561
IRegion::ASIA => self::ASIA,
62+
IRegion::SEA => self::SEA,
5663
Region::NORTH_AMERICA => self::NORTH_AMERICA,
5764
Region::EUROPE_WEST => self::EUROPE_WEST,
5865
Region::EUROPE_EAST => self::EUROPE_EAST,
@@ -64,12 +71,18 @@ class Platform implements IPlatform
6471
Region::OCEANIA => self::OCEANIA,
6572
Region::KOREA => self::KOREA,
6673
Region::JAPAN => self::JAPAN,
74+
Region::PHILIPPINES => self::PHILIPPINES,
75+
Region::SINGAPORE => self::SINGAPORE,
76+
Region::TAIWAN => self::TAIWAN,
77+
Region::THAILAND => self::THAILAND,
78+
Region::VIETNAM => self::VIETNAM,
6779
);
6880

6981
public static $continentalRegions = [
7082
self::AMERICAS,
7183
self::EUROPE,
7284
self::ASIA,
85+
self::SEA,
7386
];
7487

7588

@@ -117,6 +130,13 @@ public function getCorrespondingContinentRegion($region): string
117130
case Platform::JAPAN:
118131
return IRegion::ASIA;
119132

133+
case Platform::PHILIPPINES:
134+
case Platform::SINGAPORE:
135+
case Platform::TAIWAN:
136+
case Platform::THAILAND:
137+
case Platform::VIETNAM:
138+
return IRegion::SEA;
139+
120140
default:
121141
throw new GeneralException("Unable to convert '$region' platform ID to corresponding continent region.");
122142
}

src/Base/Definitions/Region.php

+11
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ class Region implements IRegion
4444
const OCEANIA = 'oce';
4545
const KOREA = 'kr';
4646
const JAPAN = 'jp';
47+
const PHILIPPINES = 'ph';
48+
const SINGAPORE = 'sg';
49+
const TAIWAN = 'tw';
50+
const THAILAND = 'th';
51+
const VIETNAM = 'vn';
4752

4853
public static $list = array(
4954
self::NORTH_AMERICA => self::NORTH_AMERICA,
@@ -60,6 +65,12 @@ class Region implements IRegion
6065
self::KOREA => self::KOREA,
6166
self::JAPAN => self::JAPAN,
6267
self::AMERICAS => self::AMERICAS,
68+
self::PHILIPPINES => self::PHILIPPINES,
69+
self::SINGAPORE => self::SINGAPORE,
70+
self::TAIWAN => self::TAIWAN,
71+
self::THAILAND => self::THAILAND,
72+
self::VIETNAM => self::VIETNAM,
73+
self::SEA => self::SEA,
6374
);
6475

6576

0 commit comments

Comments
 (0)