<commit_before><?php
namespace Robo\Task\Development;

use Robo\Exception\TaskException;
use Robo\Task\BaseTask;

/**
 * @method \Robo\Task\Development\GitHub repo(string)
 * @method \Robo\Task\Development\GitHub owner(string)
 */
abstract class GitHub extends BaseTask
{
    const GITHUB_URL = 'https://api.github.com';

    protected $user = '';
    protected $pass = '';

    protected $repo;
    protected $owner;

    public function repo($repo)
    {
        $this->repo = $repo;
        return $this;
    }

    public function owner($owner)
    {
        $this->owner = $owner;
    }

    public function uri($uri)
    {
        list($this->owner, $this->repo) = explode('/', $uri);
        return $this;
    }

    protected function getUri()
    {
        return $this->owner . '/' . $this->repo;
    }

    public function user($user)
    {
        $this->user = $user;
        return $this;
    }

    public function password($password)
    {
        $this->password = $password;
        return $this;
    }

    protected function sendRequest($uri, $params = [], $method = 'POST')
    {
        if (!$this->owner or !$this->repo) {
            throw new TaskException($this, 'Repo URI is not set');
        }

        $ch = curl_init();
        $url = sprintf('%s/repos/%s/%s', self::GITHUB_URL, $this->getUri(), $uri);
        $this->printTaskInfo('{method} {$url}', ['method' => $method, 'url' => $url]);

        if (!empty(self::$user)) {
            curl_setopt($ch, CURLOPT_USERPWD, self::$user . ':' . self::$pass);
        }

        curl_setopt_array(
            $ch,<commit_msg>Fix typo in GitHub task: pass vs password.<commit_after><?php
namespace Robo\Task\Development;

use Robo\Exception\TaskException;
use Robo\Task\BaseTask;

/**
 * @method \Robo\Task\Development\GitHub repo(string)
 * @method \Robo\Task\Development\GitHub owner(string)
 */
abstract class GitHub extends BaseTask
{
    const GITHUB_URL = 'https://api.github.com';

    protected $user = '';
    protected $password = '';

    protected $repo;
    protected $owner;

    public function repo($repo)
    {
        $this->repo = $repo;
        return $this;
    }

    public function owner($owner)
    {
        $this->owner = $owner;
    }

    public function uri($uri)
    {
        list($this->owner, $this->repo) = explode('/', $uri);
        return $this;
    }

    protected function getUri()
    {
        return $this->owner . '/' . $this->repo;
    }

    public function user($user)
    {
        $this->user = $user;
        return $this;
    }

    public function password($password)
    {
        $this->password = <PASSWORD>;
        return $this;
    }

    protected function sendRequest($uri, $params = [], $method = 'POST')
    {
        if (!$this->owner or !$this->repo) {
            throw new TaskException($this, 'Repo URI is not set');
        }

        $ch = curl_init();
        $url = sprintf('%s/repos/%s/%s', self::GITHUB_URL, $this->getUri(), $uri);
        $this->printTaskInfo('{method} {$url}', ['method' => $method, 'url' => $url]);

        if (!empty($this->user)) {
            curl_setopt($ch, CURLOPT_USERPWD, $this->user . ':' . $this->password);
        }

        curl_setopt_array(
            $ch,
{'fraction_non_alphanumeric': 0.16676942046855733, 'fraction_numerical': 0.0, 'mean_word_length': 2.2645875251509056, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 35, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5085761', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1021, 'n_words': 224}