public function download()
    {
        $handle = curl_init();
        $http_proxy = filter_input(INPUT_ENV, 'HTTPS_PROXY', FILTER_SANITIZE_URL);

        curl_setopt_array($handle, array(
            CURLOPT_URL => sprintf('https://api.github.com/gists/%s', $this->id),
            CURLOPT_HTTPHEADER => array(
                'Accept: application/vnd.github.v3+json',
                'User-Agent: Melody-Script',
            ),
            CURLOPT_RETURNTRANSFER => 1,
        ));

        if ($http_proxy) {
            curl_setopt($handle, CURLOPT_PROXY, $http_proxy);
        }

        $content = curl_exec($handle);
        curl_close($handle);

        if (!$content) {
            throw new \InvalidArgumentException(sprintf('Gist "%s" not found', $this->id));
        }

        return json_decode($content, true);
    }
public function download()
    {
        $handle = curl_init();
        $http_proxy = filter_input(INPUT_ENV, 'HTTPS_PROXY', FILTER_SANITIZE_URL);

        curl_setopt_array($handle, array(
            CURLOPT_URL => sprintf('https://api.github.com/gists/%s', $this->id),
            CURLOPT_HTTPHEADER => array(
                'Accept: application/vnd.github.v3+json',
                'User-Agent: Melody-Script',
            ),
            CURLOPT_RETURNTRANSFER => 1,
        ));

        if ($http_proxy) {
            curl_setopt($handle, CURLOPT_PROXY, $http_proxy);
        }

        $content = curl_exec($handle);
        curl_close($handle);

        if (!$content) {
            throw new \InvalidArgumentException(sprintf('Gist "%s" not found', $this->id));
        }

        return json_decode($content, true);
    }
public function download ( ) { $ handle = curl_init ( ) ; $ http_proxy = filter_input ( INPUT_ENV , 'HTTPS_PROXY' , FILTER_SANITIZE_URL ) ; curl_setopt_array ( $ handle , array ( CURLOPT_URL => sprintf ( 'https://api.github.com/gists/%s' , $ this -> id ) , CURLOPT_HTTPHEADER => array ( 'Accept: application/vnd.github.v3+json' , 'User-Agent: Melody-Script' , ) , CURLOPT_RETURNTRANSFER => 1 , ) ) ; if ( $ http_proxy ) { curl_setopt ( $ handle , CURLOPT_PROXY , $ http_proxy ) ; } $ content = curl_exec ( $ handle ) ; curl_close ( $ handle ) ; if ( ! $ content ) { throw new \ InvalidArgumentException ( sprintf ( 'Gist "%s" not found' , $ this -> id ) ) ; } return json_decode ( $ content , true ) ; }
Call Github and return JSON data.

@return mixed<string> the content of API call to Github
Call Github and return JSON data .