From 721e4ba5206b788d5fd0418f888c3ebabe13daf9 Mon Sep 17 00:00:00 2001 From: Reedy Date: Thu, 4 Oct 2012 01:08:10 +0100 Subject: [PATCH] Minor parameter documentation improvements on External Store classes Changed the comment about returning ExternalStore subclasses, as neither ExternalStoreDB or ExternalStoreHttp subclass ExternalStore Remove trailing whitespace Change-Id: I90b61f93a99d5088edfadf83c846ec5fa7e40c2e --- includes/ExternalStore.php | 14 +++++++++----- includes/ExternalStoreDB.php | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/includes/ExternalStore.php b/includes/ExternalStore.php index 391829af1b..26e456c261 100644 --- a/includes/ExternalStore.php +++ b/includes/ExternalStore.php @@ -35,11 +35,14 @@ */ class ExternalStore { var $mParams; - + + /** + * @param $params array + */ function __construct( $params = array() ) { $this->mParams = $params; } - + /** * Fetch data from given URL * @@ -79,7 +82,7 @@ class ExternalStore { * * @param $proto String: type of external storage, should be a value in $wgExternalStores * @param $params Array: associative array of parameters for the ExternalStore object. - * @return ExternalStore subclass or false on error + * @return ExternalStore|bool ExternalStore class or false on error */ static function getStoreObject( $proto, $params = array() ) { global $wgExternalStores; @@ -119,7 +122,7 @@ class ExternalStore { return $store->store( $params, $data ); } } - + /** * Like insert() above, but does more of the work for us. * This function does not need a url param, it builds it by @@ -127,6 +130,7 @@ class ExternalStore { * * @param $data String * @param $storageParams Array: associative array of parameters for the ExternalStore object. + * @throws DBConnectionError|DBQueryError|MWException * @return string The URL of the stored data item, or false on error */ public static function insertToDefault( $data, $storageParams = array() ) { @@ -165,7 +169,7 @@ class ExternalStore { throw new MWException( "Unable to store text to external storage" ); } } - + /** * @param $data * @param $wiki diff --git a/includes/ExternalStoreDB.php b/includes/ExternalStoreDB.php index 6f2b33e1ff..4f35394086 100644 --- a/includes/ExternalStoreDB.php +++ b/includes/ExternalStoreDB.php @@ -26,6 +26,9 @@ */ class ExternalStoreDB { + /** + * @param $params array + */ function __construct( $params = array() ) { $this->mParams = $params; } @@ -165,6 +168,7 @@ class ExternalStoreDB { * * @param $cluster String: the cluster name * @param $data String: the data item + * @throws MWException * @return string URL */ function store( $cluster, $data ) { -- 2.20.1