Merge "Add a bunch of @since tags to Linker"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 4 May 2016 18:00:52 +0000 (18:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 4 May 2016 18:00:52 +0000 (18:00 +0000)
extensions/README
includes/Message.php
includes/api/ApiOptions.php
includes/changes/EnhancedChangesList.php
includes/htmlform/HTMLFormField.php
includes/specialpage/SpecialPage.php
includes/specials/SpecialBlock.php
skins/README
tests/phpunit/tests/MediaWikiTestCaseTest.php

index bad230e..923a19b 100644 (file)
@@ -11,8 +11,7 @@ directory and make a symbolic link:
  mediawiki/extensions$ ln -s ../../extensions-trunk/FooBar
 
 Most extensions are available through Git:
-    https://gerrit.wikimedia.org/r/#/admin/projects/?filter=mediawiki%252Fextensions%252F
-    https://git.wikimedia.org/project/mediawiki
+    https://phabricator.wikimedia.org/diffusion/MEXT/
 
 
 Please note that under POSIX systems (Linux...), parent of a symbolic path
index 8ac73b3..c7752aa 100644 (file)
@@ -388,6 +388,7 @@ class Message implements MessageSpecifier, Serializable {
         * @param string|array|MessageSpecifier $value
         * @return Message
         * @throws InvalidArgumentException
+        * @since 1.27
         */
        public static function newFromSpecifier( $value ) {
                if ( $value instanceof RawMessage ) {
index e51d46d..8bfe447 100644 (file)
@@ -86,8 +86,7 @@ class ApiOptions extends ApiBase {
                                                // We need a dummy HTMLForm for the validate callback...
                                                $htmlForm = new HTMLForm( [], $this );
                                        }
-                                       $field = HTMLForm::loadInputFromParameters( $key, $prefs[$key] );
-                                       $field->mParent = $htmlForm;
+                                       $field = HTMLForm::loadInputFromParameters( $key, $prefs[$key], $htmlForm );
                                        $validation = $field->validate( $value, $user->getOptions() );
                                        break;
                                case 'registered-multiselect':
index a808516..1070877 100644 (file)
@@ -262,6 +262,7 @@ class EnhancedChangesList extends ChangesList {
                        if ( !$line ) {
                                // completely ignore this RC entry if we don't want to render it
                                unset( $block[$i] );
+                               continue;
                        }
 
                        // Roll up flags
@@ -286,6 +287,7 @@ class EnhancedChangesList extends ChangesList {
 
                        $lines[] = $line;
                }
+
                // Further down are some assumptions that $block is a 0-indexed array
                // with (count-1) as last key. Let's make sure it is.
                $block = array_values( $block );
index 380b11d..9f5e728 100644 (file)
@@ -28,7 +28,7 @@ abstract class HTMLFormField {
        protected $mShowEmptyLabels = true;
 
        /**
-        * @var HTMLForm
+        * @var HTMLForm|null
         */
        public $mParent;
 
@@ -1095,7 +1095,13 @@ abstract class HTMLFormField {
         * @return Message
         */
        protected function getMessage( $value ) {
-               return Message::newFromSpecifier( $value )->setContext( $this->mParent );
+               $message = Message::newFromSpecifier( $value );
+
+               if ( $this->mParent ) {
+                       $message->setContext( $this->mParent );
+               }
+
+               return $message;
        }
 
        /**
index 6ca7a13..b274017 100644 (file)
@@ -633,6 +633,7 @@ class SpecialPage {
        /**
         * Wrapper around wfMessage that sets the current context.
         *
+        * @since 1.16
         * @return Message
         * @see wfMessage
         */
index 625e4aa..fcadede 100644 (file)
@@ -28,7 +28,7 @@
  * @ingroup SpecialPage
  */
 class SpecialBlock extends FormSpecialPage {
-       /** @var User User to be blocked, as passed either by parameter (url?wpTarget=Foo)
+       /** @var User|string|null User to be blocked, as passed either by parameter (url?wpTarget=Foo)
         * or as subpage (Special:Block/Foo) */
        protected $target;
 
@@ -330,8 +330,12 @@ class SpecialBlock extends FormSpecialPage {
 
                $otherBlockMessages = [];
                if ( $this->target !== null ) {
+                       $targetName = $this->target;
+                       if ( $this->target instanceof User ) {
+                               $targetName = $this->target->getName();
+                       }
                        # Get other blocks, i.e. from GlobalBlocking or TorBlock extension
-                       Hooks::run( 'OtherBlockLogLink', [ &$otherBlockMessages, $this->target ] );
+                       Hooks::run( 'OtherBlockLogLink', [ &$otherBlockMessages, $targetName ] );
 
                        if ( count( $otherBlockMessages ) ) {
                                $s = Html::rawElement(
index 7a980f7..572e2f8 100644 (file)
@@ -12,11 +12,10 @@ directory and make a symbolic link:
  mediawiki/skins$ ln -s ../../skins-trunk/FooBar
 
 The default skin Vector can be installed by cloning from Git:
-    git clone https://git.wikimedia.org/git/mediawiki/skins/Vector.git
+    git clone https://phabricator.wikimedia.org/diffusion/SVEC/Vector
 
 Other skins are also available:
-    https://gerrit.wikimedia.org/r/#/admin/projects/?filter=mediawiki%252Fskins%252F
-    https://git.wikimedia.org/project/mediawiki
+    https://phabricator.wikimedia.org/diffusion/SKIN/
 
 
 Please note that under POSIX systems (Linux...), parent of a symbolic path
index 152c2eb..955dd2f 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 use MediaWiki\Logger\LoggerFactory;
+use Psr\Log\LoggerInterface;
 
 /**
  * @covers MediaWikiTestCase
@@ -105,7 +106,7 @@ class MediaWikiTestCaseTest extends MediaWikiTestCase {
        public function testLoggersAreRestoredOnTearDown() {
                // replacing an existing logger
                $logger1 = LoggerFactory::getInstance( 'foo' );
-               $this->setLogger( 'foo', $this->getMock( '\Psr\Log\LoggerInterface' ) );
+               $this->setLogger( 'foo', $this->getMock( LoggerInterface::class ) );
                $logger2 = LoggerFactory::getInstance( 'foo' );
                $this->tearDown();
                $logger3 = LoggerFactory::getInstance( 'foo' );
@@ -114,7 +115,7 @@ class MediaWikiTestCaseTest extends MediaWikiTestCase {
                $this->assertNotSame( $logger1, $logger2 );
 
                // replacing a non-existing logger
-               $this->setLogger( 'bar', $this->getMock( '\Psr\Log\LoggerInterface' ) );
+               $this->setLogger( 'foo', $this->getMock( LoggerInterface::class ) );
                $logger1 = LoggerFactory::getInstance( 'bar' );
                $this->tearDown();
                $logger2 = LoggerFactory::getInstance( 'bar' );
@@ -124,8 +125,8 @@ class MediaWikiTestCaseTest extends MediaWikiTestCase {
 
                // replacing same logger twice
                $logger1 = LoggerFactory::getInstance( 'baz' );
-               $this->setLogger( 'baz', $this->getMock( '\Psr\Log\LoggerInterface' ) );
-               $this->setLogger( 'baz', $this->getMock( '\Psr\Log\LoggerInterface' ) );
+               $this->setLogger( 'foo', $this->getMock( LoggerInterface::class ) );
+               $this->setLogger( 'foo', $this->getMock( LoggerInterface::class ) );
                $this->tearDown();
                $logger2 = LoggerFactory::getInstance( 'baz' );