@@ -591,7 +591,7 @@ protected function userHasRight($rightToCheck,
591591 }
592592
593593 $ tprojectid = intval ($ tprojectid );
594- $ tplanid = ! is_null ($ tplanid ) ? intval ($ tplanid ) : - 1 ;
594+ $ tplanid = is_null ($ tplanid ) ? - 1 : intval ($ tplanid );
595595
596596 if ($ tprojectid <= 0 && $ tplanid > 0 ) {
597597 // get test project from test plan
@@ -1577,7 +1577,7 @@ protected function _checkTCIDAndTPIDValid($platformInfo = null,
15771577 {
15781578 $ tplan_id = $ this ->args [self ::$ testPlanIDParamName ];
15791579 $ tcase_id = $ this ->args [self ::$ testCaseIDParamName ];
1580- $ platform_id = ! is_null ($ platformInfo ) ? key ($ platformInfo ) : null ;
1580+ $ platform_id = is_null ($ platformInfo ) ? null : key ($ platformInfo );
15811581
15821582 $ filters = [
15831583 'exec_status ' => "ALL " ,
@@ -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 ' ] = [];
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 ' ] = [];
20342034 $ sql = " SELECT DISTINCT bug_id FROM
20352035 {$ this ->tables ['execution_bugs ' ]}
@@ -4052,8 +4052,9 @@ public function addTestCaseToTestPlan($args)
40524052 // Other version than requested done is already linked
40534053 $ doLink = false ;
40544054 if ($ this ->_isParamPresent (self ::$ overwriteParamName ) &&
4055- $ this ->args [self ::$ overwriteParamName ]) {
4056- $ doLink = $ doDeleteLinks = true ;
4055+ $ this ->args [self ::$ overwriteParamName ]) {
4056+ $ doLink = true ;
4057+ $ doDeleteLinks = true ;
40574058 }
40584059
40594060 reset ($ rs );
@@ -5480,15 +5481,15 @@ protected function checkPlatformIdentity($tplanID, $platformInfo = null,
54805481 $ messagePrefix );
54815482 $ status = $ name_exists | $ id_exists ;
54825483
5483- if (! $ status ) {
5484+ if ($ status === 0 ) {
54845485 $ pname = self ::$ platformNameParamName . ' OR ' .
54855486 self ::$ platformIDParamName ;
54865487 $ msg = $ messagePrefix .
54875488 sprintf (MISSING_REQUIRED_PARAMETER_STR , $ pname );
54885489 $ this ->errors [] = new IXR_Error (MISSING_REQUIRED_PARAMETER , $ msg );
54895490 }
54905491
5491- if ($ status ) {
5492+ if ($ status !== 0 ) {
54925493 // get test plan name is useful for error messages
54935494 $ tplanInfo = $ this ->tplanMgr ->get_by_id ($ tplanID );
54945495 if (is_null ($ platformInfo )) {
@@ -9099,17 +9100,15 @@ public function updateBuildCustomFieldsValues($args)
90999100 $ cfieldMgr ->design_values_to_db ($ hash ,
91009101 $ args [self ::$ buildIDParamName ], null , null , 'build ' );
91019102 // Add the result for each custom field to the returned array
9102- array_push ($ ret ,
9103- [
9104- 'status ' => 'ok ' ,
9105- 'msg ' => 'Custom Field: ' . $ cfName . ' processed '
9106- ]);
9103+ $ ret [] = [
9104+ 'status ' => 'ok ' ,
9105+ 'msg ' => 'Custom Field: ' . $ cfName . ' processed '
9106+ ];
91079107 } else {
9108- array_push ($ ret ,
9109- [
9110- 'status ' => 'ko ' ,
9111- 'msg ' => 'Custom Field: ' . $ cfName . ' skipped '
9112- ]);
9108+ $ ret [] = [
9109+ 'status ' => 'ko ' ,
9110+ 'msg ' => 'Custom Field: ' . $ cfName . ' skipped '
9111+ ];
91139112 }
91149113 }
91159114 // Return the result after all of the fields have been processed
@@ -9663,7 +9662,7 @@ public function getExecutionSet($args)
96639662 $ sql .= ") " ;
96649663
96659664 $ sql .= " ORDER BY id " ;
9666- $ sql .= ($ opt ->getOrderDescending ) ? " DESC " : " ASC " ;
9665+ $ sql .= ($ opt ->getOrderDescending !== 0 ) ? " DESC " : " ASC " ;
96679666
96689667 $ rs = $ this ->dbObj ->fetchRowsIntoMap ($ sql , 'id ' );
96699668 if (is_null ($ rs )) {
0 commit comments