Skip to content

Commit 0dcd146

Browse files
committed
Cleaned up code - some adjustments to selected files
The following adjustments were made: - Mergeable "if" statements should be combined (PHP:S1066) - Lines should not end with trailing whitespaces (PHP:S1131) - Identical expressions should not be used on both sides of a binary operator (PHP:S1764) - The "var" keyword should not be used (PHP:S1765) - PHP keywords and constants "true", "false", "null" should be lower case (PHP:S1781) - Method visibility should be explicitly declared (PHP:S1784) - "elseif" keyword should be used in place of "else if" keywords (PHP:S1793) - Unused assignments should be removed (PHP:S1854)
1 parent 95aa894 commit 0dcd146

2 files changed

Lines changed: 489 additions & 514 deletions

File tree

lib/functions/testproject.class.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class testproject extends tlObjectWithAttachments {
3333

3434
// Node Types (NT)
3535
private $nt2exclude=array('testplan' => 'exclude_me','requirement_spec'=> 'exclude_me','requirement'=> 'exclude_me');
36-
3736
private $nt2exclude_children=array('testcase' => 'exclude_my_children','requirement_spec'=> 'exclude_my_children');
3837

3938
private $debugMsg;
@@ -332,7 +331,7 @@ protected function getTestProject($condition = null, $opt=null)
332331
switch($my['options']['output']) {
333332
case 'existsByID':
334333
$doParse = false;
335-
$sql = "/* debugMsg */ SELECT testprojects.id ".
334+
$sql = "/* $debugMsg */ SELECT testprojects.id ".
336335
" FROM {$this->object_table} testprojects " .
337336
" WHERE 1=1 ";
338337
break;
@@ -350,14 +349,12 @@ protected function getTestProject($condition = null, $opt=null)
350349
case 'name':
351350
$doParse = false;
352351
$tprojCols = 'testprojects.id';
353-
break;
354-
355352
case 'full':
356353
default:
357354
$sql = "/* $debugMsg */ SELECT {$tprojCols}, nodes_hierarchy.name ".
358355
" FROM {$this->object_table} testprojects, " .
359356
" {$this->tables['nodes_hierarchy']} nodes_hierarchy".
360-
" WHERE testprojects.id = nodes_hierarchy.id ";
357+
" WHERE testprojects.id = nodes_hierarchy.id " .
361358
" AND nodes_hierarchy.node_type_id = " .
362359
$this->tree_manager->node_descr_id['testproject'];
363360
break;
@@ -985,7 +982,7 @@ private function checkTestCasePrefixExistence($prefix,$id=0)
985982
{
986983
$check_op = array('msg' => '', 'status_ok' => 1);
987984
$sql = " SELECT id FROM {$this->object_table} " .
988-
" WHERE prefix='" . $this->db->prepare_string($prefix) . "'";
985+
" WHERE prefix='" . $this->db->prepare_string($prefix) . "'" .
989986
" AND id <> {$id}";
990987

991988
$rs = $this->db->get_recordset($sql);
@@ -3876,7 +3873,7 @@ public function getActiveTestPlansCount($id)
38763873
/**
38773874
*
38783875
*/
3879-
private static function getAPIKey(&$dbh,$id) {
3876+
public static function getAPIKey(&$dbh,$id) {
38803877
$sch = tlDBObject::getDBTables('testprojects');
38813878
$sql = "SELECT api_key FROM {$sch['testprojects']} WHERE id=" . intval($id);
38823879
$rs = $dbh->get_recordset($sql);

0 commit comments

Comments
 (0)