Skip to content

Commit 7ba5ab3

Browse files
committed
Code revised with reactor
Applied rules: * TernaryConditionVariableAssignmentRector * SwitchNegatedTernaryRector
1 parent 1896814 commit 7ba5ab3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+115
-115
lines changed

lib/api/rest/v1/tlRestApi.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public function getProjectTestPlans($idCard)
362362

363363
if (! is_null($tproject)) {
364364
$items = $this->tprojectMgr->get_all_testplans($tproject[0]['id']);
365-
$op['items'] = (! empty($items)) ? $items : null;
365+
$op['items'] = (empty($items)) ? null : $items;
366366
} else {
367367
$op['message'] = "No Test Project identified by '" . $idCard . "'!";
368368
$op['status'] = 'error';

lib/api/rest/v2/tlRestApi.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ public function getProjectTestPlans($idCard)
479479

480480
if (! is_null($tproject)) {
481481
$items = $this->tprojectMgr->get_all_testplans($tproject['id']);
482-
$op['items'] = (! empty($items)) ? $items : null;
482+
$op['items'] = (empty($items)) ? null : $items;
483483
} else {
484484
$op['message'] = "No Test Project identified by '" . $idCard . "'!";
485485
$op['status'] = 'error';
@@ -1513,7 +1513,7 @@ public function getPlanBuilds($idCard)
15131513

15141514
if (! is_null($tplan)) {
15151515
$items = $this->tplanMgr->get_builds($tplan['id']);
1516-
$op['items'] = (! empty($items)) ? $items : null;
1516+
$op['items'] = (empty($items)) ? null : $items;
15171517
} else {
15181518
$op['message'] = "No Test Plan identified by '" . $idCard . "'!";
15191519
$op['status'] = 'error';

lib/api/rest/v3/RestApi.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ public function getProjectTestPlans(Response $response, $idCard)
440440

441441
if (! is_null($tproj)) {
442442
$items = $this->tprojectMgr->get_all_testplans($tproj['id']);
443-
$op['items'] = (! empty($items)) ? $items : null;
443+
$op['items'] = (empty($items)) ? null : $items;
444444
} else {
445445
$op['message'] = "No Test Project identified by '" . $idCard . "'!";
446446
$op['status'] = 'error';
@@ -466,7 +466,7 @@ public function getPlanBuilds(Response $response, $idCard)
466466

467467
if (! is_null($tplan)) {
468468
$items = $this->tplanMgr->get_builds($tplan['id']);
469-
$op['items'] = (! empty($items)) ? $items : null;
469+
$op['items'] = (empty($items)) ? null : $items;
470470
} else {
471471
$op['message'] = "No Test Plan identified by API KEY:" .
472472
$idCard['tplanApiKey'] . "";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ protected function userHasRight($rightToCheck,
587587
}
588588

589589
$tprojectid = intval($tprojectid);
590-
$tplanid = ! is_null($tplanid) ? intval($tplanid) : - 1;
590+
$tplanid = is_null($tplanid) ? - 1 : intval($tplanid);
591591

592592
if ($tprojectid <= 0 && $tplanid > 0) {
593593
// get test project from test plan
@@ -1571,7 +1571,7 @@ protected function _checkTCIDAndTPIDValid($platformInfo = null,
15711571
{
15721572
$tplan_id = $this->args[self::$testPlanIDParamName];
15731573
$tcase_id = $this->args[self::$testCaseIDParamName];
1574-
$platform_id = ! is_null($platformInfo) ? key($platformInfo) : null;
1574+
$platform_id = is_null($platformInfo) ? null : key($platformInfo);
15751575

15761576
$filters = array(
15771577
'exec_status' => "ALL",

lib/cfields/cfieldsExport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$gui->page_title = lang_get('export_cfields');
2525
$gui->do_it = 1;
2626
$gui->nothing_todo_msg = '';
27-
$gui->goback_url = ! is_null($args->goback_url) ? $args->goback_url : '';
27+
$gui->goback_url = is_null($args->goback_url) ? '' : $args->goback_url;
2828
$gui->export_filename = is_null($args->export_filename) ? 'customFields.xml' : $args->export_filename;
2929
$gui->exportTypes = array(
3030
'XML' => 'XML'

lib/cfields/cfieldsImport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
$gui = new stdClass();
2626
$gui->page_title = lang_get('import_cfields');
27-
$gui->goback_url = ! is_null($args->goback_url) ? $args->goback_url : '';
27+
$gui->goback_url = is_null($args->goback_url) ? '' : $args->goback_url;
2828
$gui->file_check = array(
2929
'show_results' => 0,
3030
'status_ok' => 1,

lib/execute/execDashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function initializeGui(&$dbHandler, &$argsObj, &$cfgObj, &$tplanMgr)
216216
));
217217

218218
$dummy = $platformMgr->getLinkedToTestplan($argsObj->tplan_id);
219-
$gui->has_platforms = ! is_null($dummy) ? 1 : 0;
219+
$gui->has_platforms = is_null($dummy) ? 0 : 1;
220220

221221
$gui->platform_info['id'] = 0;
222222
$gui->platform_info['name'] = '';

lib/execute/execExport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function initializeGui(&$argsObj, &$tplanMgr)
8383
);
8484
$guiObj->page_title = lang_get('export_execution_set');
8585
$guiObj->object_name = '';
86-
$guiObj->goback_url = ! is_null($argsObj->goback_url) ? $argsObj->goback_url : '';
86+
$guiObj->goback_url = is_null($argsObj->goback_url) ? '' : $argsObj->goback_url;
8787

8888
$key2loop = array(
8989
'tproject',

lib/execute/execHistory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
}
5353
$gui->execSet = $tcaseMgr->getExecutionSet($args->tcase_id, null, $filters);
5454

55-
$gui->warning_msg = (! is_null($gui->execSet)) ? '' : lang_get(
56-
'tcase_never_executed');
55+
$gui->warning_msg = (is_null($gui->execSet)) ? lang_get(
56+
'tcase_never_executed') : '';
5757
$gui->user_is_admin = ($args->user->globalRole->name == 'admin') ? true : false;
5858

5959
$gui->execPlatformSet = null;
@@ -75,7 +75,7 @@
7575
$gui->attachments = getAttachments($db, $gui->execSet);
7676
}
7777

78-
$gui->displayPlatformCol = ! is_null($gui->execPlatformSet) ? 1 : 0;
78+
$gui->displayPlatformCol = is_null($gui->execPlatformSet) ? 0 : 1;
7979
$gui->main_descr = lang_get('execution_history');
8080
$gui->detailed_descr = lang_get('test_case') . ' ' . $idCard;
8181
$gui->tcase_id = intval($args->tcase_id);

lib/execute/execPrint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$args = initArgs();
2525

2626
$gui = new stdClass();
27-
$gui->goback_url = ! is_null($args->goback_url) ? $args->goback_url : '';
27+
$gui->goback_url = is_null($args->goback_url) ? '' : $args->goback_url;
2828
$gui->page_title = '';
2929

3030
if ($args->deleteAttachmentID > 0) {

0 commit comments

Comments
 (0)