Skip to content

Commit 2d8ea7a

Browse files
committed
Minor corrections to the last adjustments
1 parent 38d02b4 commit 2d8ea7a

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
/**
2424
* IXR is the class used for the XML-RPC server
2525
*/
26-
use const Collator\OFF;
27-
2826
define("TL_APICALL", 'XML-RPC');
2927

3028
require_once '../../../../config.inc.php';
@@ -50,8 +48,6 @@
5048
class TestlinkXMLRPCServer extends IXR_Server
5149
{
5250

53-
public $methods;
54-
5551
public static $version = "1.1";
5652

5753
const OFF = false;
@@ -577,8 +573,8 @@ protected function userHasRight($rightToCheck,
577573
$tprojectid = intval(
578574
isset($context[self::$testProjectIDParamName]) ? $context[self::$testProjectIDParamName] : 0);
579575

580-
if ($tprojectid == 0 && isset(
581-
$this->args[self::$testProjectIDParamName])) {
576+
if ($tprojectid == 0 &&
577+
isset($this->args[self::$testProjectIDParamName])) {
582578
$tprojectid = $this->args[self::$testProjectIDParamName];
583579
}
584580

@@ -606,8 +602,8 @@ protected function userHasRight($rightToCheck,
606602
// Try using TestSuiteID to get TestProjectID
607603
$tsuiteid = intval(
608604
isset($context[self::$testSuiteIDParamName]) ? $context[self::$testSuiteIDParamName] : 0);
609-
if ($tsuiteid == 0 && isset(
610-
$this->args[self::$testSuiteIDParamName])) {
605+
if ($tsuiteid == 0 &&
606+
isset($this->args[self::$testSuiteIDParamName])) {
611607
$tsuiteid = intval($this->args[self::$testSuiteIDParamName]);
612608
}
613609
if ($tsuiteid > 0) {
@@ -1541,7 +1537,12 @@ protected function _isDevKeyValid($devKey)
15411537
$this->devKey = $this->dbObj->prepare_string($devKey);
15421538
$query = "SELECT id FROM {$this->tables['users']} WHERE script_key='{$this->devKey}'";
15431539
$this->userID = $this->dbObj->fetchFirstRowSingleColumn($query, "id");
1544-
return null == $this->userID;
1540+
1541+
if (null == $this->userID) {
1542+
return false;
1543+
} else {
1544+
return true;
1545+
}
15451546
}
15461547

15471548
/**
@@ -4652,8 +4653,8 @@ public function getTestCaseAttachments($args)
46524653
return $this->errors;
46534654
}
46544655

4655-
if ($status_ok && ! $this->_isParamPresent(
4656-
self::$versionNumberParamName)) {
4656+
if ($status_ok &&
4657+
! $this->_isParamPresent(self::$versionNumberParamName)) {
46574658
try {
46584659
$tc = $this->getTestCase($args, self::THROW_ON_ERROR);
46594660
$this->args[self::$versionNumberParamName] = $tc[0][self::$versionNumberParamName];
@@ -7210,8 +7211,8 @@ public function setTestCaseExecutionType($args)
72107211
'checkTestCaseVersionNumber'
72117212
];
72127213
$status_ok = $this->_runChecks($checkFunctions, $msg_prefix);
7213-
if ($status_ok &&
7214-
! $this->_isParamPresent(self::$executionTypeParamName)) {
7214+
if ($status_ok && ! $this->_isParamPresent(
7215+
self::$executionTypeParamName)) {
72157216
$status_ok = false;
72167217
$msg = sprintf(MISSING_REQUIRED_PARAMETER_STR,
72177218
self::$customFieldsParamName);
@@ -8154,8 +8155,8 @@ public function getTestCaseBugs($args)
81548155
" WHERE parent_id = {$this->args[self::$testCaseIDParamName]})";
81558156

81568157
if (! is_null($execContext['build_id'])) {
8157-
$sql .= " AND build_id = " . intval(
8158-
$execContext['build_id']);
8158+
$sql .= " AND build_id = " .
8159+
intval($execContext['build_id']);
81598160
}
81608161

81618162
if (! is_null($execContext['platform_id'])) {

lib/api/xmlrpc/v1/xmlrpc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
*
1313
*
1414
*/
15-
require_once "xmlrpc.class.php";
15+
require_once 'xmlrpc.class.php';
1616
$XMLRPCServer = new TestlinkXMLRPCServer();

0 commit comments

Comments
 (0)