Skip to content

Commit a2d7031

Browse files
committed
Cleaned up code - some files refactored
1 parent 50dcf63 commit a2d7031

File tree

11 files changed

+30
-32
lines changed

11 files changed

+30
-32
lines changed

lib/codetrackerintegration/codeTrackerInterface.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ abstract class codeTrackerInterface
3333

3434
// members to store the codetracking information.
3535
// Values are set in the actual subclasses
36-
private $cfg = null;
36+
public $cfg = null;
3737

3838
// simpleXML object
39-
private $name = null;
39+
public $name = null;
4040

4141
private $tlCharSet = null;
4242

@@ -46,12 +46,12 @@ abstract class codeTrackerInterface
4646
// usable only if interface is done via direct DB access.
4747
private $dbMsg = '';
4848

49-
private $connected = false;
49+
public $connected = false;
5050

51-
private $interfaceViaDB = false;
51+
public $interfaceViaDB = false;
5252

5353
// useful for connect/disconnect methods
54-
private $guiCfg = array();
54+
public $guiCfg = array();
5555

5656
/**
5757
* Construct and connect to CTS.

lib/codetrackers/codeTrackerEdit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ function initializeGui(&$dbHandler, &$argsObj, &$commandMgr)
196196

197197
/**
198198
*
199-
* @param $db resource
199+
* @param database $db
200200
* the database connection handle
201-
* @param $user the
202-
* current active user
201+
* @param tlUser $user
202+
* the current active user
203203
*
204204
* @return boolean returns true if the page can be accessed
205205
*/

lib/execute/execSetResults.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ function initializeGui(&$dbHandler, &$argsObj, &$cfgObj, &$tplanMgr, &$tcaseMgr,
16641664
$gui->issueTrackerCfg->editIssueAttr = (intval(
16651665
$itsCfg->userinteraction) > 0);
16661666
$gui->issueTrackerCfg->crudIssueViaAPI = (intval(
1667-
$itsCfg->createissueviaapi) > 0);
1667+
$itsCfg->createissueviaapi) > 0) ?? false;
16681668

16691669
$gui->issueTrackerIntegrationOn = true;
16701670
$gui->accessToIssueTracker = lang_get('link_bts_create_bug') .

lib/functions/logger.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function setLogLevelFilterFromVerbose($verboseForLogger)
228228
/**
229229
* disable logging
230230
*
231-
* @param TBD $logger
231+
* @param string $logger
232232
* (optional) default null = all loggers
233233
* string representing a list of keys to access loggers map.
234234
*
@@ -248,7 +248,7 @@ public function disableLogging($logger = null)
248248
/**
249249
* enable logging
250250
*
251-
* @param TBD $logger
251+
* @param string $logger
252252
* (optional) default null = all loggers
253253
* string representing a list of keys to access loggers map.
254254
*

lib/functions/requirement_mgr.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,9 +1015,9 @@ public function create_tc_from_requirement($mixIdReq, $srs_id, $user_id,
10151015
// Warning:
10161016
// We are not maintaining hierarchy !!!
10171017
$sql = " SELECT id FROM {$this->tables['nodes_hierarchy']} NH " .
1018-
" WHERE name='" .
1019-
$this->db->prepare_string($auto_testsuite_name) . "' " .
1020-
" AND parent_id=" . $tproject_id . " " . " AND node_type_id=" .
1018+
" WHERE name='" . $this->db->prepare_string(
1019+
$auto_testsuite_name) . "' " . " AND parent_id=" .
1020+
$tproject_id . " " . " AND node_type_id=" .
10211021
$node_descr_type['testsuite'];
10221022

10231023
$result = $this->db->exec_query($sql);
@@ -4044,7 +4044,7 @@ private function updateScope($reqVersionID)
40444044
/**
40454045
* render Image Attachments INLINE
40464046
*/
4047-
private function renderImageAttachments($id, &$item2render, $basehref = null)
4047+
public function renderImageAttachments($id, &$item2render, $basehref = null)
40484048
{
40494049
static $attSet;
40504050

lib/functions/string_api.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
* Preserve spaces at beginning of lines.
1818
* Lines must be separated by \n rather than < br / >
1919
*/
20-
use const Collator\OFF;
21-
use const Collator\ON;
20+
use function database\db_unixtimestamp;
21+
22+
require_once 'common.php';
2223

2324
function string_preserve_spaces_at_bol($p_string)
2425
{
@@ -79,8 +80,8 @@ function string_nl2br($p_string, $p_wrap = 100)
7980
$pre2[$x] = preg_replace("/<br[^>]*?>/", "", $pre1[0][$x]);
8081
// this may want to be replaced by html_entity_decode (or equivalent)
8182
// if other encoded characters are a problem
82-
$pre2[$x] = preg_replace("/&nbsp;/", " ", $pre2[$x]);
83-
if (ON == config_get('wrap_in_preformatted_text')) {
83+
$pre2[$x] = str_replace("/&nbsp;/", " ", $pre2[$x]);
84+
if (tl::ON == config_get('wrap_in_preformatted_text')) {
8485
$pre2[$x] = preg_replace("/([^\n]{" . $p_wrap . "})(?!<\/pre>)/",
8586
"$1\n", $pre2[$x]);
8687
}
@@ -354,7 +355,7 @@ function string_restore_valid_html_tags($p_string, $p_multiline = true)
354355
$t_html_valid_tags = config_get(
355356
$p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line');
356357

357-
if (OFF === $t_html_valid_tags || isBlank($t_html_valid_tags)) {
358+
if (0 === $t_html_valid_tags || isBlank($t_html_valid_tags)) {
358359
return $p_string;
359360
}
360361

lib/functions/testcase.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9141,7 +9141,7 @@ public function getLatestVersionID($tcaseID)
91419141
*
91429142
* <p> </p> added by web rich editor create some layout issues
91439143
*/
9144-
private function renderBuildExecVars($context, &$item2render)
9144+
public function renderBuildExecVars($context, &$item2render)
91459145
{
91469146
static $execVars;
91479147

lib/functions/testsuite.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ private function getDeleteAttachmentRelativeURL($id)
17151715
* <img alt="" src="http://localhost/development/tl/testlink-ga-testlink-code/lib/attachments/attachmentdownload.php?id=1"
17161716
* style="width: 1223px; height: 666px;" />
17171717
*/
1718-
private function renderImageAttachments($id, &$item2render, $basehref = null)
1718+
public function renderImageAttachments($id, &$item2render, $basehref = null)
17191719
{
17201720
static $attSet;
17211721
if (! $attSet || ! isset($attSet[$id])) {

lib/issuetrackerintegration/issueTrackerInterface.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ abstract class issueTrackerInterface
4242

4343
// private vars don't touch
4444
// usable only if interface is done via direct DB access.
45-
private $dbConnection = null;
45+
public $dbConnection = null;
4646

4747
private $dbMsg = '';
4848

4949
// useful for connect/disconnect methods
50-
private $interfaceViaDB = false;
50+
public $interfaceViaDB = false;
5151

52-
private $connected = false;
52+
public $connected = false;
5353

54-
private $resolvedStatus;
54+
public $resolvedStatus;
5555

56-
private $methodOpt = array(
56+
public $methodOpt = array(
5757
'buildViewBugLink' => array(
5858
'addSummary' => false,
5959
'colorByStatus' => false,

lib/results/charts.inc.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
require_once '../../config.inc.php';
1313
require_once __DIR__ . '/../../vendor/autoload.php';
1414

15-
use pChart\pChart;
16-
use pChart\pData;
17-
1815
/**
1916
*
2017
* @param stdClass $info

0 commit comments

Comments
 (0)