@@ -116,7 +116,7 @@ |
||
| 116 | 116 | protected function request($url) |
| 117 | 117 | { |
| 118 | 118 | $response = $this->getHttpClient() |
| 119 | - ->request('GET', $url, ['headers' => ['authorization' => 'Bearer ' . $this->getToken()]]); |
|
| 119 | + ->request('GET', $url, ['headers' => ['authorization' => 'Bearer ' . $this->getToken()]]); |
|
| 120 | 120 | |
| 121 | 121 | return ResponseMediator::convertResponseToArray($response); |
| 122 | 122 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function getClan($tag) |
| 34 | 34 | { |
| 35 | - $response = $this->request('clans/' . urlencode($tag)); |
|
| 35 | + $response = $this->request('clans/'.urlencode($tag)); |
|
| 36 | 36 | |
| 37 | 37 | return Clan::makeFromArray($response); |
| 38 | 38 | } |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $params = is_array($params) ? $params : ['name' => $params]; |
| 50 | 50 | |
| 51 | - $response = $this->request('clans?' . http_build_query($params)); |
|
| 51 | + $response = $this->request('clans?'.http_build_query($params)); |
|
| 52 | 52 | |
| 53 | - return array_map(function ($item) { |
|
| 53 | + return array_map(function($item) { |
|
| 54 | 54 | return Clan::makeFromArray($item); |
| 55 | 55 | }, $response['items']); |
| 56 | 56 | } |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function getClanWarLog($tag) |
| 65 | 65 | { |
| 66 | - $response = $this->request('clans/' . urlencode($tag).'/warlog'); |
|
| 66 | + $response = $this->request('clans/'.urlencode($tag).'/warlog'); |
|
| 67 | 67 | |
| 68 | - return array_map(function ($item) { |
|
| 68 | + return array_map(function($item) { |
|
| 69 | 69 | return WarLog::makeFromArray($item); |
| 70 | 70 | }, $response['items']); |
| 71 | 71 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function getLocation($id) |
| 80 | 80 | { |
| 81 | - return Location::makeFromArray($this->request('locations/' . urlencode($id))); |
|
| 81 | + return Location::makeFromArray($this->request('locations/'.urlencode($id))); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getLocations() |
| 90 | 90 | { |
| 91 | - return array_map(function ($item) { |
|
| 91 | + return array_map(function($item) { |
|
| 92 | 92 | return Location::makeFromArray($item); |
| 93 | 93 | }, $this->request('locations')['items']); |
| 94 | 94 | } |
@@ -101,15 +101,15 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function getRankingsForLocation($locationId, $rankingId) |
| 103 | 103 | { |
| 104 | - $url = 'locations/' . $locationId . '/rankings/' . $rankingId; |
|
| 104 | + $url = 'locations/'.$locationId.'/rankings/'.$rankingId; |
|
| 105 | 105 | |
| 106 | 106 | if ($rankingId == 'clans') { |
| 107 | - return array_map(function ($item) { |
|
| 107 | + return array_map(function($item) { |
|
| 108 | 108 | return Clan::makeFromArray($item); |
| 109 | 109 | }, $this->request($url)['items']); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - return array_map(function ($item) { |
|
| 112 | + return array_map(function($item) { |
|
| 113 | 113 | return Player::makeFromArray($item); |
| 114 | 114 | }, $this->request($url)['items']); |
| 115 | 115 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function getLeagues() |
| 123 | 123 | { |
| 124 | - return array_map(function ($item) { |
|
| 124 | + return array_map(function($item) { |
|
| 125 | 125 | return League::makeFromArray($item); |
| 126 | 126 | }, $this->request('leagues')['items']); |
| 127 | 127 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | protected function request($url) |
| 134 | 134 | { |
| 135 | 135 | $response = $this->getHttpClient() |
| 136 | - ->request('GET', $url, ['headers' => ['authorization' => 'Bearer ' . $this->getToken()]]); |
|
| 136 | + ->request('GET', $url, ['headers' => ['authorization' => 'Bearer '.$this->getToken()]]); |
|
| 137 | 137 | |
| 138 | 138 | return ResponseMediator::convertResponseToArray($response); |
| 139 | 139 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $members = $this->all(); |
| 44 | 44 | |
| 45 | - return array_filter($members, function ($player) { |
|
| 45 | + return array_filter($members, function($player) { |
|
| 46 | 46 | return $player->isLeader(); |
| 47 | 47 | })[0]; |
| 48 | 48 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $members = $this->all(); |
| 56 | 56 | |
| 57 | - return array_filter($members, function ($player) { |
|
| 57 | + return array_filter($members, function($player) { |
|
| 58 | 58 | return $player->isElder(); |
| 59 | 59 | }); |
| 60 | 60 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | $members = $this->all(); |
| 68 | 68 | |
| 69 | - return array_filter($members, function ($player) { |
|
| 69 | + return array_filter($members, function($player) { |
|
| 70 | 70 | return $player->isCoLeader(); |
| 71 | 71 | }); |
| 72 | 72 | } |