jenkins-bot has submitted this change and it was merged.

Change subject: Add missing method visibility in all Lib/Repo classes
......................................................................


Add missing method visibility in all Lib/Repo classes

Change-Id: Icac00c94f43fbc202e39c613ae2b32e07894a91c
---
M lib/includes/Validators/ValidatorErrorLocalizer.php
M lib/includes/formatters/EscapingValueFormatter.php
M lib/includes/formatters/MessageSnakFormatter.php
M lib/includes/store/EntityContentDataCodec.php
M repo/includes/Localizer/MessageParameterFormatter.php
M repo/includes/Validators/LabelUniquenessValidator.php
M repo/includes/Validators/SiteLinkUniquenessValidator.php
M repo/includes/Validators/TermValidatorFactory.php
M repo/tests/phpunit/includes/EditEntityTest.php
M repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
M repo/tests/phpunit/includes/actions/ActionTestCase.php
M repo/tests/phpunit/includes/api/EditPageTest.php
M repo/tests/phpunit/includes/api/MergeItemsTest.php
M repo/tests/phpunit/includes/content/EntityContentTest.php
14 files changed, 27 insertions(+), 25 deletions(-)

Approvals:
  Adrian Lang: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/includes/Validators/ValidatorErrorLocalizer.php 
b/lib/includes/Validators/ValidatorErrorLocalizer.php
index 2022321..daea4da 100644
--- a/lib/includes/Validators/ValidatorErrorLocalizer.php
+++ b/lib/includes/Validators/ValidatorErrorLocalizer.php
@@ -27,7 +27,7 @@
         * parameters. MUST return wikitext. This is typically some kind of 
dispatcher. If not
         * provided, naive formatting will be used, which will fail on 
non-primitive parameters.
         */
