protected function buildUrl($type, $value)
    {
        $type = trim(strtolower($type));

        if (!in_array($type, ["ip", "email", "username"])) {
            throw new \InvalidArgumentException("Type of " . $type . " is not supported by the API");
        }

        $url = $this->baseApiUrl . "?";
        $url .= $type . "=";
        $url .= urlencode($value);

        // If Tor nodes are not allowed, add it as a flag.
        if (!$this->allowTorNodes) $url .= "&notorexit";


        return $url . "&f=json";
    }
protected function buildUrl($type, $value)
    {
        $type = trim(strtolower($type));

        if (!in_array($type, ["ip", "email", "username"])) {
            throw new \InvalidArgumentException("Type of " . $type . " is not supported by the API");
        }

        $url = $this->baseApiUrl . "?";
        $url .= $type . "=";
        $url .= urlencode($value);

        // If Tor nodes are not allowed, add it as a flag.
        if (!$this->allowTorNodes) $url .= "&notorexit";


        return $url . "&f=json";
    }
protected function buildUrl ( $ type , $ value ) { $ type = trim ( strtolower ( $ type ) ) ; if ( ! in_array ( $ type , [ "ip" , "email" , "username" ] ) ) { throw new \ InvalidArgumentException ( "Type of " . $ type . " is not supported by the API" ) ; } $ url = $ this -> baseApiUrl . "?" ; $ url .= $ type . "=" ; $ url .= urlencode ( $ value ) ; // If Tor nodes are not allowed, add it as a flag. if ( ! $ this -> allowTorNodes ) $ url .= "&notorexit" ; return $ url . "&f=json" ; }
Builds the URL for the spam check queries
@param string $type ip|email|username the type of spam to check $value for
@param string $value the ip, email or username to check for spam reports
@return string the full url to the api
Builds the URL for the spam check queries