Skip to content

Commit 75de3ff

Browse files
committed
Fix parameter types for id in issue, issue category and time entry
1 parent 9c3b01e commit 75de3ff

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/Redmine/Api/Issue.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,22 +219,22 @@ public function update($id, array $params)
219219
}
220220

221221
/**
222-
* @param int $id
223-
* @param string $watcherUserId
222+
* @param int $id
223+
* @param int $watcherUserId
224224
*
225225
* @return false|string
226226
*/
227227
public function addWatcher($id, $watcherUserId)
228228
{
229229
return $this->post(
230230
'/issues/' . urlencode(strval($id)) . '/watchers.xml',
231-
XmlSerializer::createFromArray(['user_id' => $watcherUserId])->getEncoded()
231+
XmlSerializer::createFromArray(['user_id' => urlencode(strval($watcherUserId))])->getEncoded()
232232
);
233233
}
234234

235235
/**
236-
* @param int $id
237-
* @param string $watcherUserId
236+
* @param int $id
237+
* @param int $watcherUserId
238238
*
239239
* @return false|\SimpleXMLElement|string
240240
*/

src/Redmine/Api/IssueCategory.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ public function getIdByName($project, $name)
125125
*
126126
* @see http://www.redmine.org/projects/redmine/wiki/Rest_IssueCategories#GET-2
127127
*
128-
* @param string $id the issue category id
128+
* @param int $id the issue category id
129129
*
130130
* @return array information about the category
131131
*/
132132
public function show($id)
133133
{
134-
return $this->get('/issue_categories/' . urlencode($id) . '.json');
134+
return $this->get('/issue_categories/' . urlencode(strval($id)) . '.json');
135135
}
136136

137137
/**
@@ -171,7 +171,7 @@ public function create($project, array $params = [])
171171
*
172172
* @see http://www.redmine.org/projects/redmine/wiki/Rest_IssueCategories#PUT
173173
*
174-
* @param string $id the issue category id
174+
* @param int $id the issue category id
175175
*
176176
* @return string|false
177177
*/
@@ -184,7 +184,7 @@ public function update($id, array $params)
184184
$params = $this->sanitizeParams($defaults, $params);
185185

186186
return $this->put(
187-
'/issue_categories/' . $id . '.xml',
187+
'/issue_categories/' . urlencode(strval($id)) . '.xml',
188188
XmlSerializer::createFromArray(['issue_category' => $params])->getEncoded()
189189
);
190190
}
@@ -204,7 +204,7 @@ public function update($id, array $params)
204204
public function remove($id, array $params = [])
205205
{
206206
return $this->delete(
207-
PathSerializer::create('/issue_categories/' . $id . '.xml', $params)->getPath()
207+
PathSerializer::create('/issue_categories/' . urlencode(strval($id)) . '.xml', $params)->getPath()
208208
);
209209
}
210210
}

src/Redmine/Api/IssueRelation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function all($issueId, array $params = [])
8383
*/
8484
public function show($id)
8585
{
86-
$ret = $this->get('/relations/' . urlencode($id) . '.json');
86+
$ret = $this->get('/relations/' . urlencode(strval($id)) . '.json');
8787
if (false === $ret) {
8888
return [];
8989
}
@@ -126,7 +126,7 @@ public function create($issueId, array $params = [])
126126
$params = $this->sanitizeParams($defaults, $params);
127127

128128
$response = $this->post(
129-
'/issues/' . urlencode($issueId) . '/relations.json',
129+
'/issues/' . urlencode(strval($issueId)) . '/relations.json',
130130
JsonSerializer::createFromArray(['relation' => $params])->getEncoded()
131131
);
132132

src/Redmine/Api/TimeEntry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public function all(array $params = [])
7676
*
7777
* @see http://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries
7878
*
79-
* @param string $id the time entry id
79+
* @param int $id the time entry id
8080
*
8181
* @return array information about the time entry
8282
*/
8383
public function show($id)
8484
{
85-
return $this->get('/time_entries/' . urlencode($id) . '.json');
85+
return $this->get('/time_entries/' . urlencode(strval($id)) . '.json');
8686
}
8787

8888
/**

0 commit comments

Comments
 (0)