@@ -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; |
@@ -63,8 +63,9 @@ |
||
| 63 | 63 | { |
| 64 | 64 | if ($this->members === null) { |
| 65 | 65 | $members = Organisations::findMembers($this->sid); |
| 66 | - if ($members instanceof Store) |
|
| 67 | - $this->members = $members; |
|
| 66 | + if ($members instanceof Store) { |
|
| 67 | + $this->members = $members; |
|
| 68 | + } |
|
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | return $this->members; |
@@ -59,8 +59,9 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function offsetExists($offset) |
| 61 | 61 | { |
| 62 | - if (array_key_exists($offset, $this->items)) |
|
| 63 | - return true; |
|
| 62 | + if (array_key_exists($offset, $this->items)) { |
|
| 63 | + return true; |
|
| 64 | + } |
|
| 64 | 65 | |
| 65 | 66 | return false; |
| 66 | 67 | } |
@@ -72,8 +73,9 @@ discard block |
||
| 72 | 73 | */ |
| 73 | 74 | public function offsetGet($offset) |
| 74 | 75 | { |
| 75 | - if ($this->offsetExists($offset)) |
|
| 76 | - return $this->items[$offset]; |
|
| 76 | + if ($this->offsetExists($offset)) { |
|
| 77 | + return $this->items[$offset]; |
|
| 78 | + } |
|
| 77 | 79 | |
| 78 | 80 | return false; |
| 79 | 81 | } |
@@ -84,11 +86,12 @@ discard block |
||
| 84 | 86 | */ |
| 85 | 87 | public function offsetSet($offset, $value) |
| 86 | 88 | { |
| 87 | - if ($value instanceof $this->className) |
|
| 88 | - if ($offset == null) |
|
| 89 | + if ($value instanceof $this->className) { |
|
| 90 | + if ($offset == null) |
|
| 89 | 91 | $this->items[] = $value; |
| 90 | - else |
|
| 91 | - $this->items[$offset] = $value; |
|
| 92 | + } else { |
|
| 93 | + $this->items[$offset] = $value; |
|
| 94 | + } |
|
| 92 | 95 | } |
| 93 | 96 | |
| 94 | 97 | /** |
@@ -96,8 +99,9 @@ discard block |
||
| 96 | 99 | */ |
| 97 | 100 | public function offsetUnset($offset) |
| 98 | 101 | { |
| 99 | - if ($this->offsetExists($offset) && isset($this->items[$offset])) |
|
| 100 | - unset ($this->items[$offset]); |
|
| 102 | + if ($this->offsetExists($offset) && isset($this->items[$offset])) { |
|
| 103 | + unset ($this->items[$offset]); |
|
| 104 | + } |
|
| 101 | 105 | } |
| 102 | 106 | |
| 103 | 107 | /** |
@@ -76,8 +76,9 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | if ($this->threads === null) { |
| 78 | 78 | $threads = Accounts::findThreads($this->handle); |
| 79 | - if ($threads instanceof Store) |
|
| 80 | - $this->threads = $threads; |
|
| 79 | + if ($threads instanceof Store) { |
|
| 80 | + $this->threads = $threads; |
|
| 81 | + } |
|
| 81 | 82 | } |
| 82 | 83 | |
| 83 | 84 | return $this->threads; |
@@ -90,8 +91,9 @@ discard block |
||
| 90 | 91 | { |
| 91 | 92 | if ($this->posts === null) { |
| 92 | 93 | $posts = Accounts::findPosts($this->handle); |
| 93 | - if ($posts instanceof Store) |
|
| 94 | - $this->posts = $posts; |
|
| 94 | + if ($posts instanceof Store) { |
|
| 95 | + $this->posts = $posts; |
|
| 96 | + } |
|
| 95 | 97 | } |
| 96 | 98 | |
| 97 | 99 | return $this->posts; |
@@ -56,8 +56,9 @@ |
||
| 56 | 56 | { |
| 57 | 57 | if ($this->profile === null) { |
| 58 | 58 | $profile = Accounts::findProfile($this->handle); |
| 59 | - if ($profile instanceof Profile) |
|
| 60 | - $this->profile = $profile; |
|
| 59 | + if ($profile instanceof Profile) { |
|
| 60 | + $this->profile = $profile; |
|
| 61 | + } |
|
| 61 | 62 | } |
| 62 | 63 | |
| 63 | 64 | return $this->profile; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function isRedditor($redditUsername) |
| 27 | 27 | { |
| 28 | - if (preg_match("%^((https?://)|reddit.com/u(ser)?/" . $redditUsername . "/?\s*(<br />)?\\n%i",$this->bio) == 1) { |
|
| 28 | + if (preg_match("%^((https?://)|reddit.com/u(ser)?/" . $redditUsername . "/?\s*(<br />)?\\n%i", $this->bio) == 1) { |
|
| 29 | 29 | return true; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @param $id |
| 102 | 102 | * @param $system |
| 103 | 103 | * @param $profileType |
| 104 | - * @param $cache |
|
| 104 | + * @param boolean $cache |
|
| 105 | 105 | * @return array |
| 106 | 106 | */ |
| 107 | 107 | private function getParams($id, $system, $profileType, $cache) |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | /** |
| 124 | 124 | * @param $response |
| 125 | 125 | * @param $profileType |
| 126 | - * @param $raw |
|
| 126 | + * @param boolean $raw |
|
| 127 | 127 | * |
| 128 | 128 | * @return bool|mixed |
| 129 | 129 | */ |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | if ($argumentCount == 0) |
| 52 | 52 | throw new \InvalidArgumentException("Requires an argument"); |
| 53 | 53 | |
| 54 | - if ($argumentCount > 0 && $argumentCount< 2) |
|
| 54 | + if ($argumentCount > 0 && $argumentCount < 2) |
|
| 55 | 55 | return $this->find($arguments[0], $name, $this->systems[$name]['base_action']); |
| 56 | 56 | |
| 57 | 57 | if ($argumentCount == 2) { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $profileType = $this->systems[$name]['base_action']; |
| 61 | 61 | return $this->find($id, $name, $profileType); |
| 62 | 62 | } |
| 63 | - if ($argumentCount == 4 ) { |
|
| 63 | + if ($argumentCount == 4) { |
|
| 64 | 64 | list($id, $profileType, $cache, $raw) = $arguments; |
| 65 | 65 | return $this->find($id, $name, $profileType, $cache, $raw); |
| 66 | 66 | } else { |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | private function fillModel($model, $fillData) |
| 162 | 162 | { |
| 163 | 163 | if (is_array($model)) { |
| 164 | - list($className, $dataRoot, $idName) =$model; |
|
| 164 | + list($className, $dataRoot, $idName) = $model; |
|
| 165 | 165 | $object = new \ReflectionClass('StarCitizen\Models\Store'); |
| 166 | 166 | return $object->newInstance($fillData, $className, $dataRoot, $idName); |
| 167 | 167 | } else { |
@@ -48,16 +48,19 @@ |
||
| 48 | 48 | { |
| 49 | 49 | if (array_key_exists($name, $this->systems)) { |
| 50 | 50 | $argumentCount = count($arguments); |
| 51 | - if ($argumentCount == 0) |
|
| 52 | - throw new \InvalidArgumentException("Requires an argument"); |
|
| 51 | + if ($argumentCount == 0) { |
|
| 52 | + throw new \InvalidArgumentException("Requires an argument"); |
|
| 53 | + } |
|
| 53 | 54 | |
| 54 | - if ($argumentCount > 0 && $argumentCount< 2) |
|
| 55 | - return $this->find($arguments[0], $name, $this->systems[$name]['base_action']); |
|
| 55 | + if ($argumentCount > 0 && $argumentCount< 2) { |
|
| 56 | + return $this->find($arguments[0], $name, $this->systems[$name]['base_action']); |
|
| 57 | + } |
|
| 56 | 58 | |
| 57 | 59 | if ($argumentCount == 2) { |
| 58 | 60 | list($id, $profileType) = $arguments; |
| 59 | - if ($profileType == false) |
|
| 60 | - $profileType = $this->systems[$name]['base_action']; |
|
| 61 | + if ($profileType == false) { |
|
| 62 | + $profileType = $this->systems[$name]['base_action']; |
|
| 63 | + } |
|
| 61 | 64 | return $this->find($id, $name, $profileType); |
| 62 | 65 | } |
| 63 | 66 | if ($argumentCount == 4 ) { |
@@ -20,8 +20,9 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function with(...$types) { |
| 22 | 22 | foreach ($types as $type) { |
| 23 | - if (method_exists($this, strtolower($type))) |
|
| 24 | - call_user_func([$this, $type]); |
|
| 23 | + if (method_exists($this, strtolower($type))) { |
|
| 24 | + call_user_func([$this, $type]); |
|
| 25 | + } |
|
| 25 | 26 | } |
| 26 | 27 | |
| 27 | 28 | return $this; |