<commit_before><?php

namespace Vfac\Tmdb;

class CurlRequest implements Interfaces\HttpRequestInterface
{

    private $handle = null;

    /**
     * Set the url to cUrl call
     * @param string $url
     * @throws Exception
     */
    public function setUrl(string $url): void
    {
        $this->handle = curl_init($url);
    }

    /**
     * Close cUrl handle
     */
    public function close(): void
    {
        curl_close($this->handle);
    }

    /**
     * Execute cUrl call
     * @return mixed
     * @throws \Exception
     */
    public function execute()
    {
        $result = curl_exec($this->handle);
        if ($result === false)
        {
            throw new \Exception('cUrl failed : '.var_export($this->getInfo(), true), 1004);
        }
        return $return;
    }

    /**
     * Get cUrl infos
     * @param string $name
     * @return mixed
     * @throws Exception
     */
    public function getInfo(string $name = '')
    {
        if (empty($name))
        {<commit_msg>Fix variable name<commit_after><?php

namespace Vfac\Tmdb;

class CurlRequest implements Interfaces\HttpRequestInterface
{

    private $handle = null;

    /**
     * Set the url to cUrl call
     * @param string $url
     * @throws Exception
     */
    public function setUrl(string $url): void
    {
        $this->handle = curl_init($url);
    }

    /**
     * Close cUrl handle
     */
    public function close(): void
    {
        curl_close($this->handle);
    }

    /**
     * Execute cUrl call
     * @return mixed
     * @throws \Exception
     */
    public function execute()
    {
        $result = curl_exec($this->handle);
        if ($result === false)
        {
            throw new \Exception('cUrl failed : '.var_export($this->getInfo(), true), 1004);
        }
        return $result;
    }

    /**
     * Get cUrl infos
     * @param string $name
     * @return mixed
     * @throws Exception
     */
    public function getInfo(string $name = '')
    {
        if (empty($name))
        {
{'fraction_non_alphanumeric': 0.12807881773399016, 'fraction_numerical': 0.003940886699507389, 'mean_word_length': 1.8169209431345354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5353538', 'n_tokens_mistral': 613, 'n_tokens_neox': 598, 'n_words': 154}