From de398a4395f1ca23c107401fadbac880fcef4c57 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Sun, 24 Mar 2019 15:07:01 +0100 Subject: [PATCH] Update some minor type hints Change-Id: If5a6372e79038d3750d30a931badd0c110da2fe5 --- includes/Title.php | 1 + includes/specialpage/QueryPage.php | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index d8aeb6293c..0f45839577 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3727,6 +3727,7 @@ class Title implements LinkTarget, IDBAccessObject { // @todo: get rid of secureAndSplit, refactor parsing code. // @note: getTitleParser() returns a TitleParser implementation which does not have a // splitTitleString method, but the only implementation (MediaWikiTitleCodec) does + /** @var MediaWikiTitleCodec $titleCodec */ $titleCodec = MediaWikiServices::getInstance()->getTitleParser(); // MalformedTitleException can be thrown here $parts = $titleCodec->splitTitleString( $this->mDbkeyform, $this->mDefaultNamespace ); diff --git a/includes/specialpage/QueryPage.php b/includes/specialpage/QueryPage.php index 579ca195d8..144732cb1e 100644 --- a/includes/specialpage/QueryPage.php +++ b/includes/specialpage/QueryPage.php @@ -46,13 +46,18 @@ abstract class QueryPage extends SpecialPage { * The number of rows returned by the query. Reading this variable * only makes sense in functions that are run after the query has been * done, such as preprocessResults() and formatRow(). + * + * @var int */ protected $numRows; + /** + * @var string|null + */ protected $cachedTimestamp = null; /** - * Whether to show prev/next links + * @var bool Whether to show prev/next links */ protected $shownavigation = true; @@ -62,7 +67,8 @@ abstract class QueryPage extends SpecialPage { * * DO NOT CHANGE THIS LIST without testing that * maintenance/updateSpecialPages.php still works. - * @return array + * + * @return string[][] */ public static function getPages() { static $qp = null; @@ -166,7 +172,7 @@ abstract class QueryPage extends SpecialPage { * Subclasses return an array of fields to order by here. Don't append * DESC to the field names, that'll be done automatically if * sortDescending() returns true. - * @return array + * @return string[] * @since 1.18 */ function getOrderFields() { @@ -378,7 +384,7 @@ abstract class QueryPage extends SpecialPage { /** * Get a DB connection to be used for slow recache queries - * @return IDatabase + * @return \Wikimedia\Rdbms\Database */ function getRecacheDB() { return wfGetDB( DB_REPLICA, [ $this->getName(), 'QueryPage::recache', 'vslow' ] ); @@ -500,6 +506,9 @@ abstract class QueryPage extends SpecialPage { return [ 'value' ]; } + /** + * @return string + */ public function getCachedTimestamp() { if ( is_null( $this->cachedTimestamp ) ) { $dbr = wfGetDB( DB_REPLICA ); -- 2.20.1