Skip to content

Commit ff21ced

Browse files
committed
fix locale
1 parent 5539491 commit ff21ced

File tree

7 files changed

+65
-52
lines changed

7 files changed

+65
-52
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [1.1.7] - 2020-08-11
7+
## [1.1.9] - 2022-05-06
88
### Changed
9-
- update docs
9+
- fix locale
10+
11+
**## [1.1.7] - 2020-08-11
12+
### Changed
13+
- update docs**
1014

1115
## [1.1.6] - 2020-05-02
1216
### Changed

composer.json

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,51 @@
11
{
2-
"name": "s00d/onlinesim-api",
3-
"description": "php onlinesim api client",
4-
"keywords": ["onlinesim", "api", "client"],
5-
"type": "library",
6-
"license": "MIT",
7-
"minimum-stability": "stable",
8-
"authors": [
9-
{
10-
"name": "s00d",
11-
"email": "Virus191288@gmail.com"
12-
}
13-
],
14-
"require": {
15-
"php": ">=5.5.9"
16-
},
17-
"require-dev": {
18-
"phpunit/phpunit": "^5",
19-
"vlucas/phpdotenv": "^4.1",
20-
"larapack/dd": "1.*"
21-
},
22-
"autoload": {
23-
"psr-4": {
24-
"s00d\\OnlineSimApi\\": "src/",
25-
"Tests\\": "tests/"
26-
},
27-
"classmap": [
28-
"src/"
29-
]
2+
"name": "s00d/onlinesim-api",
3+
"description": "php onlinesim api client",
4+
"keywords": [
5+
"onlinesim",
6+
"api",
7+
"client"
8+
],
9+
"type": "library",
10+
"license": "MIT",
11+
"minimum-stability": "stable",
12+
"authors": [
13+
{
14+
"name": "s00d",
15+
"email": "Virus191288@gmail.com"
16+
}
17+
],
18+
"require": {
19+
"php": ">=5.5.9",
20+
"ext-json": "*"
21+
},
22+
"require-dev": {
23+
"phpunit/phpunit": "^5",
24+
"vlucas/phpdotenv": "^4.1",
25+
"larapack/dd": "1.*"
26+
},
27+
"autoload": {
28+
"psr-4": {
29+
"s00d\\OnlineSimApi\\": "src/",
30+
"Tests\\": "tests/"
3031
},
31-
"autoload-dev": {
32-
"files": [
33-
"./vendor/larapack/dd/src/helper.php"
34-
],
35-
"psr-4": {
36-
"s00d\\OnlineSimApi\\": "src/",
37-
"Tests\\": "tests/"
38-
},
39-
"classmap": [
40-
"src/"
41-
]
32+
"classmap": [
33+
"src/"
34+
]
35+
},
36+
"autoload-dev": {
37+
"files": [
38+
"./vendor/larapack/dd/src/helper.php"
39+
],
40+
"psr-4": {
41+
"s00d\\OnlineSimApi\\": "src/",
42+
"Tests\\": "tests/"
4243
},
43-
"scripts": {
44-
"test": "vendor/bin/phpunit"
45-
}
44+
"classmap": [
45+
"src/"
46+
]
47+
},
48+
"scripts": {
49+
"test": "vendor/bin/phpunit"
50+
}
4651
}

src/Apis/GetForward.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function state($message_to_code = 1, $orderby = 'ASC', $msg_list = true,
6565
} catch (NoNumberException $e) {
6666
return new State([]);
6767
} catch (RequestException $e) {
68-
throw new RequestException($e->getMessage(), $e->getLocale());
68+
throw new RequestException($e->getMessage(), $this->request->getLocale());
6969
} catch (\Exception $e) {
7070
throw new RuntimeException($e->getMessage());
7171
}
@@ -93,7 +93,7 @@ public function stateOne($tzid, $message_to_code = 1, $msg_list = true, $clean =
9393
} catch (NoNumberException $e) {
9494
return null;
9595
} catch (RequestException $e) {
96-
throw new RequestException($e->getMessage(), $e->getLocale());
96+
throw new RequestException($e->getMessage(), $this->request->getLocale());
9797
} catch (\Exception $e) {
9898
throw new RuntimeException($e->getMessage());
9999
}

src/Apis/GetNumbers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function state($message_to_code = 1, $orderby = 'ASC', $msg_list = true,
7878
} catch (NoNumberException $e) {
7979
return new State();
8080
} catch (RequestException $e) {
81-
throw new RequestException($e->getMessage(), $e->getLocale());
81+
throw new RequestException($e->getMessage(), $this->request->getLocale());
8282
} catch (Exception $e) {
8383
throw new RuntimeException($e->getMessage());
8484
}
@@ -108,7 +108,7 @@ public function stateOne($tzid, $message_to_code = 1, $msg_list = true, $clean =
108108
} catch (NoNumberException $e) {
109109
return null;
110110
} catch (RequestException $e) {
111-
throw new RequestException($e->getMessage(), $e->getLocale());
111+
throw new RequestException($e->getMessage(), $this->request->getLocale());
112112
} catch (Exception $e) {
113113
throw new RuntimeException($e->getMessage());
114114
}

src/Apis/GetProxy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function state($orderby = 'ASC') {
6161
} catch (NoNumberException $e) {
6262
return new State([]);
6363
} catch (RequestException $e) {
64-
throw new RequestException($e->getMessage(), $e->getLocale());
64+
throw new RequestException($e->getMessage(), $this->request->getLocale());
6565
} catch (Exception $e) {
6666
throw new RuntimeException($e->getMessage());
6767
}
@@ -84,7 +84,7 @@ public function stateOne($tzid) {
8484
} catch (NoNumberException $e) {
8585
return null;
8686
} catch (RequestException $e) {
87-
throw new RequestException($e->getMessage(), $e->getLocale());
87+
throw new RequestException($e->getMessage(), $this->request->getLocale());
8888
} catch (Exception $e) {
8989
throw new RuntimeException($e->getMessage());
9090
}

src/Apis/GetRent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function state() {
5050
} catch (NoNumberException $e) {
5151
return new State([]);
5252
} catch (RequestException $e) {
53-
throw new RequestException($e->getMessage(), $e->getLocale());
53+
throw new RequestException($e->getMessage(), $this->request->getLocale());
5454
} catch (Exception $e) {
5555
throw new RuntimeException($e->getMessage());
5656
}
@@ -74,7 +74,7 @@ public function stateOne($tzid) {
7474
} catch (NoNumberException $e) {
7575
return null;
7676
} catch (RequestException $e) {
77-
throw new RequestException($e->getMessage(), $e->getLocale());
77+
throw new RequestException($e->getMessage(), $this->request->getLocale());
7878
} catch (Exception $e) {
7979
throw new RuntimeException($e->getMessage());
8080
}

src/Request.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,8 @@ public function send($request, $data, $method = 'GET') {
6060

6161
return $result;
6262
}
63+
64+
public function getLocale() {
65+
return $this->locale;
66+
}
6367
}

0 commit comments

Comments
 (0)