jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/370942 )
Change subject: Fix minor issues found with phan
......................................................................
Fix minor issues found with phan
- fixed PHPDoc
- replaced deprecated function
Bug: T153252
Change-Id: I072a1c1201bd19eafe7c50bbbf32a71fa4a92a46
---
M includes/Revision.php
M includes/media/Bitmap.php
M includes/page/WikiPage.php
3 files changed, 10 insertions(+), 9 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Revision.php b/includes/Revision.php
index 537b7c1..88b138d 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -860,7 +860,7 @@
* 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 @@
* 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 @@
* 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 0f0b074..1aeead5 100644
--- a/includes/media/Bitmap.php
+++ b/includes/media/Bitmap.php
@@ -129,7 +129,7 @@
* @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 @@
* @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 @@
* @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 @@
* @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 c05ba45..af906fb 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -383,11 +383,12 @@
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 );
--
To view, visit https://gerrit.wikimedia.org/r/370942
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I072a1c1201bd19eafe7c50bbbf32a71fa4a92a46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits