Skip to content

Commit 8ef5bbd

Browse files
committed
cleaning
1 parent a5403c4 commit 8ef5bbd

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ coding_style:
164164
multiplicative: true
165165
shift: true
166166
unary_additive: false
167-
concatenation: true
167+
concatenation: false
168168
negation: false
169169
before_left_brace:
170170
class: true

lib/Redmine/Api/AbstractApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ protected function attachCustomFieldXML(SimpleXMLElement $xml, array $fields)
181181
$_values = $_field->addChild('value');
182182
$_values->addAttribute('type', 'array');
183183
foreach ($field['value'] as $val) {
184-
$_value = $_values->addChild('value', $val);
184+
$_values->addChild('value', $val);
185185
}
186186
} else {
187187
$_field->addChild('value', $field['value']);

lib/Redmine/Api/Project.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,18 @@ public function update($id, array $params)
136136
*/
137137
protected function prepareParamsXml($params)
138138
{
139-
$array_params = array(
140-
'tracker_ids', 'issue_custom_field_ids',
141-
);
142-
$array_params_elements = array(
139+
$_params = array(
143140
'tracker_ids' => 'tracker',
144141
'issue_custom_field_ids' => 'issue_custom_field',
145142
);
146143

147144
$xml = new SimpleXMLElement('<?xml version="1.0"?><project></project>');
148145
foreach ($params as $k => $v) {
149-
if (in_array($k, $array_params) && is_array($v)) {
146+
if (isset($_params[$k]) && is_array($v)) {
150147
$array = $xml->addChild($k, '');
151148
$array->addAttribute('type', 'array');
152149
foreach ($v as $id) {
153-
$array->addChild($array_params_elements[$k], $id);
150+
$array->addChild($_params[$k], $id);
154151
}
155152
} else {
156153
$xml->addChild($k, $v);

lib/Redmine/Client.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,7 @@ public function getImpersonateUser()
321321
* @param string $path
322322
* @param string $method
323323
* @param string $data
324-
*
325324
* @return boolean|SimpleXMLElement|string
326-
*
327325
* @throws \Exception If anything goes wrong on curl request
328326
*/
329327
protected function runRequest($path, $method = 'GET', $data = '')
@@ -394,7 +392,6 @@ protected function runRequest($path, $method = 'GET', $data = '')
394392
default: // GET
395393
break;
396394
}
397-
/* @var $response boolean|string */
398395
$response = trim(curl_exec($curl));
399396
$this->responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
400397
$contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);

0 commit comments

Comments
 (0)