Skip to content

Commit a51fef9

Browse files
committed
Merge pull request KnpLabs#94 from jenssegers/patch-1
Add API request to get the readme content
2 parents 001f9a5 + 3cc624a commit a51fef9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,20 @@ public function remove($username, $repository)
143143
{
144144
return $this->delete('repos/'.rawurlencode($username).'/'.rawurlencode($repository));
145145
}
146+
147+
/**
148+
* Get the readme content for a repository by its username and repository name
149+
* @link http://developer.github.com/v3/repos/contents/#get-the-readme
150+
*
151+
* @param string $username the user who owns the repository
152+
* @param string $repository the name of the repository
153+
*
154+
* @return array the readme content
155+
*/
156+
public function readme($username, $repository)
157+
{
158+
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/readme');
159+
}
146160

147161
/**
148162
* Manage the collaborators of a repository

0 commit comments

Comments
 (0)