LeagueWrap\Api\AbstractApi::clientRequest PHP Method

clientRequest() protected method

Make the actual request.
protected clientRequest ( boolean $static, string $uri, array $params ) : Response
$static boolean
$uri string
$params array
return LeagueWrap\Response
    protected function clientRequest($static, $uri, $params)
    {
        // check if we have hit the limit
        if (!$static && !$this->collection->hitLimits($this->region->getRegion())) {
            throw new LimitReachedException('You have hit the request limit in your collection.');
        }
        $response = $this->client->request($uri, $params);
        ++$this->requests;
        // check if it's a valid response object
        if ($response instanceof Response) {
            $this->checkResponseErrors($response);
        }
        return $response;
    }

Usage Example

 /**
  * Intercept client request to patch platform id into url (ugly hack!)
  *
  * @param bool $static
  * @param string $uri
  * @param array $params
  * @return string
  * @throws \LeagueWrap\Exception\LimitReachedException
  */
 protected function clientRequest($static, $uri, $params)
 {
     $uri = sprintf($uri, $this->platformIds[$this->region->getRegion()]);
     return parent::clientRequest($static, $uri, $params);
 }