-       function __construct( ValueFormatter $paramFormatter = null ) {
+       public function __construct( ValueFormatter $paramFormatter = null ) {
                $this->paramFormatter = $paramFormatter;
        }
 
diff --git a/lib/includes/formatters/EscapingValueFormatter.php 
b/lib/includes/formatters/EscapingValueFormatter.php
index ae6c6d3..0ec35f7 100644
--- a/lib/includes/formatters/EscapingValueFormatter.php
+++ b/lib/includes/formatters/EscapingValueFormatter.php
@@ -24,7 +24,7 @@
         */
        private $escapeCallback;
 
-       function __construct( ValueFormatter $formatter, $escapeCallback ) {
+       public function __construct( ValueFormatter $formatter, $escapeCallback 
) {
                if ( !is_callable( $escapeCallback ) ) {
                        throw new InvalidArgumentException( '$escapeCallback 
must be callable' );
                }
diff --git a/lib/includes/formatters/MessageSnakFormatter.php 
b/lib/includes/formatters/MessageSnakFormatter.php
index 3310509..2c8828d 100644
--- a/lib/includes/formatters/MessageSnakFormatter.php
+++ b/lib/includes/formatters/MessageSnakFormatter.php
@@ -38,7 +38,7 @@
         *
         * @throws \InvalidArgumentException
         */
-       function __construct( $snakType, Message $message, $format ) {
+       public function __construct( $snakType, Message $message, $format ) {
                if ( !is_string( $snakType ) ) {
                        throw new InvalidArgumentException( '$snakType must be 
a string' );
                }
diff --git a/lib/includes/store/EntityContentDataCodec.php 
b/lib/includes/store/EntityContentDataCodec.php
index 27e4c0d..e3487ce 100644
--- a/lib/includes/store/EntityContentDataCodec.php
+++ b/lib/includes/store/EntityContentDataCodec.php
@@ -51,7 +51,7 @@
         * @param Serializer $entitySerializer
         * @param Deserializer $entityDeserializer
         */
-       function __construct(
+       public function __construct(
                EntityIdParser $entityIdParser,
                Serializer $entitySerializer,
                Deserializer $entityDeserializer
diff --git a/repo/includes/Localizer/MessageParameterFormatter.php 
b/repo/includes/Localizer/MessageParameterFormatter.php
index 16528e1..7d54deb 100644
--- a/repo/includes/Localizer/MessageParameterFormatter.php
+++ b/repo/includes/Localizer/MessageParameterFormatter.php
@@ -53,7 +53,7 @@
         * @param SiteStore $sites
         * @param Language $language
         */
-       function __construct(
+       public function __construct(
                ValueFormatter $dataValueFormatter,
                EntityTitleLookup $entityTitleLookup,
                SiteStore $sites,
@@ -152,4 +152,5 @@
 
                return "[$url $siteId:$page]";
        }
+
 }
diff --git a/repo/includes/Validators/LabelUniquenessValidator.php 
b/repo/includes/Validators/LabelUniquenessValidator.php
index 09bb2c0..4d52c85 100644
--- a/repo/includes/Validators/LabelUniquenessValidator.php
+++ b/repo/includes/Validators/LabelUniquenessValidator.php
@@ -28,7 +28,7 @@
        /**
         * @param LabelDescriptionDuplicateDetector $duplicateDetector
         */
-       function __construct( LabelDescriptionDuplicateDetector 
$duplicateDetector ) {
+       public function __construct( LabelDescriptionDuplicateDetector 
$duplicateDetector ) {
                $this->duplicateDetector = $duplicateDetector;
        }
 
diff --git a/repo/includes/Validators/SiteLinkUniquenessValidator.php 
b/repo/includes/Validators/SiteLinkUniquenessValidator.php
index 3dc3d4d..bd685a4 100644
--- a/repo/includes/Validators/SiteLinkUniquenessValidator.php
+++ b/repo/includes/Validators/SiteLinkUniquenessValidator.php
@@ -27,7 +27,7 @@
        /**
         * @param SiteLinkLookup $siteLinkLookup
         */
-       function __construct( SiteLinkLookup $siteLinkLookup ) {
+       public function __construct( SiteLinkLookup $siteLinkLookup ) {
                $this->siteLinkLookup = $siteLinkLookup;
        }
 
diff --git a/repo/includes/Validators/TermValidatorFactory.php 
b/repo/includes/Validators/TermValidatorFactory.php
index 3baa7fa..7048375 100644
--- a/repo/includes/Validators/TermValidatorFactory.php
+++ b/repo/includes/Validators/TermValidatorFactory.php
@@ -54,7 +54,7 @@
         *
         * @throws InvalidArgumentException
         */
-       function __construct(
+       public function __construct(
                $maxLength,
                array $languageCodes,
                EntityIdParser $idParser,
diff --git a/repo/tests/phpunit/includes/EditEntityTest.php 
b/repo/tests/phpunit/includes/EditEntityTest.php
index ff857d6..e976dc9 100644
--- a/repo/tests/phpunit/includes/EditEntityTest.php
+++ b/repo/tests/phpunit/includes/EditEntityTest.php
@@ -45,7 +45,7 @@
                return $user;
        }
 
-       function setUp() {
+       protected function setUp() {
                global $wgGroupPermissions, $wgHooks;
 
                parent::setUp();
@@ -59,7 +59,7 @@
                }
        }
 
-       function tearDown() {
+       protected function tearDown() {
                global $wgGroupPermissions, $wgHooks;
 
                $wgGroupPermissions = $this->permissions;
diff --git 
a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php 
b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
index 89d346e..fee157c 100644
--- a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
+++ b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
@@ -256,7 +256,7 @@
        /**
         * @dataProvider mergeProvider
         */
-       function testMergeItems( $fromData, $toData, $expectedFrom, 
$expectedTo, $ignoreConflicts = array() ){
+       public function testMergeItems( $fromData, $toData, $expectedFrom, 
$expectedTo, $ignoreConflicts = array() ){
                $interactor = $this->newInteractor();
 
                $fromId = new ItemId( 'Q1' );
@@ -350,7 +350,6 @@
                        $this->assertEquals( 'failed-modify', 
$ex->getErrorCode() );
                }
        }
-
 
        public function permissionProvider() {
                return array(
diff --git a/repo/tests/phpunit/includes/actions/ActionTestCase.php 
b/repo/tests/phpunit/includes/actions/ActionTestCase.php
index ee79fd7..89bbc63 100644
--- a/repo/tests/phpunit/includes/actions/ActionTestCase.php
+++ b/repo/tests/phpunit/includes/actions/ActionTestCase.php
@@ -64,7 +64,7 @@
                parent::tearDown();
        }
 
-       function applyPermissions( $permissions ) {
+       protected function applyPermissions( $permissions ) {
                global $wgGroupPermissions, $wgUser;
 
                if ( !$permissions ) {
@@ -220,6 +220,7 @@
         * @param Title $title the page to return the token for
         * @param String $for the action to return the token for, e.g. 'edit'.
         *
+        * @throws MWException
         * @return String the token
         */
        protected function getToken( Title $title, $for = 'edit' ) {
diff --git a/repo/tests/phpunit/includes/api/EditPageTest.php 
b/repo/tests/phpunit/includes/api/EditPageTest.php
index 6827ef9..221873b 100644
--- a/repo/tests/phpunit/includes/api/EditPageTest.php
+++ b/repo/tests/phpunit/includes/api/EditPageTest.php
@@ -2,9 +2,12 @@
 
 namespace Wikibase\Test\Api;
 
+use MWException;
+use UsageException;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\Repo\WikibaseRepo;
+use WikiPage;
 
 /**
  * Tests for blocking of direct editing.
@@ -26,7 +29,7 @@
        /**
         * @group API
         */
-       function testEditItemDirectly() {
+       public function testEditItemDirectly() {
                $store = WikibaseRepo::getDefaultInstance()->getEntityStore();
 
                $item = Item::newEmpty(); //@todo: do this with all kinds of 
entities.
@@ -54,12 +57,12 @@
        /**
         * @group API
         */
-       function testEditTextInItemNamespace() {
+       public function testEditTextInItemNamespace() {
                global $wgContentHandlerUseDB;
 
                $id = new ItemId( "Q1234567" );
                $title = 
WikibaseRepo::getDefaultInstance()->getEntityTitleLookup()->getTitleForId( $id 
);
-               $page = new \WikiPage( $title );
+               $page = new WikiPage( $title );
 
                $text = "hallo welt";
 
@@ -75,17 +78,15 @@
                        );
 
                        $this->fail( "Saving wikitext to the item namespace 
should not be possible." );
-               } catch ( \UsageException $ex ) {
-                       //ok, pass
-                       //print "\n$ex\n";
+               } catch ( UsageException $ex ) {
                        $this->assertTrue( true );
-               } catch ( \MWException $ex ) {
+               } catch ( MWException $ex ) {
                        if ( !$wgContentHandlerUseDB ) {
                                $this->markTestSkipped( 'With 
$wgContentHandlerUseDB, attempts to use a non-default content modfel will 
always fail.' );
                        } else {
                                throw $ex;
                        }
                }
-
        }
-}
\ No newline at end of file
+
+}
diff --git a/repo/tests/phpunit/includes/api/MergeItemsTest.php 
b/repo/tests/phpunit/includes/api/MergeItemsTest.php
index 0732bf5..3890f3e 100644
--- a/repo/tests/phpunit/includes/api/MergeItemsTest.php
+++ b/repo/tests/phpunit/includes/api/MergeItemsTest.php
@@ -160,7 +160,7 @@
        /**
         * @dataProvider provideData
         */
-       function testMergeRequest( $pre1, $pre2, $expectedFrom, $expectedTo, 
$ignoreConflicts = null ){
+       public function testMergeRequest( $pre1, $pre2, $expectedFrom, 
$expectedTo, $ignoreConflicts = null ){
                // -- set up params ---------------------------------
                $params = array(
                        'action' => 'wbmergeitems',
diff --git a/repo/tests/phpunit/includes/content/EntityContentTest.php 
b/repo/tests/phpunit/includes/content/EntityContentTest.php
index 9df6242..7028b28 100644
--- a/repo/tests/phpunit/includes/content/EntityContentTest.php
+++ b/repo/tests/phpunit/includes/content/EntityContentTest.php
@@ -38,7 +38,7 @@
         */
        private $entityStore;
 
-       function setUp() {
+       protected function setUp() {
                global $wgGroupPermissions, $wgUser;
 
                parent::setUp();
@@ -49,7 +49,7 @@
                $this->entityStore = 
WikibaseRepo::getDefaultInstance()->getEntityStore();
        }
 
-       function tearDown() {
+       protected function tearDown() {
                global $wgGroupPermissions;
                global $wgUser;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/172678
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icac00c94f43fbc202e39c613ae2b32e07894a91c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Adrian Lang <adrian.l...@wikimedia.de>
Gerrit-Reviewer: JanZerebecki <jan.wikime...@zerebecki.de>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to