@@ -22,8 +22,9 @@ |
||
22 | 22 | */ |
23 | 23 | private static function setupClient() |
24 | 24 | { |
25 | - if (static::$client === false) |
|
26 | - static::$client = new StarCitizensClient(); |
|
25 | + if (static::$client === false) { |
|
26 | + static::$client = new StarCitizensClient(); |
|
27 | + } |
|
27 | 28 | } |
28 | 29 | |
29 | 30 | /** |
@@ -53,8 +53,8 @@ |
||
53 | 53 | */ |
54 | 54 | protected static function find($id, $profileType = Accounts::FULL, $cache = false, $raw = false) |
55 | 55 | { |
56 | - $profileType = ($cache === true)? Accounts::FULL : $profileType; |
|
57 | - $cache = ($cache === true)? "cache" : "live"; |
|
56 | + $profileType = ($cache === true) ? Accounts::FULL : $profileType; |
|
57 | + $cache = ($cache === true) ? "cache" : "live"; |
|
58 | 58 | |
59 | 59 | $params = [ |
60 | 60 | 'api_source' => $cache, |
@@ -67,11 +67,12 @@ |
||
67 | 67 | ]; |
68 | 68 | |
69 | 69 | $response = json_decode(self::$client->getResult($params)->getBody()->getContents(), true); |
70 | - if ($response['request_stats']['query_status'] == "success") |
|
71 | - if ($raw === true) |
|
70 | + if ($response['request_stats']['query_status'] == "success") { |
|
71 | + if ($raw === true) |
|
72 | 72 | return $response; |
73 | - else |
|
74 | - return self::fillModel($profileType, $response['data']); |
|
73 | + } else { |
|
74 | + return self::fillModel($profileType, $response['data']); |
|
75 | + } |
|
75 | 76 | |
76 | 77 | return false; |
77 | 78 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * Base url |
17 | 17 | */ |
18 | - const APIURL = "http://sc-api.com"; |
|
18 | + const APIURL = "http://sc-api.com"; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * @var Client |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function getResult($params = []) |
46 | 46 | { |
47 | - $request = new Request("GET", '?'.http_build_query($params)); |
|
47 | + $request = new Request("GET", '?' . http_build_query($params)); |
|
48 | 48 | return $this->client->send($request); |
49 | 49 | } |
50 | 50 | } |
51 | 51 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
12 | 12 | public $thread_id; |
13 | 13 | public $thread_replies; |
14 | 14 | public $thread_views; |
15 | - public $original_poster=[]; |
|
15 | + public $original_poster = []; |
|
16 | 16 | public $original_post = []; |
17 | 17 | public $recent_poster = []; |
18 | 18 | public $recent_post; |
@@ -25,7 +25,8 @@ |
||
25 | 25 | |
26 | 26 | public function offsetSet($offset, $value) |
27 | 27 | { |
28 | - if ($value instanceof Post) |
|
29 | - parent::offsetSet($offset, $value); |
|
28 | + if ($value instanceof Post) { |
|
29 | + parent::offsetSet($offset, $value); |
|
30 | + } |
|
30 | 31 | } |
31 | 32 | } |
32 | 33 | \ No newline at end of file |
@@ -30,8 +30,9 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function offsetExists($offset) |
32 | 32 | { |
33 | - if (array_key_exists($offset, $this->items)) |
|
34 | - return true; |
|
33 | + if (array_key_exists($offset, $this->items)) { |
|
34 | + return true; |
|
35 | + } |
|
35 | 36 | |
36 | 37 | return false; |
37 | 38 | } |
@@ -43,8 +44,9 @@ discard block |
||
43 | 44 | */ |
44 | 45 | public function offsetGet($offset) |
45 | 46 | { |
46 | - if ($this->offsetExists($offset)) |
|
47 | - return $this->items[$offset]; |
|
47 | + if ($this->offsetExists($offset)) { |
|
48 | + return $this->items[$offset]; |
|
49 | + } |
|
48 | 50 | |
49 | 51 | return false; |
50 | 52 | } |
@@ -63,8 +65,9 @@ discard block |
||
63 | 65 | */ |
64 | 66 | public function offsetUnset($offset) |
65 | 67 | { |
66 | - if ($this->offsetExists($offset) && isset($this->items[$offset])) |
|
67 | - unset ($this->items[$offset]); |
|
68 | + if ($this->offsetExists($offset) && isset($this->items[$offset])) { |
|
69 | + unset ($this->items[$offset]); |
|
70 | + } |
|
68 | 71 | } |
69 | 72 | |
70 | 73 | /** |
@@ -25,7 +25,8 @@ |
||
25 | 25 | |
26 | 26 | public function offsetSet($offset, $value) |
27 | 27 | { |
28 | - if ($value instanceof Thread) |
|
29 | - parent::offsetSet($offset, $value); |
|
28 | + if ($value instanceof Thread) { |
|
29 | + parent::offsetSet($offset, $value); |
|
30 | + } |
|
30 | 31 | } |
31 | 32 | } |
32 | 33 | \ No newline at end of file |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | protected static function find($id, $action = Organisations::ORG, $cache = false, $raw = false) |
40 | 40 | { |
41 | - $cache = ($cache === true)? "cache" : "live"; |
|
41 | + $cache = ($cache === true) ? "cache" : "live"; |
|
42 | 42 | |
43 | 43 | $params = [ |
44 | 44 | 'api_source' => $cache, |
@@ -50,11 +50,12 @@ |
||
50 | 50 | ]; |
51 | 51 | |
52 | 52 | $response = json_decode(self::$client->getResult($params)->getBody()->getContents(), true); |
53 | - if ($response['request_stats']['query_status'] == "success") |
|
54 | - if ($raw === true) |
|
53 | + if ($response['request_stats']['query_status'] == "success") { |
|
54 | + if ($raw === true) |
|
55 | 55 | return $response; |
56 | - else |
|
57 | - return self::fillModel($action, $response['data']); |
|
56 | + } else { |
|
57 | + return self::fillModel($action, $response['data']); |
|
58 | + } |
|
58 | 59 | |
59 | 60 | return false; |
60 | 61 | } |
@@ -147,8 +147,9 @@ discard block |
||
147 | 147 | */ |
148 | 148 | protected function threads() |
149 | 149 | { |
150 | - if ($this->threads === null) |
|
151 | - $this->threads = Accounts::findThreads($this->handle); |
|
150 | + if ($this->threads === null) { |
|
151 | + $this->threads = Accounts::findThreads($this->handle); |
|
152 | + } |
|
152 | 153 | |
153 | 154 | return $this->threads; |
154 | 155 | } |
@@ -158,8 +159,9 @@ discard block |
||
158 | 159 | */ |
159 | 160 | protected function posts() |
160 | 161 | { |
161 | - if ($this->posts === null) |
|
162 | - $this->posts = Accounts::findPosts($this->handle); |
|
162 | + if ($this->posts === null) { |
|
163 | + $this->posts = Accounts::findPosts($this->handle); |
|
164 | + } |
|
163 | 165 | |
164 | 166 | return $this->posts; |
165 | 167 | } |
@@ -171,8 +173,9 @@ discard block |
||
171 | 173 | */ |
172 | 174 | public function with(...$types) { |
173 | 175 | foreach ($types as $type) { |
174 | - if (method_exists($this, strtolower($type))) |
|
175 | - call_user_method($type, $this); |
|
176 | + if (method_exists($this, strtolower($type))) { |
|
177 | + call_user_method($type, $this); |
|
178 | + } |
|
176 | 179 | } |
177 | 180 | |
178 | 181 | return $this; |