Skip to content

Commit 65a2059

Browse files
fiascoNyholm
authored andcommitted
Allow userId to be an optional argument. (#556)
1 parent 6b7b0aa commit 65a2059

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Github/Api/Integrations.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public function createInstallationToken($installationId, $userId = null)
2323
if ($userId) {
2424
$parameters['user_id'] = $userId;
2525
}
26-
2726
return $this->post('/installations/'.rawurlencode($installationId).'/access_tokens', $parameters);
2827
}
2928

@@ -48,9 +47,13 @@ public function findInstallations()
4847
*
4948
* @return array
5049
*/
51-
public function listRepositories($userId)
50+
public function listRepositories($userId = null)
5251
{
53-
return $this->get('/installation/repositories', ['user_id' => $userId]);
52+
$parameters = array();
53+
if ($userId) {
54+
$parameters['user_id'] = $userId;
55+
}
56+
return $this->get('/installation/repositories', $parameters);
5457
}
5558

5659
/**

0 commit comments

Comments
 (0)