Skip to content

Commit ceaf6a2

Browse files
committed
Cleaned up code - some adjustments to selected files
The following adjustments were made: - Files should end with a newline (PHP:S113) - Mergeable "if" statements should be combined (PHP:S1066) - Modifiers should be declared in the correct order (PHP:S1124) - Boolean literals should not be redundant (PHP:S1125) - Lines should not end with trailing whitespaces (PHP:S1131) - Use empty() to check whether the array is empty or not (PHP:S1155) - Unused local variables should be removed (PHP:S1481) - All code should be reachable (PHP:S1763) - 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) - "&&" and "||" should be used (PHP:S2010) - Array values should not be replaced unconditionally (PHP:S4143)
1 parent fb457d0 commit ceaf6a2

14 files changed

Lines changed: 1780 additions & 2000 deletions

gui/templates/tl-classic/results/resultsBugs.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Purpose: smarty template - show Test Results and Metrics
88
title_test_case_bugs, info_bugs_per_tc_report,
99
generated_by_TestLink_on,bugs_resolved,bugs_total,tcs_with_bugs'}
1010

11-
{include file="inc_head.tpl"}
11+
{include file="inc_head.tpl" openHead="yes"}
1212
{foreach from=$gui->tableSet key=idx item=matrix name="initializer"}
13-
{$tableID="$matrix->tableID"}
13+
{assign var=tableID value=$matrix->tableID}
1414
{if $smarty.foreach.initializer.first}
1515
{$matrix->renderCommonGlobals()}
1616
{if $matrix instanceof tlExtTable}
@@ -20,7 +20,7 @@ Purpose: smarty template - show Test Results and Metrics
2020
{/if}
2121
{$matrix->renderHeadSection()}
2222
{/foreach}
23-
23+
</head>
2424
<body>
2525

2626
{if $gui->printDate == ''}
@@ -78,4 +78,4 @@ Purpose: smarty template - show Test Results and Metrics
7878
</div>
7979

8080
</body>
81-
</html>
81+
</html>

lib/codetrackers/codeTrackerView.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @author uwe_kirst@mentor.com
99
* @internal revisions
10-
*
10+
*
1111
*
1212
**/
1313
require_once dirname(__FILE__) . '/../../config.inc.php';
@@ -26,7 +26,7 @@
2626

2727
if($args->id > 0)
2828
{
29-
$gui->items[$args->id]['connection_status'] = $codeTrackerMgr->checkConnection($args->id) ? 'ok' : 'ko';
29+
$gui->items[$args->id]['connection_status'] = $codeTrackerMgr->checkConnection($args->id) ? 'ok' : 'ko';
3030
}
3131

3232
$smarty = new TLSmarty();
@@ -47,7 +47,7 @@ function init_args()
4747
{
4848
$args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
4949
}
50-
$args->currentUser = $_SESSION['currentUser'];
50+
$args->currentUser = $_SESSION['currentUser'];
5151

5252
$args->user_feedback = array('type' => '', 'message' => '');
5353

lib/events/eventviewer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
$args->object_type ? $args->object_type : null,null,500,$filters->startTime,
6161
$filters->endTime,$filters->users);
6262

63-
if (count($gui->events) > 0)
63+
if (!empty($gui->events))
6464
{
6565
$table = buildExtTable($gui, $show_icon, $charset);
6666
if (!is_null($table))
@@ -248,7 +248,7 @@ function buildExtTable($gui,$show_icon,$charset)
248248

249249
$rowData[] = $event->getlogLevel();
250250

251-
if (isset($event->userID) && $event->userID != false && isset($gui->users[$event->userID])) {
251+
if (isset($event->userID) && $event->userID && isset($gui->users[$event->userID])) {
252252
$rowData[] = $gui->users[$event->userID];
253253
} else {
254254
$rowData[] = lang_get("not_aplicable");

lib/functions/cfield_mgr.class.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ public function get_possible_values_cfg()
383383

384384
/**
385385
*
386-
* @param unknown $context
387-
* @param unknown $filters
386+
* @param array $context
387+
* @param array $filters
388388
* @param string $access_key
389389
* @return array
390390
*/
@@ -954,7 +954,6 @@ function: get_all
954954
public function get_all($id2exclude=null,$opt=null)
955955
{
956956
static $lbl;
957-
// $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
958957

959958
if(!$lbl)
960959
{
@@ -1016,8 +1015,6 @@ function: get_linked_to_testproject
10161015
*/
10171016
public function get_linked_to_testproject($tproject_id,$active=null,$opt=null)
10181017
{
1019-
// $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
1020-
10211018
$options = array('name' => null);
10221019
$options = array_merge($options,(array)$opt);
10231020

@@ -2128,8 +2125,6 @@ public function getXMLRPCServerParams($nodeID,$tplanLinkID=null)
21282125
static $CFGKEY_IDX;
21292126

21302127
$debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
2131-
2132-
// $srv_cfg = new stdClass();
21332128

21342129
if( is_null($node_type) )
21352130
{
@@ -2348,7 +2343,6 @@ public function get_linked_cfields_at_testplan_design($tproject_id,$enabled,
23482343
{
23492344
$additional_join="";
23502345
$additional_values="";
2351-
// $additional_filter="";
23522346

23532347
$order_by_clause = " ORDER BY display_order,CF.id ";
23542348
$fetchMethod = 'fetchRowsIntoMap';
@@ -2632,8 +2626,6 @@ public function buildLocationMap($nodeType)
26322626
*/
26332627
public function getByLinkID($linkID, $options=null)
26342628
{
2635-
// $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
2636-
26372629
$my['options'] = array('scope' => 'design', 'output' => 'field_id');
26382630
$my['options'] = array_merge($my['options'], (array)$options);
26392631

@@ -2735,7 +2727,6 @@ public function html_table_inputs($cfields_map,$name_suffix='',$input_values=nul
27352727
$cf_smarty .= "<tr>";
27362728
if($my['opt']['addCheck'])
27372729
{
2738-
// $check_id = str_replace('id="', 'id="check_', $dummy[0]);
27392730
$check_name = str_replace('id="', 'name="check_', $dummy[0]);
27402731
$cf_smarty .= "<td> {$add_img}" .
27412732
"<input type=\"checkbox\" {$check_name}> </td>";

lib/functions/exttable.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function __construct($columns, $data, $tableID)
182182
* $table->addType('color', array('render' => 'colorRendererMethod'))
183183
*
184184
* @param string $type new type.
185-
* @param map $behaviour the custom things to enable for this type
185+
* @param array $behaviour the custom things to enable for this type
186186
**/
187187
public function addCustomBehaviour($type, $behaviour)
188188
{

0 commit comments

Comments
 (0)