Merge "tests: Stop using deprecated LBFactory, use namespaced version"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 21 Sep 2018 03:05:19 +0000 (03:05 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 21 Sep 2018 03:05:19 +0000 (03:05 +0000)
RELEASE-NOTES-1.32
includes/mail/MailAddress.php
includes/specialpage/SpecialPageFactory.php

index 51a1498..16eec55 100644 (file)
@@ -312,6 +312,8 @@ because of Phabricator reports.
 * The global function wfUseMW, deprecated since 1.26, has now been removed. Use
   the "requires" property of static extension registration instead.
 * $wgSpecialPages no longer accepts array syntax, deprecated since 1.18.
+* The MailAddress constructor can no longer be called with a User object,
+  behaviour which has been deprecated since 1.24.
 
 === Deprecations in 1.32 ===
 * HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit
index 1b66c38..000bbe3 100644 (file)
@@ -46,22 +46,14 @@ class MailAddress {
        public $address;
 
        /**
-        * @param string $address String with an email address, or a User object
+        * @param string $address String with an email address
         * @param string|null $name Human-readable name if a string address is given
         * @param string|null $realName Human-readable real name if a string address is given
         */
        function __construct( $address, $name = null, $realName = null ) {
-               if ( is_object( $address ) && $address instanceof User ) {
-                       // Old calling format, now deprecated
-                       wfDeprecated( __METHOD__ . ' with a User object', '1.24' );
-                       $this->address = $address->getEmail();
-                       $this->name = $address->getName();
-                       $this->realName = $address->getRealName();
-               } else {
-                       $this->address = strval( $address );
-                       $this->name = strval( $name );
-                       $this->realName = strval( $realName );
-               }
+               $this->address = strval( $address );
+               $this->name = strval( $name );
+               $this->realName = strval( $realName );
        }
 
        /**
index e136ce0..013ceb2 100644 (file)
@@ -408,16 +408,14 @@ class SpecialPageFactory {
 
                        if ( $page instanceof SpecialPage ) {
                                return $page;
-                       } else {
-                               // It's not a classname, nor a callback, nor a legacy constructor array,
-                               // nor a special page object. Give up.
-                               wfLogWarning( "Cannot instantiate special page $realName: bad spec!" );
-                               return null;
                        }
 
-               } else {
-                       return null;
+                       // It's not a classname, nor a callback, nor a legacy constructor array,
+                       // nor a special page object. Give up.
+                       wfLogWarning( "Cannot instantiate special page $realName: bad spec!" );
                }
+
+               return null;
        }
 
        /**
@@ -554,9 +552,9 @@ class SpecialPageFactory {
                                $context->getOutput()->redirect( $url );
 
                                return $title;
-                       } else {
-                               $context->setTitle( $page->getPageTitle( $par ) );
                        }
+
+                       $context->setTitle( $page->getPageTitle( $par ) );
                } elseif ( !$page->isIncludable() ) {
                        return false;
                }
@@ -703,8 +701,8 @@ class SpecialPageFactory {
                list( $name, $subpage ) = $this->resolveAlias( $alias );
                if ( $name != null ) {
                        return SpecialPage::getTitleFor( $name, $subpage );
-               } else {
-                       return null;
                }
+
+               return null;
        }
 }