<commit_before><?php

namespace Github\Api\Repository;

use Github\Api\AbstractApi;
use Github\Exception\MissingArgumentException;

/**
 * @link   http://developer.github.com/v3/repos/comments/
 * @author <NAME> <<EMAIL>>
 */
class Comments extends AbstractApi
{
    public function all($username, $repository, $sha = null)
    {
        if (null === $sha) {
            return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/comments');
        }

        return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/commits/'.urlencode($sha).'/comments');
    }

    public function show($username, $repository, $comment)
    {
        return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/comments/'.urlencode($comment));
    }

    public function create($username, $repository, $sha, array $params)
    {
        if (!isset($params['body'], $params['commit_id'], $params['line'], $params['path'], $params['position'])) {
            throw new MissingArgumentException(array('body', 'commit_id', 'line', 'path', 'position'));
        }

        return $this->post('repos/'.urlencode($username).'/'.urlencode($repository).'/commits/'.urlencode($sha).'/comments', $params);
    }

    public function update($username, $repository, $comment, array $params)
    {<commit_msg>Adjust repo comment API to latest changes<commit_after><?php

namespace Github\Api\Repository;

use Github\Api\AbstractApi;
use Github\Exception\MissingArgumentException;

/**
 * @link   http://developer.github.com/v3/repos/comments/
 * @author <NAME> <<EMAIL>>
 */
class Comments extends AbstractApi
{
    public function all($username, $repository, $sha = null)
    {
        if (null === $sha) {
            return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/comments');
        }

        return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/commits/'.urlencode($sha).'/comments');
    }

    public function show($username, $repository, $comment)
    {
        return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/comments/'.urlencode($comment));
    }

    public function create($username, $repository, $sha, array $params)
    {
        if (!isset($params['body'], $params['path'], $params['position'])) {
            throw new MissingArgumentException(array('body', 'path', 'position'));
        }

        return $this->post('repos/'.urlencode($username).'/'.urlencode($repository).'/commits/'.urlencode($sha).'/comments', $params);
    }

    public function update($username, $repository, $comment, array $params)
    {
{'fraction_non_alphanumeric': 0.19530658591975775, 'fraction_numerical': 0.000757002271006813, 'mean_word_length': 3.7280858676207513, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '4317552', 'n_tokens_mistral': 791, 'n_tokens_neox': 744, 'n_words': 134}