Fix CodeSniffer and warnings in includes/db
authorSiebrand Mazeland <siebrand@kitano.nl>
Wed, 12 Mar 2014 17:25:15 +0000 (18:25 +0100)
committerSiebrand <siebrand@kitano.nl>
Wed, 12 Mar 2014 18:29:16 +0000 (18:29 +0000)
Follow-up with a slightly wider scope to e611604d10897f.

Change-Id: I9bb5ef0ceef0cd7a9c044e675b953db6d3b35407

includes/db/Database.php
includes/db/DatabaseMssql.php
includes/db/DatabaseOracle.php

index 967d7a1..91ab0ca 100644 (file)
@@ -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 {
index 163554b..e304a34 100644 (file)
@@ -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] ) ) );
                }
 
index cad7caf..998dd75 100644 (file)
@@ -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'] . '\')' );
                                }
                        }
                }