From 6b7c6e9be919f070d556755c12855463862aa517 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Sun, 27 Sep 2015 11:15:12 +0300 Subject: [PATCH] Make lines short to pass phpcs in files under includes/db/ Bug: T102614 Change-Id: I95ec0f9bdfc23e0d10d24534801fe5d6609ed0cb --- includes/db/DatabaseMysqlBase.php | 3 ++- includes/db/DatabaseSqlite.php | 12 +++++++++--- includes/db/loadbalancer/LoadBalancer.php | 4 +++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/includes/db/DatabaseMysqlBase.php b/includes/db/DatabaseMysqlBase.php index 160c35403c..5be96fa452 100644 --- a/includes/db/DatabaseMysqlBase.php +++ b/includes/db/DatabaseMysqlBase.php @@ -940,7 +940,8 @@ abstract class DatabaseMysqlBase extends DatabaseBase { $value = $this->mDefaultBigSelects; } } elseif ( $this->mDefaultBigSelects === null ) { - $this->mDefaultBigSelects = (bool)$this->selectField( false, '@@sql_big_selects', '', __METHOD__ ); + $this->mDefaultBigSelects = + (bool)$this->selectField( false, '@@sql_big_selects', '', __METHOD__ ); } $encValue = $value ? '1' : '0'; $this->query( "SET sql_big_selects=$encValue", __METHOD__ ); diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 0a7629ee8a..e9095970a7 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -799,15 +799,21 @@ class DatabaseSqlite extends DatabaseBase { return (int)$s; } elseif ( strpos( $s, "\0" ) !== false ) { // SQLite doesn't support \0 in strings, so use the hex representation as a workaround. - // This is a known limitation of SQLite's mprintf function which PDO should work around, - // but doesn't. I have reported this to php.net as bug #63419: + // This is a known limitation of SQLite's mprintf function which PDO + // should work around, but doesn't. I have reported this to php.net as bug #63419: // https://bugs.php.net/bug.php?id=63419 // There was already a similar report for SQLite3::escapeString, bug #62361: // https://bugs.php.net/bug.php?id=62361 // There is an additional bug regarding sorting this data after insert // on older versions of sqlite shipped with ubuntu 12.04 // https://phabricator.wikimedia.org/T74367 - wfDebugLog( __CLASS__, __FUNCTION__ . ': Quoting value containing null byte. For consistency all binary data should have been first processed with self::encodeBlob()' ); + wfDebugLog( + __CLASS__, + __FUNCTION__ . + ': Quoting value containing null byte. ' . + 'For consistency all binary data should have been ' . + 'first processed with self::encodeBlob()' + ); return "x'" . bin2hex( $s ) . "'"; } else { return $this->mConn->quote( $s ); diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index cdd3d4c09c..e794fa00ef 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -839,7 +839,9 @@ class LoadBalancer { "Connection error: {last_error} ({db_server})", $context ); - $conn->reportConnectionError( "{$this->mLastError} ({$context['db_server']})" ); // throws DBConnectionError + + // throws DBConnectionError + $conn->reportConnectionError( "{$this->mLastError} ({$context['db_server']})" ); } return false; /* not reached */ -- 2.20.1