public function getApiCalls(string $type = 'rest', string $key = null)
    {
        if ($key) {
            $keys = array_keys($this->apiCallLimits[$type]);
            if (!in_array($key, $keys)) {
                // No key like that in array
                throw new Exception('Invalid API call limit key. Valid keys are: '.implode(', ', $keys));
            }

            // Return the key value requested
            return $this->apiCallLimits[$type][$key];
        }

        // Return all the values
        return $this->apiCallLimits[$type];
    }
public function getApiCalls(string $type = 'rest', string $key = null)
    {
        if ($key) {
            $keys = array_keys($this->apiCallLimits[$type]);
            if (!in_array($key, $keys)) {
                // No key like that in array
                throw new Exception('Invalid API call limit key. Valid keys are: '.implode(', ', $keys));
            }

            // Return the key value requested
            return $this->apiCallLimits[$type][$key];
        }

        // Return all the values
        return $this->apiCallLimits[$type];
    }
public function getApiCalls ( string $ type = 'rest' , string $ key = null ) { if ( $ key ) { $ keys = array_keys ( $ this -> apiCallLimits [ $ type ] ) ; if ( ! in_array ( $ key , $ keys ) ) { // No key like that in array throw new Exception ( 'Invalid API call limit key. Valid keys are: ' . implode ( ', ' , $ keys ) ) ; } // Return the key value requested return $ this -> apiCallLimits [ $ type ] [ $ key ] ; } // Return all the values return $ this -> apiCallLimits [ $ type ] ; }
Returns the current API call limits.

@param string|null $key The key to grab (left, made, limit, etc)

@throws \Exception When attempting to grab a key that doesn't exist

@return array An array of the Guzzle response, and JSON-decoded body
Returns the current API call limits .