Skip to content

Commit 60f84f6

Browse files
committed
Code revised with reactor
Applied rules: * ForeachItemsAssignToEmptyArrayToAssignRector * SimplifyMirrorAssignRector
1 parent d702301 commit 60f84f6

17 files changed

Lines changed: 32 additions & 43 deletions

lib/api/xmlrpc/v1/xmlrpc.class.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9100,17 +9100,15 @@ public function updateBuildCustomFieldsValues($args)
91009100
$cfieldMgr->design_values_to_db($hash,
91019101
$args[self::$buildIDParamName], null, null, 'build');
91029102
// Add the result for each custom field to the returned array
9103-
array_push($ret,
9104-
array(
9105-
'status' => 'ok',
9106-
'msg' => 'Custom Field:' . $cfName . ' processed '
9107-
));
9103+
$ret[] = array(
9104+
'status' => 'ok',
9105+
'msg' => 'Custom Field:' . $cfName . ' processed '
9106+
);
91089107
} else {
9109-
array_push($ret,
9110-
array(
9111-
'status' => 'ko',
9112-
'msg' => 'Custom Field:' . $cfName . ' skipped '
9113-
));
9108+
$ret[] = array(
9109+
'status' => 'ko',
9110+
'msg' => 'Custom Field:' . $cfName . ' skipped '
9111+
);
91149112
}
91159113
}
91169114
// Return the result after all of the fields have been processed

lib/execute/execSetResults.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ function getBackupSteps(&$tcaseMgr, $guiObj, $testPlanId, $platformId, $buildId)
19031903
$stepsIds = array();
19041904
foreach ($guiObj->map_last_exec as $tcId => $elements) {
19051905
foreach ($guiObj->map_last_exec[$tcId]['steps'] as $step) {
1906-
array_push($stepsIds, $step["id"]);
1906+
$stepsIds[] = $step["id"];
19071907
}
19081908
}
19091909

lib/functions/code_testing/dBug.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function varIsBoolean($var)
220220
public function varIsArray($var)
221221
{
222222
$var_ser = serialize($var);
223-
array_push($this->arrHistory, $var_ser);
223+
$this->arrHistory[] = $var_ser;
224224

225225
$this->makeTableHeader("array", "array");
226226
if (is_array($var)) {
@@ -252,7 +252,7 @@ public function varIsArray($var)
252252
public function varIsObject($var)
253253
{
254254
$var_ser = serialize($var);
255-
array_push($this->arrHistory, $var_ser);
255+
$this->arrHistory[] = $var_ser;
256256
$this->makeTableHeader("object", "object");
257257

258258
if (is_object($var)) {

lib/functions/database.class.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,12 @@ public function exec_query($p_query, $p_limit = - 1, $p_offset = - 1)
234234
}
235235

236236
if ($this->logQueries) {
237-
array_push($this->queries_array,
238-
array(
239-
$p_query,
240-
$t_elapsed,
241-
$ec,
242-
$emsg
243-
));
237+
$this->queries_array[] = array(
238+
$p_query,
239+
$t_elapsed,
240+
$ec,
241+
$emsg
242+
);
244243
}
245244

246245
return $t_result;
@@ -473,7 +472,7 @@ private function count_unique_queries()
473472
foreach ($this->queries_array as $t_val_array) {
474473
if (! in_array($t_val_array[0], $t_shown_queries)) {
475474
$t_unique_queries ++;
476-
array_push($t_shown_queries, $t_val_array[0]);
475+
$t_shown_queries[] = $t_val_array[0];
477476
}
478477
}
479478
return $t_unique_queries;

lib/functions/plugin_api.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ function plugin_config_set($option, $value, $project = TL_ANY_PROJECT)
173173
$value = serialize($value);
174174
} elseif (is_float($value)) {
175175
$config_type = CONFIG_TYPE_FLOAT;
176-
$value = $value;
177176
} elseif (is_int($value) || is_numeric($value)) {
178177
$config_type = CONFIG_TYPE_INT;
179178
$value = $dbHandler->prepare_int($value);

lib/functions/requirement_spec_mgr.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ public function get_requirement_child_by_id($id)
765765
{
766766
$children = $this->get_requirement_child_by_id_req($id);
767767
foreach ($children as $child) {
768-
array_push($this->requirement_child_ids, $child);
768+
$this->requirement_child_ids[] = $child;
769769
$this->get_requirement_child_by_id($child["destination_id"]);
770770
}
771771
return $this->requirement_child_ids;

lib/issuetrackerintegration/githubrestInterface.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ private function completeCfg()
7777
if (property_exists($this->cfg, 'attributes')) {
7878
$attr = get_object_vars($this->cfg->attributes);
7979
foreach ($attr as $name => $elem) {
80-
$name = $name;
8180
if (is_object($elem)) {
8281
$elem = get_object_vars($elem);
8382
$cc = current($elem);

lib/issuetrackerintegration/gitlabrestInterface.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ private function completeCfg()
7777
if (property_exists($this->cfg, 'attributes')) {
7878
$attr = get_object_vars($this->cfg->attributes);
7979
foreach ($attr as $name => $elem) {
80-
$name = $name;
8180
if (is_object($elem)) {
8281
$elem = get_object_vars($elem);
8382
$cc = current($elem);

lib/issuetrackerintegration/jirarestInterface.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ private function processAttributes()
642642
{
643643
$attr = get_object_vars($this->cfg->attributes);
644644
foreach ($attr as $name => $elem) {
645-
$name = $name;
646645
switch ($name) {
647646
case 'customFieldValues':
648647
$this->getCustomFieldsAttribute($name, $elem);

lib/issuetrackerintegration/jirasoapInterface.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ private function processAttributes()
433433
{
434434
$attr = get_object_vars($this->cfg->attributes);
435435
foreach ($attr as $name => $elem) {
436-
$name = $name;
437436
switch ($name) {
438437
case 'customFieldValues':
439438
$this->getCustomFieldsAttribute($name, $elem);

0 commit comments

Comments
 (0)