public function canCall( string $api_key, string $region, string $resource, string $endpoint): bool
	{
		$appLimits = $this->getAppLimits($api_key, $region);
		if (is_array($appLimits) && $resource != LeagueAPI::RESOURCE_STATICDATA)
		{
			foreach ($appLimits as $timeInterval => $limits)
			{
				//  Check all saved intervals for this region
				if ($limits['used'] >= $limits['limit'] && $limits['expires'] > time())
					return false;
			}
		}

		$methodLimits = $this->getMethodLimits($api_key, $region, $endpoint);
		if (is_array($methodLimits))
		{
			foreach ($methodLimits as $timeInterval => $limits)
			{
				//  Check all saved intervals for this endpoint
				if ($limits['used'] >= $limits['limit'] && $limits['expires'] > time())
					return false;
			}
		}

		return true;
	}
public function canCall( string $api_key, string $region, string $resource, string $endpoint): bool
	{
		$appLimits = $this->getAppLimits($api_key, $region);
		if (is_array($appLimits) && $resource != LeagueAPI::RESOURCE_STATICDATA)
		{
			foreach ($appLimits as $timeInterval => $limits)
			{
				//  Check all saved intervals for this region
				if ($limits['used'] >= $limits['limit'] && $limits['expires'] > time())
					return false;
			}
		}

		$methodLimits = $this->getMethodLimits($api_key, $region, $endpoint);
		if (is_array($methodLimits))
		{
			foreach ($methodLimits as $timeInterval => $limits)
			{
				//  Check all saved intervals for this endpoint
				if ($limits['used'] >= $limits['limit'] && $limits['expires'] > time())
					return false;
			}
		}

		return true;
	}
public function canCall ( string $ api_key , string $ region , string $ resource , string $ endpoint ) : bool { $ appLimits = $ this -> getAppLimits ( $ api_key , $ region ) ; if ( is_array ( $ appLimits ) && $ resource != LeagueAPI :: RESOURCE_STATICDATA ) { foreach ( $ appLimits as $ timeInterval => $ limits ) { //  Check all saved intervals for this region if ( $ limits [ 'used' ] >= $ limits [ 'limit' ] && $ limits [ 'expires' ] > time ( ) ) return false ; } } $ methodLimits = $ this -> getMethodLimits ( $ api_key , $ region , $ endpoint ) ; if ( is_array ( $ methodLimits ) ) { foreach ( $ methodLimits as $ timeInterval => $ limits ) { //  Check all saved intervals for this endpoint if ( $ limits [ 'used' ] >= $ limits [ 'limit' ] && $ limits [ 'expires' ] > time ( ) ) return false ; } } return true ; }
Determines whether or not API call can be made.

@param string $api_key
@param string $region
@param string $resource
@param string $endpoint

@return bool
Determines whether or not API call can be made .