Skip to content

Commit 8ef3980

Browse files
committed
Do little code/phpdocs fixes
1 parent 99df80d commit 8ef3980

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

lib/Github/Api/CurrentUser/Emails.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Emails extends AbstractApi
1313
{
1414
/**
1515
* List emails for the authenticated user
16-
* @link http://developer.github.com/v3/repos/emails/
16+
* @link http://developer.github.com/v3/users/emails/
1717
*
1818
* @return array
1919
*/
@@ -24,7 +24,7 @@ public function all()
2424

2525
/**
2626
* Adds one or more email for the authenticated user
27-
* @link http://developer.github.com/v3/repos/emails/
27+
* @link http://developer.github.com/v3/users/emails/
2828
*
2929
* @param string|array $emails
3030
* @return array
@@ -44,7 +44,7 @@ public function add($emails)
4444

4545
/**
4646
* Removes one or more email for the authenticated user
47-
* @link http://developer.github.com/v3/repos/emails/
47+
* @link http://developer.github.com/v3/users/emails/
4848
*
4949
* @param string|array $emails
5050
* @return array
@@ -59,6 +59,6 @@ public function remove($emails)
5959
throw new InvalidArgumentException();
6060
}
6161

62-
return $this->delete('user/emails/', $emails);
62+
return $this->delete('user/emails', $emails);
6363
}
6464
}

lib/Github/Api/Issue/Events.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Events extends AbstractApi
1212
{
1313
public function all($username, $repository, $issue = null, $page = 1)
1414
{
15-
if (null === $issue) {
15+
if (null !== $issue) {
1616
return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/issues/'.urlencode($issue).'/events', array(
1717
'page' => $page
1818
));

lib/Github/Api/Issue/Milestones.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ class Milestones extends AbstractApi
1313
{
1414
public function all($username, $repository, array $params = array())
1515
{
16-
if (!in_array($params['state'], array('open', 'closed'))) {
16+
if (isset($params['state']) && !in_array($params['state'], array('open', 'closed'))) {
1717
$params['state'] = 'open';
1818
}
19-
if (!in_array($params['sort'], array('due_date', 'completeness'))) {
19+
if (isset($params['sort']) && !in_array($params['sort'], array('due_date', 'completeness'))) {
2020
$params['sort'] = 'due_date';
2121
}
22-
if (!in_array($params['direction'], array('asc', 'desc'))) {
22+
if (isset($params['direction']) && !in_array($params['direction'], array('asc', 'desc'))) {
2323
$params['direction'] = 'desc';
2424
}
2525

lib/Github/Api/Repository/Contents.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ class Contents extends AbstractApi
1313
{
1414
public function readme($username, $repository, $reference = null)
1515
{
16-
return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/contents/readme', array(
17-
'ref' => $reference
18-
));
16+
return $this->show($username, $repository, 'readme', $reference);
1917
}
2018

2119
public function show($username, $repository, $path, $reference = null)

lib/Github/HttpClient/HttpClient.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function authenticate()
8585
$this->browser->addListener(
8686
new AuthListener(
8787
$this->options['auth_method'],
88-
array($this->options['login'], $this->options['password'], $this->options['token'])
88+
array('login' => $this->options['login'], 'password' => $this->options['password'], 'token' => $this->options['token'])
8989
)
9090
);
9191
}
@@ -96,6 +96,8 @@ public function authenticate()
9696
public function setHeaders(array $headers)
9797
{
9898
$this->headers = $headers;
99+
100+
return $this;
99101
}
100102

101103
/**

lib/Github/HttpClient/HttpClientInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function setOption($name, $value);
8383
* Set HTTP headers
8484
*
8585
* @param array $headers
86+
* @return HttpClientInterface The current object instance
8687
*/
8788
public function setHeaders(array $headers);
8889
}

0 commit comments

Comments
 (0)