使用一个 github 接口的 composer 包. 其中有一个获取 readme 的接口少了一个参数[分支]. 如何在不改动代码的情况下来增加一个参数?
/**
* Get the readme content for a repository by its username and repository name.
*
* @link http://developer.github.com/v3/repos/contents/#get-the-readme
*
* @param string $username the user who owns the repository
* @param string $repository the name of the repository
* @param string $format one of formats: "raw", "html", or "v3+json"
*
* @return string|array the readme content
*/
public function readme($username, $repository, $format = 'raw')
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/readme', [], [
'Accept' => "application/vnd.github.$format",
]);
}