Vectorface\Whip\Whip::isMethodUsable PHP Méthode

isMethodUsable() private méthode

This method checks if the method is enabled and whether the method's data is usable given it's IP whitelist.
private isMethodUsable ( string $key, string $ipAddress ) : boolean
$key string The source key.
$ipAddress string The IP address.
Résultat boolean Returns true if the IP address is whitelisted and false otherwise. Returns true if the source does not have a whitelist specified.
    private function isMethodUsable($key, $ipAddress)
    {
        if (!($key & $this->enabled)) {
            return false;
        }
        if (!isset($this->whitelist[$key])) {
            return true;
        }
        return $this->whitelist[$key]->isIpWhitelisted($ipAddress);
    }