Skip to content

Commit f981d63

Browse files
committed
Applied rules:
* ExplicitBoolCompareRector * TernaryToBooleanOrFalseToBooleanAndRector
1 parent ee78381 commit f981d63

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

+139
-139
lines changed

config.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2248,7 +2248,7 @@
22482248
/**
22492249
* Converted and derived variables (Users should not modify this section)
22502250
*/
2251-
define('REFRESH_SPEC_TREE', $tlCfg->spec_cfg->automatic_tree_refresh ? 1 : 0);
2251+
define('REFRESH_SPEC_TREE', $tlCfg->spec_cfg->automatic_tree_refresh !== 0 ? 1 : 0);
22522252
define('TL_SORT_TABLE_ENGINE', $g_sort_table_engine);
22532253
define("TL_REPOSITORY_MAXFILESIZE",
22542254
1024 * 1024 * $tlCfg->repository_max_filesize);

firstLogin.php

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

3434
$message = '';
3535
if (! is_null($args->doEditUser)) {
36-
if (strcmp($args->password, $args->password2)) {
36+
if (strcmp($args->password, $args->password2) !== 0) {
3737
$message = lang_get('passwd_dont_match');
3838
} else {
3939
$user = new tlUser();

install/installNewDB.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@
474474
}
475475
}
476476

477-
if ($update_pwd) {
477+
if ($update_pwd !== 0) {
478478
echo "Password Conversion ...";
479479
// @author Francisco Mancardi - 20050918
480480
// Found error upgrading from 1.0.4 to 1.6 on RH

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ public function updateBuild($id)
16921692
$oio = intval($build['is_open']);
16931693
$nio = intval($item->is_open);
16941694
if ($oio != $nio) {
1695-
if ($nio) {
1695+
if ($nio !== 0) {
16961696
$this->buildMgr->setOpen($id);
16971697
} else {
16981698
$this->buildMgr->setClosed($id);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ public function updateBuild(Request $request, Response $response, $args)
836836
$oio = intval($build['is_open']);
837837
$nio = intval($item->is_open);
838838
if ($oio != $nio) {
839-
if ($nio) {
839+
if ($nio !== 0) {
840840
$this->buildMgr->setOpen($id);
841841
} else {
842842
$this->buildMgr->setClosed($id);

lib/api/xmlrpc/v1/sample_clients/php/clientTestSuiteTestCaseStepsManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
for ($idx = 1; $idx < $qtySteps; $idx ++) {
3232
$action = 'FULL STOP NOW!!!! - intensity=';
3333
$expected_results = '%s Red Lights ON';
34-
if ($idx & 1) {
34+
if (($idx & 1) !== 0) {
3535
$action = 'Start Server with power=';
3636
$expected_results = 'GREEN Lantern %s ON';
3737
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ public function getLastExecutionResult($args)
18821882
$targetID;
18831883
$resultInfo[0] = $this->dbObj->fetchFirstRow($sql);
18841884

1885-
if ($options->getBugs) {
1885+
if ($options->getBugs !== 0) {
18861886
$resultInfo[0]['bugs'] = array();
18871887
$sql = " SELECT DISTINCT bug_id FROM {$this->tables['execution_bugs']} " .
18881888
" WHERE execution_id = " . $targetID;
@@ -2029,7 +2029,7 @@ public function getAllExecutionsResults($args)
20292029
$sql = "SELECT * FROM {$this->tables['executions']} WHERE id=" .
20302030
$tcExecId;
20312031
$resultInfo[$tcExecId] = $this->dbObj->fetchFirstRow($sql);
2032-
if ($options->getBugs) {
2032+
if ($options->getBugs !== 0) {
20332033
$resultInfo[$tcExecId]['bugs'] = array();
20342034
$sql = " SELECT DISTINCT bug_id FROM
20352035
{$this->tables['execution_bugs']}
@@ -5480,15 +5480,15 @@ protected function checkPlatformIdentity($tplanID, $platformInfo = null,
54805480
$messagePrefix);
54815481
$status = $name_exists | $id_exists;
54825482

5483-
if (! $status) {
5483+
if ($status === 0) {
54845484
$pname = self::$platformNameParamName . ' OR ' .
54855485
self::$platformIDParamName;
54865486
$msg = $messagePrefix .
54875487
sprintf(MISSING_REQUIRED_PARAMETER_STR, $pname);
54885488
$this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg);
54895489
}
54905490

5491-
if ($status) {
5491+
if ($status !== 0) {
54925492
// get test plan name is useful for error messages
54935493
$tplanInfo = $this->tplanMgr->get_by_id($tplanID);
54945494
if (is_null($platformInfo)) {
@@ -9663,7 +9663,7 @@ public function getExecutionSet($args)
96639663
$sql .= ")";
96649664

96659665
$sql .= " ORDER BY id ";
9666-
$sql .= ($opt->getOrderDescending) ? " DESC" : " ASC";
9666+
$sql .= ($opt->getOrderDescending !== 0) ? " DESC" : " ASC";
96679667

96689668
$rs = $this->dbObj->fetchRowsIntoMap($sql, 'id');
96699669
if (is_null($rs)) {

lib/cfields/cfieldsEdit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
break;
6464
}
6565

66-
if ($do_control_combo_display) {
66+
if ($do_control_combo_display !== 0) {
6767
$keys2loop = $cfield_mgr->get_application_areas();
6868
foreach ($keys2loop as $ui_mode) {
6969
$cfieldCfg->cf_enable_on[$ui_mode]['value'] = 0;

lib/events/eventviewer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function getFilters(&$argsObj = null, $dateFormat = null)
237237

238238
if (! is_null($argsObj->testers)) {
239239
$filters->users = implode(",", $argsObj->testers);
240-
if (! $filters->users) {
240+
if ($filters->users === '' || $filters->users === '0') {
241241
$filters->users = null;
242242
}
243243
}

lib/execute/execSetResults.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
$attachmentInfos = null;
7171

7272
$do_show_instructions = ($args->level == "" || $args->level == 'testproject') ? 1 : 0;
73-
if ($do_show_instructions) {
73+
if ($do_show_instructions !== 0) {
7474
show_instructions('executeTest');
7575
exit();
7676
}
@@ -628,7 +628,7 @@ function initArgs(&$dbHandler, $cfgObj)
628628
$args->doMoveNext = isset($_REQUEST['move2next']) ? 1 : 0;
629629

630630
$args->doMovePrevious = isset($_REQUEST['move2previous']) ? $_REQUEST['move2previous'] : 0;
631-
$args->moveTowards = $args->doMoveNext ? 'forward' : ($args->doMovePrevious ? 'backward' : null);
631+
$args->moveTowards = $args->doMoveNext !== 0 ? 'forward' : ($args->doMovePrevious ? 'backward' : null);
632632

633633
// can be a list, will arrive via form POST
634634
$args->tc_versions = isset($_REQUEST['tc_version']) ? $_REQUEST['tc_version'] : null;
@@ -762,7 +762,7 @@ function initArgs(&$dbHandler, $cfgObj)
762762
$args->ctsCfg = null;
763763
$cts = null;
764764

765-
if ($args->codeTrackerEnabled = intval($info['code_tracker_enabled'])) {
765+
if (($args->codeTrackerEnabled = intval($info['code_tracker_enabled'])) !== 0) {
766766
$ct_mgr = new tlCodeTracker($dbHandler);
767767
$args->ctsCfg = $ct_mgr->getLinkedTo($args->tproject_id);
768768
$cts = $ct_mgr->getInterfaceObject($args->tproject_id);
@@ -1240,7 +1240,7 @@ function setTesterAssignment(&$db, $exec_info, &$tcaseMgr, $tplan_id,
12401240
if (! is_null($p3)) {
12411241
foreach ($p3[$version_id][$platform_id] as $uu) {
12421242
$assignedTesterId = intval($uu['user_id']);
1243-
if ($assignedTesterId) {
1243+
if ($assignedTesterId !== 0) {
12441244
$user = tlUser::getByID($db, $assignedTesterId);
12451245
if ($user) {
12461246
$exec_info[$version_id]['assigned_user'][] = $user->getDisplayName();

0 commit comments

Comments
 (0)