From db7de5f4c117a3312607b0a1a652b3ee6074af88 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Wed, 12 Mar 2014 18:25:15 +0100 Subject: [PATCH] Fix CodeSniffer and warnings in includes/db Follow-up with a slightly wider scope to e611604d10897f. Change-Id: I9bb5ef0ceef0cd7a9c044e675b953db6d3b35407 --- includes/db/Database.php | 17 +++++++++-------- includes/db/DatabaseMssql.php | 3 ++- includes/db/DatabaseOracle.php | 4 +++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/includes/db/Database.php b/includes/db/Database.php index 967d7a112d..91ab0ca4d0 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1945,12 +1945,12 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { return $opts; } - /** - * Make UPDATE options for the DatabaseBase::update function - * - * @param array $options The options passed to DatabaseBase::update - * @return string - */ + /** + * Make UPDATE options for the DatabaseBase::update function + * + * @param array $options The options passed to DatabaseBase::update + * @return string + */ protected function makeUpdateOptions( $options ) { $opts = $this->makeUpdateOptionsArray( $options ); @@ -2436,11 +2436,12 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { } $retJOIN[] = $tableClause; - // Is there an INDEX clause for this table? } elseif ( isset( $use_index[$alias] ) ) { + // Is there an INDEX clause for this table? $tableClause = $this->tableNameWithAlias( $table, $alias ); $tableClause .= ' ' . $this->useIndexClause( - implode( ',', (array)$use_index[$alias] ) ); + implode( ',', (array)$use_index[$alias] ) + ); $ret[] = $tableClause; } else { diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 163554b75e..e304a3489e 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -1418,7 +1418,8 @@ class MssqlBlob extends Blob { } $ret = '0x'; - for ( $i = 0; $i < strlen( $this->mData ); $i++ ) { + $dataLength = strlen( $this->mData ); + for ( $i = 0; $i < $dataLength; $i++ ) { $ret .= bin2hex( pack( 'C', ord( $this->mData[$i] ) ) ); } diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index cad7caf5aa..998dd75df5 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -794,7 +794,9 @@ class DatabaseOracle extends DatabaseBase { // add sequence column to each list of columns, when not set foreach ( $rows as &$row ) { if ( !isset( $row[$sequenceData['column']] ) ) { - $row[$sequenceData['column']] = $this->addIdentifierQuotes('GET_SEQUENCE_VALUE(\'' . $sequenceData['sequence'] . '\')'); + $row[$sequenceData['column']] = + $this->addIdentifierQuotes( 'GET_SEQUENCE_VALUE(\'' . + $sequenceData['sequence'] . '\')' ); } } } -- 2.20.1