Skip to content

Commit 6bc0309

Browse files
author
Dickriven Chellemboyee
committed
add parameters to project
to include: - statistics - custom attributes
1 parent c1ce05c commit 6bc0309

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/Gitlab/Api/Projects.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,21 @@ public function all(array $parameters = [])
8787
* @param int $project_id
8888
* @return mixed
8989
*/
90-
public function show($project_id)
90+
public function show($project_id, array $parameters = [])
9191
{
92-
return $this->get('projects/'.$this->encodePath($project_id));
92+
$resolver = $this->createOptionsResolver();
93+
$booleanNormalizer = function (Options $resolver, $value) {
94+
return $value ? 'true' : 'false';
95+
};
96+
$resolver->setDefined('statistics')
97+
->setAllowedTypes('statistics', 'bool')
98+
->setNormalizer('statistics', $booleanNormalizer)
99+
;
100+
$resolver->setDefined('with_custom_attributes')
101+
->setAllowedTypes('with_custom_attributes', 'bool')
102+
->setNormalizer('with_custom_attributes', $booleanNormalizer)
103+
;
104+
return $this->get('projects/'.$this->encodePath($project_id), $resolver->resolve($parameters));
93105
}
94106

95107
/**

0 commit comments

Comments
 (0)