@@ -105,7 +105,7 @@ public function remove($project_id)
105105 */
106106 public function members ($ project_id , $ username_query = null )
107107 {
108- return $ this ->get (' projects/ ' . urlencode ($ project_id). ' / members ' , array (
108+ return $ this ->get ($ this -> getProjectPath ($ project_id, ' members ') , array (
109109 'query ' => $ username_query
110110 ));
111111 }
@@ -117,7 +117,7 @@ public function members($project_id, $username_query = null)
117117 */
118118 public function member ($ project_id , $ user_id )
119119 {
120- return $ this ->get (' projects/ ' . urlencode ($ project_id). ' / members/ ' .urlencode ($ user_id ));
120+ return $ this ->get ($ this -> getProjectPath ($ project_id, ' members/ ' .urlencode ($ user_id) ));
121121 }
122122
123123 /**
@@ -128,7 +128,7 @@ public function member($project_id, $user_id)
128128 */
129129 public function addMember ($ project_id , $ user_id , $ access_level )
130130 {
131- return $ this ->post (' projects/ ' . urlencode ($ project_id). ' / members ' , array (
131+ return $ this ->post ($ this -> getProjectPath ($ project_id, ' members ') , array (
132132 'user_id ' => $ user_id ,
133133 'access_level ' => $ access_level
134134 ));
@@ -142,7 +142,7 @@ public function addMember($project_id, $user_id, $access_level)
142142 */
143143 public function saveMember ($ project_id , $ user_id , $ access_level )
144144 {
145- return $ this ->put (' projects/ ' . urlencode ($ project_id). ' / members/ ' .urldecode ($ user_id ), array (
145+ return $ this ->put ($ this -> getProjectPath ($ project_id, ' members/ ' .urldecode ($ user_id) ), array (
146146 'access_level ' => $ access_level
147147 ));
148148 }
@@ -154,7 +154,7 @@ public function saveMember($project_id, $user_id, $access_level)
154154 */
155155 public function removeMember ($ project_id , $ user_id )
156156 {
157- return $ this ->delete (' projects/ ' . urlencode ($ project_id). ' / members/ ' .urldecode ($ user_id ));
157+ return $ this ->delete ($ this -> getProjectPath ($ project_id, ' members/ ' .urldecode ($ user_id) ));
158158 }
159159
160160 /**
@@ -165,7 +165,7 @@ public function removeMember($project_id, $user_id)
165165 */
166166 public function hooks ($ project_id , $ page = 1 , $ per_page = self ::PER_PAGE )
167167 {
168- return $ this ->get (' projects/ ' . urlencode ($ project_id). ' / hooks ' , array (
168+ return $ this ->get ($ this -> getProjectPath ($ project_id, ' hooks ') , array (
169169 'page ' => $ page ,
170170 'per_page ' => $ per_page
171171 ));
@@ -178,7 +178,7 @@ public function hooks($project_id, $page = 1, $per_page = self::PER_PAGE)
178178 */
179179 public function hook ($ project_id , $ hook_id )
180180 {
181- return $ this ->get (' projects/ ' . urlencode ($ project_id). ' / hooks/ ' .urlencode ($ hook_id ));
181+ return $ this ->get ($ this -> getProjectPath ($ project_id, ' hooks/ ' .urlencode ($ hook_id) ));
182182 }
183183
184184 /**
@@ -192,7 +192,7 @@ public function hook($project_id, $hook_id)
192192 */
193193 public function addHook ($ project_id , $ url , $ push_events = true , $ issues_events = false , $ merge_requests_events = false , $ tag_push_events = false )
194194 {
195- return $ this ->post (' projects/ ' . urlencode ($ project_id). ' / hooks ' , array (
195+ return $ this ->post ($ this -> getProjectPath ($ project_id, ' hooks ') , array (
196196 'url ' => $ url ,
197197 'push_events ' => $ push_events ,
198198 'issues_events ' => $ issues_events ,
@@ -233,7 +233,7 @@ public function updateHook($project_id, $hook_id, $url, $push_events = null, $is
233233 $ params ['tag_push_events ' ] = $ tag_push_events ;
234234 }
235235
236- return $ this ->put (' projects/ ' . urlencode ($ project_id). ' / hooks/ ' .urlencode ($ hook_id ), $ params );
236+ return $ this ->put ($ this -> getProjectPath ($ project_id, ' hooks/ ' .urlencode ($ hook_id) ), $ params );
237237 }
238238
239239 /**
@@ -243,7 +243,7 @@ public function updateHook($project_id, $hook_id, $url, $push_events = null, $is
243243 */
244244 public function removeHook ($ project_id , $ hook_id )
245245 {
246- return $ this ->delete (' projects/ ' . urlencode ($ project_id). ' / hooks/ ' .urlencode ($ hook_id ));
246+ return $ this ->delete ($ this -> getProjectPath ($ project_id, ' hooks/ ' .urlencode ($ hook_id) ));
247247 }
248248
249249 /**
@@ -252,7 +252,7 @@ public function removeHook($project_id, $hook_id)
252252 */
253253 public function keys ($ project_id )
254254 {
255- return $ this ->get (' projects/ ' . urlencode ($ project_id). ' / keys ' );
255+ return $ this ->get ($ this -> getProjectPath ($ project_id, ' keys ') );
256256 }
257257
258258 /**
@@ -262,7 +262,7 @@ public function keys($project_id)
262262 */
263263 public function key ($ project_id , $ key_id )
264264 {
265- return $ this ->get (' projects/ ' . urlencode ($ project_id). ' / keys/ ' .urlencode ($ key_id ));
265+ return $ this ->get ($ this -> getProjectPath ($ project_id, ' keys/ ' .urlencode ($ key_id) ));
266266 }
267267
268268 /**
@@ -273,7 +273,7 @@ public function key($project_id, $key_id)
273273 */
274274 public function addKey ($ project_id , $ title , $ key )
275275 {
276- return $ this ->post (' projects/ ' . urlencode ($ project_id). ' / keys ' , array (
276+ return $ this ->post ($ this -> getProjectPath ($ project_id, ' keys ') , array (
277277 'title ' => $ title ,
278278 'key ' => $ key
279279 ));
@@ -286,7 +286,7 @@ public function addKey($project_id, $title, $key)
286286 */
287287 public function removeKey ($ project_id , $ key_id )
288288 {
289- return $ this ->delete (' projects/ ' . urlencode ($ project_id). ' / keys/ ' .urlencode ($ key_id ));
289+ return $ this ->delete ($ this -> getProjectPath ($ project_id, ' keys/ ' .urlencode ($ key_id) ));
290290 }
291291
292292 /**
@@ -295,7 +295,7 @@ public function removeKey($project_id, $key_id)
295295 */
296296 public function events ($ project_id )
297297 {
298- return $ this ->get (' projects/ ' . urlencode ($ project_id). ' / events ' );
298+ return $ this ->get ($ this -> getProjectPath ($ project_id, ' events ') );
299299 }
300300
301301 /**
@@ -304,7 +304,7 @@ public function events($project_id)
304304 */
305305 public function labels ($ project_id )
306306 {
307- return $ this ->get (' projects/ ' . urlencode ($ project_id). ' / labels ' );
307+ return $ this ->get ($ this -> getProjectPath ($ project_id, ' labels ') );
308308 }
309309
310310 /**
@@ -314,7 +314,7 @@ public function labels($project_id)
314314 */
315315 public function addLabel ($ project_id , array $ params )
316316 {
317- return $ this ->post (' projects/ ' . urlencode ($ project_id). ' / labels ' , $ params );
317+ return $ this ->post ($ this -> getProjectPath ($ project_id, ' labels ' , $ params) );
318318 }
319319
320320 /**
@@ -324,7 +324,7 @@ public function addLabel($project_id, array $params)
324324 */
325325 public function updateLabel ($ project_id , array $ params )
326326 {
327- return $ this ->put (' projects/ ' . urlencode ($ project_id). ' / labels ' , $ params );
327+ return $ this ->put ($ this -> getProjectPath ($ project_id, ' labels ' , $ params) );
328328 }
329329
330330 /**
@@ -334,7 +334,7 @@ public function updateLabel($project_id, array $params)
334334 */
335335 public function removeLabel ($ project_id , array $ params )
336336 {
337- return $ this ->delete (' projects/ ' . urlencode ($ project_id). ' / labels ' , $ params );
337+ return $ this ->delete ($ this -> getProjectPath ($ project_id, ' labels ') , $ params );
338338 }
339339
340340 /**
@@ -344,7 +344,7 @@ public function removeLabel($project_id, array $params)
344344 */
345345 public function createForkRelation ($ project_id , $ forked_project_id )
346346 {
347- return $ this ->post (' projects/ ' . urlencode ($ project_id). ' / fork/ ' .urlencode ($ forked_project_id ));
347+ return $ this ->post ($ this -> getProjectPath ($ project_id, ' fork/ ' .urlencode ($ forked_project_id) ));
348348 }
349349
350350 /**
@@ -353,7 +353,7 @@ public function createForkRelation($project_id, $forked_project_id)
353353 */
354354 public function removeForkRelation ($ project_id )
355355 {
356- return $ this ->delete (' projects/ ' . urlencode ($ project_id). ' / fork ' );
356+ return $ this ->delete ($ this -> getProjectPath ($ project_id, ' fork ') );
357357 }
358358
359359 /**
@@ -364,7 +364,7 @@ public function removeForkRelation($project_id)
364364 */
365365 public function setService ($ project_id , $ service_name , array $ params = array ())
366366 {
367- return $ this ->put (' projects/ ' . urlencode ($ project_id). ' / services/ ' .urlencode ($ service_name ), $ params );
367+ return $ this ->put ($ this -> getProjectPath ($ project_id, ' services/ ' .urlencode ($ service_name) ), $ params );
368368 }
369369
370370 /**
@@ -374,6 +374,6 @@ public function setService($project_id, $service_name, array $params = array())
374374 */
375375 public function removeService ($ project_id , $ service_name )
376376 {
377- return $ this ->delete (' projects/ ' . urlencode ($ project_id). ' / services/ ' .urlencode ($ service_name ));
377+ return $ this ->delete ($ this -> getProjectPath ($ project_id, ' services/ ' .urlencode ($ service_name) ));
378378 }
379379}
0 commit comments