Skip to content

Commit b285885

Browse files
Jakub Nowakm1guelpf
authored andcommitted
Added tests for impersonation tokens filter
1 parent ca710c0 commit b285885

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/Gitlab/Api/Users.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,13 @@ public function email($id)
261261
*/
262262
public function userImpersonationTokens($user_id, array $params = [])
263263
{
264-
if (count($params)) {
265-
$resolver = $this->createOptionsResolver();
264+
$resolver = $this->createOptionsResolver();
266265

267-
$resolver->setDefined('state')
268-
->setAllowedValues('state', ['all', 'active', 'inactive'])
269-
;
270-
}
266+
$resolver->setDefined('state')
267+
->setAllowedValues('state', ['all', 'active', 'inactive'])
268+
;
271269

272-
return $this->get('users/'.$this->encodePath($user_id).'/impersonation_tokens', count($params) ? $resolver->resolve($params) : []);
270+
return $this->get('users/'.$this->encodePath($user_id).'/impersonation_tokens', $resolver->resolve($params));
273271
}
274272

275273
/**

0 commit comments

Comments
 (0)