Skip to content

Commit 608a836

Browse files
author
Matt Humphrey
committed
Added project update endpoint. Fixes #64
1 parent 993ed2f commit 608a836

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

lib/Gitlab/Api/Projects.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ public function createForUser($user_id, $name, array $params = array())
8989
return $this->post('projects/user/'.urlencode($user_id), $params);
9090
}
9191

92+
/**
93+
* @param int $project_id
94+
* @param array $params
95+
* @return mixed
96+
*/
97+
public function update($project_id, array $params)
98+
{
99+
return $this->put('projects/'.urlencode($project_id), $params);
100+
}
101+
92102
/**
93103
* @param int $project_id
94104
* @return mixed

lib/Gitlab/Model/Project.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ public function show()
116116
return static::fromArray($this->getClient(), $data);
117117
}
118118

119+
/**
120+
* @param array $params
121+
* @return Project
122+
*/
123+
public function update(array $params)
124+
{
125+
$data = $this->api('projects')->update($this->id, $params);
126+
127+
return static::fromArray($this->getClient(), $data);
128+
}
129+
119130
/**
120131
* @return bool
121132
*/

0 commit comments

Comments
 (0)