<commit_before><?php
namespace Lysine;

if (!extension_loaded('curl'))
    throw new \Lysine\RuntimeError('Require curl extension');

class Curl {
    protected $handler;
    protected $options = array();

    public function __destruct() {
        $this->close();
    }

    public function close() {
        if ($this->handler) {
            curl_close($this->handler);
            unset($this->handler);
        }
        return $this;
    }

    public function setOptions(array $options) {
        $this->options = array_merge($this->options, $options);
        return $this;
    }

    public function execute($url, array $options = array()) {
        $this->close();

        $options = $options ? array_merge($this->options, $options) : $this->options;
        $options[CURLOPT_URL] = $url;

        $handler = curl_init();

        curl_setopt_array($handler, $options);<commit_msg>bugfix<commit_after><?php
namespace Lysine;

if (!extension_loaded('curl'))
    throw new \Lysine\RuntimeError('Require curl extension');

class Curl {
    protected $handler;
    protected $options = array();

    public function __destruct() {
        $this->close();
    }

    public function close() {
        if ($this->handler) {
            curl_close($this->handler);
            unset($this->handler);
        }
        return $this;
    }

    public function setOptions(array $options) {
        $this->options = array_merge($this->options, $options);
        return $this;
    }

    public function execute($url, array $options = array()) {
        $this->close();

        $curl_options = $this->options;
        foreach ($options as $key => $val)
            $curl_options[$key] = $val;
        $curl_options[CURLOPT_URL] = $url;

        $handler = curl_init();

        curl_setopt_array($handler, $curl_options);
{'fraction_non_alphanumeric': 0.14489571899012074, 'fraction_numerical': 0.0, 'mean_word_length': 2.5329457364341086, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '6457866', 'n_tokens_mistral': 538, 'n_tokens_neox': 517, 'n_words': 117}