/** * Get rankings for specific location * @param $locationId * @param $rankingId * @return array */ public function getRankingsForLocation($locationId, $rankingId) { $url = 'locations/' . $locationId . '/rankings/' . $rankingId; if ($rankingId == 'clans') { return array_map(function ($item) { return Clan::makeFromArray($item); }, $this->request($url)['items']); } return array_map(function ($item) { return Player::makeFromArray($item); }, $this->request($url)['items']); }
public function testItProperlyCastsObjectsDuringAssigningProperties() { $this->assertInstanceOf(Location::class, $this->clan->location()); $this->assertInstanceOf(Badge::class, $this->clan->badge()); $this->assertInstanceOf(MemberList::class, $this->clan->memberList()); }