paquettg / leaguewrap

League of Legend API wrapper
MIT License
67 stars 28 forks source link

attachStaticData() spams errors for missing items in StatsDto #116

Closed Inve1951 closed 8 years ago

Inve1951 commented 8 years ago

I still experience massive error spamming when using attachStaticData(). This is my php:

require_once __DIR__ . "\\vendor\\autoload.php";

\LeagueWrap\StaticApi::mount();
Api::setKey("myKey");
Api::setRegion("eune");
Api::attachStaticData();
$smnr = Summoner::info("player");
$recentmatches = Game::recent($smnr);

And this is my errors with call stacks: http://pastebin.com/W00DXKLF (raw html, download file and open in browser)

I tracked it down a bit and found out that when the first error is raised inside getStaticFields() all fields from item0 to item4 plus item6 are present and hold legit values, just item5 is missing.

Inve1951 commented 8 years ago

115 fixed it for me.

I hope this doesn't break anything, please verify.

Edit: Shouldn't break anything. Further investigation showed that this is caused by an inconsistency on Riot's side. The Match Api endpoint fills empty itemN fields with 0 whereas the Game Api endpoint omits the fields entirely.