paquettg / leaguewrap

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

static data for runes and masteries doesn´t get attached to currentGame() result #83

Closed Colorfulstan closed 9 years ago

Colorfulstan commented 9 years ago
$api->attachStaticData(true);
$currentGame = $api->currentGame();
print_r($currentGame->currentGame($summonerInfo)->raw());
$api->attachStaticData(false);

gives an Array where – regarding the attached static data – only summonerspells and champions are attached, not masteries and runes. The isolated calls for $staticdata->getMasteries() and $staticdata->getRunes() deliver the data. As stated in issue #81 the getMasteries() obviously gets called within StaticOptimizer.php, but the data doesn´t reach the currentGame() result

dnlbauer commented 9 years ago

This, together with #81 makes me think the whole attach static data thing might broken for runes/masteries. Let me see if I find some time during the week to look into this more closely.

paquettg commented 9 years ago

I found the bug. If a DTO contained attached static data it would not allow static data to be attached to any of its children. This has been fixed and I added tests to ensure it does not happen again.