Skip to content

Commit 4c5fe77

Browse files
committed
Merge pull request KnpLabs#173 from skwashd/filter-2fa
Add support for filtering organisation members by 2FA status
2 parents ee27600 + 1d2a00a commit 4c5fe77

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/Github/Api/Organization/Members.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@
1010
*/
1111
class Members extends AbstractApi
1212
{
13-
public function all($organization, $type = null)
13+
public function all($organization, $type = null, $filter = 'all')
1414
{
15+
$parameters = array();
16+
$path = 'orgs/'.rawurlencode($organization).'/';
1517
if (null === $type) {
16-
return $this->get('orgs/'.rawurlencode($organization).'/members');
18+
$path .= 'members';
19+
if (null !== $filter) {
20+
$parameters['filter'] = $filter;
21+
}
22+
} else {
23+
$path .= 'public_members';
1724
}
1825

19-
return $this->get('orgs/'.rawurlencode($organization).'/public_members');
26+
return $this->get($path, $parameters);
2027
}
2128

2229
public function show($organization, $username)

0 commit comments

Comments
 (0)