paquettg / leaguewrap

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

Requesting timeline for match does not return the timeline #84

Closed bstadick closed 9 years ago

bstadick commented 9 years ago

When requesting the match timeline, the timeline is not returned. The issue seems to be in Api\Match.php:53 in the match function where the url query parameter includeTimeline is set to true but in the request the boolean 'true' is translated to '1' which is not recognized by the Riot api. A simple fix is to change line 53 from $response = $this->request('match/'.$matchId, ['includeTimeline' => $includeTimeline]); to $response = $this->request('match/'.$matchId, ['includeTimeline' => 'true']);

dnlbauer commented 9 years ago

The reason for this is line 68 of LeagueWrap\Client.php where the query params are built using the php method http_build_query() (http://php.net/manual/de/function.http-build-query.php). This method automatically inserts 0 or 1 into the query string for boolean values.