Add some PHPDoc, fix some syntax (thanks to SonarLint !)

SVN:trunk[5188]
This commit is contained in:
Pierre Goiffon
2018-01-02 14:20:02 +00:00
parent b2494ebaf7
commit 067b3364ee
4 changed files with 58 additions and 18 deletions

View File

@@ -294,7 +294,10 @@ abstract class DBSearch
*/
static public function FromOQL($sQuery, $aParams = null)
{
if (empty($sQuery)) return null;
if (empty($sQuery))
{
return null;
}
// Query caching
$sQueryId = md5($sQuery);
@@ -366,7 +369,10 @@ abstract class DBSearch
{
$sSQL = $this->MakeSelectQuery($aOrderBy, $aArgs);
$resQuery = CMDBSource::Query($sSQL);
if (!$resQuery) return;
if (!$resQuery)
{
return;
}
if (count($aColumns) == 0)
{
@@ -682,7 +688,10 @@ abstract class DBSearch
public static function RecordQueryTrace()
{
if (!self::$m_bTraceQueries) return;
if (!self::$m_bTraceQueries)
{
return;
}
$iOqlCount = count(self::$m_aQueriesLog);
$iSqlCount = 0;
@@ -720,6 +729,7 @@ abstract class DBSearch
{
// Merge the new queries into the existing log
include($sAllQueries);
$aQueriesLog = array();
foreach (self::$m_aQueriesLog as $sQueryId => $aOqlData)
{
if (!array_key_exists($sQueryId, $aQueriesLog))
@@ -738,7 +748,10 @@ abstract class DBSearch
protected static function DbgTrace($value)
{
if (!self::$m_bDebugQuery) return;
if (!self::$m_bDebugQuery)
{
return;
}
$aBacktrace = debug_backtrace();
$iCallStackPos = count($aBacktrace) - self::$m_bDebugQuery;
$sIndent = "";
@@ -754,11 +767,7 @@ abstract class DBSearch
$sCallers = "Callstack: ".implode(', ', $aCallers);
$sFunction = "<b title=\"$sCallers\">".$aBacktrace[1]["function"]."</b>";
if (is_string($value))
{
echo "$sIndent$sFunction: $value<br/>\n";
}
else if (is_object($value))
if (is_object($value))
{
echo "$sIndent$sFunction:\n<pre>\n";
print_r($value);
@@ -814,7 +823,10 @@ abstract class DBSearch
$aUpdates = array();
foreach (MetaModel::EnumParentClasses($sFinalClass, ENUM_PARENT_CLASSES_ALL) as $sParentClass)
{
if (!MetaModel::IsValidAttCode($sParentClass, 'archive_flag')) continue;
if (!MetaModel::IsValidAttCode($sParentClass, 'archive_flag'))
{
continue;
}
$sTable = MetaModel::DBGetTable($sParentClass);
$aUpdates[] = "`$sTable`.`archive_flag` = $iFlag";