paquettg / leaguewrap

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

Static Data Region #109

Closed Nebs987 closed 8 years ago

Nebs987 commented 8 years ago

In the Region.php file the getStaticDataDomain function is returning the wrong url. It is not adding the region to the end of the url. For example the url that is returned is https://global.api.pvp.net/api/lol/static-data/ but it should be https://global.api.pvp.net/api/lol/static-data/na/ for na.

romanzipp commented 8 years ago

Resolved by:

Api/Region.php line 48

protected $defaultStaticDomain = 'https://global.api.pvp.net/api/lol/static-data/';
// change to:
protected $defaultStaticDomain = 'https://global.api.pvp.net/api/lol/static-data/%s/';

Api/Region.php line 94

return $this->defaultStaticDomain;
// change to:
return sprintf($this->defaultStaticDomain, $this->getRegion());