@@ -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, |
@@ -66,11 +66,12 @@ |
||
66 | 66 | ]; |
67 | 67 | |
68 | 68 | $response = json_decode(self::$client->getResult($params)->getBody()->getContents(), true); |
69 | - if ($response['request_stats']['query_status'] == "success") |
|
70 | - if ($raw === true) |
|
69 | + if ($response['request_stats']['query_status'] == "success") { |
|
70 | + if ($raw === true) |
|
71 | 71 | return $response; |
72 | - else |
|
73 | - return Accounts::fillModel($profileType, $response['data']); |
|
72 | + } else { |
|
73 | + return Accounts::fillModel($profileType, $response['data']); |
|
74 | + } |
|
74 | 75 | |
75 | 76 | return false; |
76 | 77 | } |
@@ -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; |
@@ -46,8 +46,9 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function offsetExists($offset) |
48 | 48 | { |
49 | - if (array_key_exists($offset, $this->threads)) |
|
50 | - return true; |
|
49 | + if (array_key_exists($offset, $this->threads)) { |
|
50 | + return true; |
|
51 | + } |
|
51 | 52 | |
52 | 53 | return false; |
53 | 54 | } |
@@ -59,8 +60,9 @@ discard block |
||
59 | 60 | */ |
60 | 61 | public function offsetGet($offset) |
61 | 62 | { |
62 | - if ($this->offsetExists($offset)) |
|
63 | - return $this->threads[$offset]; |
|
63 | + if ($this->offsetExists($offset)) { |
|
64 | + return $this->threads[$offset]; |
|
65 | + } |
|
64 | 66 | |
65 | 67 | return false; |
66 | 68 | } |
@@ -71,8 +73,9 @@ discard block |
||
71 | 73 | */ |
72 | 74 | public function offsetSet($offset, $value) |
73 | 75 | { |
74 | - if ($value instanceof Thread) |
|
75 | - $this->threads[$offset] = $value; |
|
76 | + if ($value instanceof Thread) { |
|
77 | + $this->threads[$offset] = $value; |
|
78 | + } |
|
76 | 79 | } |
77 | 80 | |
78 | 81 | /** |
@@ -80,8 +83,9 @@ discard block |
||
80 | 83 | */ |
81 | 84 | public function offsetUnset($offset) |
82 | 85 | { |
83 | - if ($this->offsetExists($offset) && isset($this->threads[$offset])) |
|
84 | - unset ($this->threads[$offset]); |
|
86 | + if ($this->offsetExists($offset) && isset($this->threads[$offset])) { |
|
87 | + unset ($this->threads[$offset]); |
|
88 | + } |
|
85 | 89 | } |
86 | 90 | |
87 | 91 | /** |