/** * Return the players stats * * @return \Burthorpe\Runescape\RS3\Stats\Repository */ public function getStats() { if ($this->stats) { return $this->stats; } return $this->stats = $this->api->stats($this->getDisplayName()); }
/** * Get the users skills stats. * * @return \Illuminate\Support\Collection */ protected function getStats(SkillContract $skill = null) { if ($this->stats) { $stats = $this->stats; } else { $stats = $this->api->stats($this->getUsername()); } return !is_null($skill) ? $stats->get($skill->getName()) : $stats; }
public function testStatsWithInvalidDisplayName() { $this->expectException(\Burthorpe\Exception\UnknownPlayerException::class); $eoc = new API(); $eoc->stats('thisdisplaynameisjusttoolong'); }