From: WMDE-Fisch Date: Mon, 7 Aug 2017 14:55:20 +0000 (+0200) Subject: Fix minor issues found with phan X-Git-Tag: 1.31.0-rc.0~2432^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=21aae8b8f3145ccb3639ea4e46adfa981295831b Fix minor issues found with phan - fixed PHPDoc - replaced deprecated function Bug: T153252 Change-Id: I072a1c1201bd19eafe7c50bbbf32a71fa4a92a46 --- diff --git a/includes/Revision.php b/includes/Revision.php index 537b7c11a6..88b138ddf0 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -860,7 +860,7 @@ class Revision implements IDBAccessObject { * Revision::FOR_PUBLIC to be displayed to all users * Revision::FOR_THIS_USER to be displayed to the given user * Revision::RAW get the ID regardless of permissions - * @param User $user User object to check for, only if FOR_THIS_USER is passed + * @param User|null $user User object to check for, only if FOR_THIS_USER is passed * to the $audience parameter * @return int */ @@ -894,7 +894,7 @@ class Revision implements IDBAccessObject { * Revision::FOR_PUBLIC to be displayed to all users * Revision::FOR_THIS_USER to be displayed to the given user * Revision::RAW get the text regardless of permissions - * @param User $user User object to check for, only if FOR_THIS_USER is passed + * @param User|null $user User object to check for, only if FOR_THIS_USER is passed * to the $audience parameter * @return string */ @@ -938,7 +938,7 @@ class Revision implements IDBAccessObject { * Revision::FOR_PUBLIC to be displayed to all users * Revision::FOR_THIS_USER to be displayed to the given user * Revision::RAW get the text regardless of permissions - * @param User $user User object to check for, only if FOR_THIS_USER is passed + * @param User|null $user User object to check for, only if FOR_THIS_USER is passed * to the $audience parameter * @return string */ diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 0f0b074a67..1aeead5df8 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -129,7 +129,7 @@ class BitmapHandler extends TransformationalImageHandler { * @param File $image File associated with this thumbnail * @param array $params Array with scaler params * - * @return MediaTransformError Error object if error occurred, false (=no error) otherwise + * @return MediaTransformError|bool Error object if error occurred, false (=no error) otherwise */ protected function transformImageMagick( $image, $params ) { # use ImageMagick @@ -272,7 +272,7 @@ class BitmapHandler extends TransformationalImageHandler { * @param File $image File associated with this thumbnail * @param array $params Array with scaler params * - * @return MediaTransformError Error object if error occurred, false (=no error) otherwise + * @return MediaTransformError Error|bool object if error occurred, false (=no error) otherwise */ protected function transformImageMagickExt( $image, $params ) { global $wgSharpenReductionThreshold, $wgSharpenParameter, $wgMaxAnimatedGifArea, @@ -367,7 +367,7 @@ class BitmapHandler extends TransformationalImageHandler { * @param File $image File associated with this thumbnail * @param array $params Array with scaler params * - * @return MediaTransformError Error object if error occurred, false (=no error) otherwise + * @return MediaTransformError Error|bool object if error occurred, false (=no error) otherwise */ protected function transformCustom( $image, $params ) { # Use a custom convert command @@ -399,7 +399,7 @@ class BitmapHandler extends TransformationalImageHandler { * @param File $image File associated with this thumbnail * @param array $params Array with scaler params * - * @return MediaTransformError Error object if error occurred, false (=no error) otherwise + * @return MediaTransformError|bool Error object if error occurred, false (=no error) otherwise */ protected function transformGd( $image, $params ) { # Use PHP's builtin GD library functions. diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index c05ba45dae..af906fb44f 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -383,11 +383,12 @@ class WikiPage implements Page, IDBAccessObject { if ( is_int( $from ) ) { list( $index, $opts ) = DBAccessObjectUtils::getDBOptions( $from ); $data = $this->pageDataFromTitle( wfGetDB( $index ), $this->mTitle, $opts ); + $loadBalancer = MediaWikiServices::getInstance()->getDBLoadBalancer(); if ( !$data && $index == DB_REPLICA - && wfGetLB()->getServerCount() > 1 - && wfGetLB()->hasOrMadeRecentMasterChanges() + && $loadBalancer->getServerCount() > 1 + && $loadBalancer->hasOrMadeRecentMasterChanges() ) { $from = self::READ_LATEST; list( $index, $opts ) = DBAccessObjectUtils::getDBOptions( $from );