PleaseStand has uploaded a new change for review. https://gerrit.wikimedia.org/r/241286
Change subject: Database: Remove resultObject() from the public interface ...................................................................... Database: Remove resultObject() from the public interface It has not been necessary to call this method outside the Database classes since 1.11. This is a breaking change and should not be merged before the following changes to extensions: * Disambiguator: Ibef942fd * Maps: Ic90bd0ad * OAI: Idbbe08d6 * Oversight: I63071e65 * Video: Id71914cd Change-Id: Idfe7cd6f516f0aca850878282c47e7914accc6d8 --- M RELEASE-NOTES-1.26 M includes/db/DBConnRef.php M includes/db/Database.php M includes/db/DatabaseMssql.php M includes/db/IDatabase.php 5 files changed, 8 insertions(+), 27 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/86/241286/1 diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26 index aab1b42..7f738e1 100644 --- a/RELEASE-NOTES-1.26 +++ b/RELEASE-NOTES-1.26 @@ -220,6 +220,8 @@ 'Project:Oversight' to 'Project:Suppress'. * (T84937) Free external links ("autolinked" urls) will now be terminated by and HTML entity encodings of  , <, and >. +* DatabaseBase::resultObject() is now protected (use outside Database classes + not necessary since 1.11). == Compatibility == diff --git a/includes/db/DBConnRef.php b/includes/db/DBConnRef.php index b4f3f79..ffada49 100644 --- a/includes/db/DBConnRef.php +++ b/includes/db/DBConnRef.php @@ -449,10 +449,6 @@ return $this->__call( __FUNCTION__, func_get_args() ); } - public function resultObject( $result ) { - return $this->__call( __FUNCTION__, func_get_args() ); - } - public function ping() { return $this->__call( __FUNCTION__, func_get_args() ); } diff --git a/includes/db/Database.php b/includes/db/Database.php index 1e54f55..dbe86dc 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -3766,14 +3766,13 @@ * Once upon a time, DatabaseBase::query() returned a bare MySQL result * resource, and it was necessary to call this function to convert it to * a wrapper. Nowadays, raw database objects are never exposed to external - * callers, so this is unnecessary in external code. For compatibility with - * old code, ResultWrapper objects are passed through unaltered. + * callers, so this is unnecessary in external code. * - * @param bool|ResultWrapper|resource $result + * @param bool|ResultWrapper|resource|object $result * @return bool|ResultWrapper */ - public function resultObject( $result ) { - if ( empty( $result ) ) { + protected function resultObject( $result ) { + if ( !$result ) { return false; } elseif ( $result instanceof ResultWrapper ) { return $result; diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 85f1b96..354afc5 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -145,8 +145,8 @@ * @param bool|MssqlResultWrapper|resource $result * @return bool|MssqlResultWrapper */ - public function resultObject( $result ) { - if ( empty( $result ) ) { + protected function resultObject( $result ) { + if ( !$result ) { return false; } elseif ( $result instanceof MssqlResultWrapper ) { return $result; diff --git a/includes/db/IDatabase.php b/includes/db/IDatabase.php index 49d0514..95608c6 100644 --- a/includes/db/IDatabase.php +++ b/includes/db/IDatabase.php @@ -1348,22 +1348,6 @@ public function timestampOrNull( $ts = null ); /** - * Take the result from a query, and wrap it in a ResultWrapper if - * necessary. Boolean values are passed through as is, to indicate success - * of write queries or failure. - * - * Once upon a time, DatabaseBase::query() returned a bare MySQL result - * resource, and it was necessary to call this function to convert it to - * a wrapper. Nowadays, raw database objects are never exposed to external - * callers, so this is unnecessary in external code. For compatibility with - * old code, ResultWrapper objects are passed through unaltered. - * - * @param bool|ResultWrapper|resource $result - * @return bool|ResultWrapper - */ - public function resultObject( $result ); - - /** * Ping the server and try to reconnect if it there is no connection * * @return bool Success or failure -- To view, visit https://gerrit.wikimedia.org/r/241286 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idfe7cd6f516f0aca850878282c47e7914accc6d8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand <pleasest...@live.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits