Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/155904
Change subject: Move EntityPermissionChecker and EntityContentFactory into namespaces ...................................................................... Move EntityPermissionChecker and EntityContentFactory into namespaces EntityPermissionChecker to Wikibase\Repo\Store namespace EntityContentFactory to Wikibase\Repo\Content namespace Change-Id: I02eb32ff83ab3a41d857edb6a10734a1cd4cddfc --- M repo/includes/EditEntity.php M repo/includes/Hook/MakeGlobalVariablesScriptHandler.php M repo/includes/Interactors/RedirectCreationInteractor.php M repo/includes/UpdateRepoOnMoveJob.php M repo/includes/WikibaseRepo.php M repo/includes/actions/ViewEntityAction.php M repo/includes/api/ApiWikibase.php M repo/includes/content/EntityContentFactory.php M repo/includes/specials/SpecialWikibaseRepoPage.php M repo/includes/store/EntityPermissionChecker.php M repo/includes/store/sql/EntityPerPageBuilder.php M repo/includes/store/sql/WikiPageEntityStore.php M repo/tests/phpunit/includes/EditEntityTest.php M repo/tests/phpunit/includes/Hook/MakeGlobalVariablesScriptHandlerTest.php M repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php M repo/tests/phpunit/includes/WikibaseRepoTest.php M repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php M repo/tests/phpunit/includes/content/EntityContentFactoryTest.php M repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php 19 files changed, 33 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/04/155904/1 diff --git a/repo/includes/EditEntity.php b/repo/includes/EditEntity.php index 762dd8c..e67b9cb 100644 --- a/repo/includes/EditEntity.php +++ b/repo/includes/EditEntity.php @@ -16,6 +16,7 @@ use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\StorageException; +use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Repo\WikibaseRepo; use WikiPage; diff --git a/repo/includes/Hook/MakeGlobalVariablesScriptHandler.php b/repo/includes/Hook/MakeGlobalVariablesScriptHandler.php index 0642b7a..a67a178 100644 --- a/repo/includes/Hook/MakeGlobalVariablesScriptHandler.php +++ b/repo/includes/Hook/MakeGlobalVariablesScriptHandler.php @@ -5,9 +5,9 @@ use OutputPage; use Wikibase\DataModel\Entity\Entity; use Wikibase\EntityContent; -use Wikibase\EntityContentFactory; use Wikibase\Lib\Serializers\SerializationOptions; use Wikibase\ParserOutputJsConfigBuilder; +use Wikibase\Repo\Content\EntityContentFactory; /** * @since 0.5 diff --git a/repo/includes/Interactors/RedirectCreationInteractor.php b/repo/includes/Interactors/RedirectCreationInteractor.php index cebf128..54244fc 100644 --- a/repo/includes/Interactors/RedirectCreationInteractor.php +++ b/repo/includes/Interactors/RedirectCreationInteractor.php @@ -5,12 +5,12 @@ use Status; use User; use Wikibase\DataModel\Entity\EntityId; -use Wikibase\EntityPermissionChecker; use Wikibase\Lib\Store\EntityRedirect; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\StorageException; use Wikibase\Lib\Store\UnresolvedRedirectException; +use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Summary; use Wikibase\SummaryFormatter; diff --git a/repo/includes/UpdateRepoOnMoveJob.php b/repo/includes/UpdateRepoOnMoveJob.php index 4e3cb5b..86c79f6 100644 --- a/repo/includes/UpdateRepoOnMoveJob.php +++ b/repo/includes/UpdateRepoOnMoveJob.php @@ -10,9 +10,11 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\SiteLink; use Wikibase\Lib\Store\EntityRevisionLookup; -use Wikibase\Lib\Store\StorageException; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\EntityTitleLookup; +use Wikibase\Lib\Store\StorageException; +use Wikibase\Repo\Content\EntityContentFactory; +use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Repo\WikibaseRepo; /** diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php index 6029a20..16c4f82 100644 --- a/repo/includes/WikibaseRepo.php +++ b/repo/includes/WikibaseRepo.php @@ -21,7 +21,6 @@ use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\Property; -use Wikibase\EntityContentFactory; use Wikibase\EntityFactory; use Wikibase\InternalSerialization\DeserializerFactory; use Wikibase\InternalSerialization\SerializerFactory; @@ -53,12 +52,14 @@ use Wikibase\ParserOutputJsConfigBuilder; use Wikibase\PropertyHandler; use Wikibase\ReferencedEntitiesFinder; +use Wikibase\Repo\Content\EntityContentFactory; use Wikibase\Repo\Localizer\ChangeOpValidationExceptionLocalizer; use Wikibase\Repo\Localizer\MessageParameterFormatter; use Wikibase\Repo\Notifications\ChangeNotifier; use Wikibase\Repo\Notifications\ChangeTransmitter; use Wikibase\Repo\Notifications\DatabaseChangeTransmitter; use Wikibase\Repo\Notifications\DummyChangeTransmitter; +use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Settings; use Wikibase\SettingsArray; use Wikibase\SnakFactory; @@ -622,7 +623,7 @@ } /** - * @return \Wikibase\EntityPermissionChecker + * @return EntityPermissionChecker */ public function getEntityPermissionChecker() { return $this->getEntityContentFactory(); diff --git a/repo/includes/actions/ViewEntityAction.php b/repo/includes/actions/ViewEntityAction.php index c182cc4..f2118b8 100644 --- a/repo/includes/actions/ViewEntityAction.php +++ b/repo/includes/actions/ViewEntityAction.php @@ -7,6 +7,7 @@ use LogEventsList; use SpecialPage; use ViewAction; +use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Repo\WikibaseRepo; /** @@ -77,7 +78,7 @@ * * @param EntityPermissionChecker $permissionChecker */ - public function setPermissionChecker( $permissionChecker ) { + public function setPermissionChecker( EntityPermissionChecker $permissionChecker ) { $this->permissionChecker = $permissionChecker; } diff --git a/repo/includes/api/ApiWikibase.php b/repo/includes/api/ApiWikibase.php index fe89bcb..7c5026f 100644 --- a/repo/includes/api/ApiWikibase.php +++ b/repo/includes/api/ApiWikibase.php @@ -14,7 +14,6 @@ use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\EditEntity; use Wikibase\EntityFactory; -use Wikibase\EntityPermissionChecker; use Wikibase\EntityRevision; use Wikibase\Lib\Localizer\ExceptionLocalizer; use Wikibase\Lib\PropertyDataTypeLookup; @@ -25,6 +24,7 @@ use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\StorageException; use Wikibase\Lib\Store\UnresolvedRedirectException; +use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Repo\WikibaseRepo; use Wikibase\Summary; use Wikibase\SummaryFormatter; diff --git a/repo/includes/content/EntityContentFactory.php b/repo/includes/content/EntityContentFactory.php index 0cad4fa..218c43a 100644 --- a/repo/includes/content/EntityContentFactory.php +++ b/repo/includes/content/EntityContentFactory.php @@ -1,6 +1,6 @@ <?php -namespace Wikibase; +namespace Wikibase\Repo\Content; use ContentHandler; use MWException; @@ -9,8 +9,11 @@ use Status; use Title; use User; +use Wikibase\DataModel\Entity\Entity; +use Wikibase\DataModel\Entity\EntityId; use Wikibase\Lib\Store\EntityRedirect; use Wikibase\Lib\Store\EntityTitleLookup; +use Wikibase\Repo\Store\EntityPermissionChecker; /** * Factory for EntityContent objects. diff --git a/repo/includes/specials/SpecialWikibaseRepoPage.php b/repo/includes/specials/SpecialWikibaseRepoPage.php index d92c849..50f8260 100644 --- a/repo/includes/specials/SpecialWikibaseRepoPage.php +++ b/repo/includes/specials/SpecialWikibaseRepoPage.php @@ -12,11 +12,11 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\ItemId; use Wikibase\EditEntity; -use Wikibase\EntityPermissionChecker; use Wikibase\EntityRevision; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\EntityTitleLookup; +use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Repo\WikibaseRepo; use Wikibase\Summary; use Wikibase\SummaryFormatter; diff --git a/repo/includes/store/EntityPermissionChecker.php b/repo/includes/store/EntityPermissionChecker.php index b5272d7..fdd7d33 100644 --- a/repo/includes/store/EntityPermissionChecker.php +++ b/repo/includes/store/EntityPermissionChecker.php @@ -1,9 +1,11 @@ <?php -namespace Wikibase; +namespace Wikibase\Repo\Store; use Status; use User; +use Wikibase\DataModel\Entity\Entity; +use Wikibase\DataModel\Entity\EntityId; /** * Service interface for checking a user's permissions on a given entity. diff --git a/repo/includes/store/sql/EntityPerPageBuilder.php b/repo/includes/store/sql/EntityPerPageBuilder.php index 2c9183f..6fad0e5 100644 --- a/repo/includes/store/sql/EntityPerPageBuilder.php +++ b/repo/includes/store/sql/EntityPerPageBuilder.php @@ -1,9 +1,10 @@ <?php namespace Wikibase; -use Wikibase\Lib\Reporting\MessageReporter; use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\EntityIdParsingException; +use Wikibase\Lib\Reporting\MessageReporter; +use Wikibase\Repo\Content\EntityContentFactory; /** * Utility class for rebuilding the wb_entity_per_page table. diff --git a/repo/includes/store/sql/WikiPageEntityStore.php b/repo/includes/store/sql/WikiPageEntityStore.php index 76bc011..2caee79 100644 --- a/repo/includes/store/sql/WikiPageEntityStore.php +++ b/repo/includes/store/sql/WikiPageEntityStore.php @@ -11,7 +11,6 @@ use Wikibase\DataModel\Entity\Entity; use Wikibase\DataModel\Entity\EntityId; use Wikibase\EntityContent; -use Wikibase\EntityContentFactory; use Wikibase\EntityPerPage; use Wikibase\EntityRevision; use Wikibase\IdGenerator; @@ -19,6 +18,7 @@ use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\EntityStoreWatcher; use Wikibase\Lib\Store\StorageException; +use Wikibase\Repo\Content\EntityContentFactory; use Wikibase\Repo\GenericEventDispatcher; use WikiPage; diff --git a/repo/tests/phpunit/includes/EditEntityTest.php b/repo/tests/phpunit/includes/EditEntityTest.php index 5647651..ff857d6 100644 --- a/repo/tests/phpunit/includes/EditEntityTest.php +++ b/repo/tests/phpunit/includes/EditEntityTest.php @@ -14,8 +14,8 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Term\Fingerprint; use Wikibase\EditEntity; -use Wikibase\EntityPermissionChecker; use Wikibase\Lib\Store\EntityTitleLookup; +use Wikibase\Repo\Store\EntityPermissionChecker; /** * @covers Wikibase\EditEntity @@ -96,7 +96,7 @@ * @return EntityPermissionChecker */ protected function newEntityPermissionCheckerMock( $permissions ) { - $permissionChecker = $this->getMock( 'Wikibase\EntityPermissionChecker' ); + $permissionChecker = $this->getMock( 'Wikibase\Repo\Store\EntityPermissionChecker' ); $checkAction = function ( $user, $action ) use( $permissions ) { if ( $permissions === null ) { diff --git a/repo/tests/phpunit/includes/Hook/MakeGlobalVariablesScriptHandlerTest.php b/repo/tests/phpunit/includes/Hook/MakeGlobalVariablesScriptHandlerTest.php index 1d64ebb..95d0dfb 100644 --- a/repo/tests/phpunit/includes/Hook/MakeGlobalVariablesScriptHandlerTest.php +++ b/repo/tests/phpunit/includes/Hook/MakeGlobalVariablesScriptHandlerTest.php @@ -13,11 +13,11 @@ use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\EntityContent; -use Wikibase\EntityContentFactory; use Wikibase\Hook\MakeGlobalVariablesScriptHandler; use Wikibase\ItemContent; use Wikibase\Lib\Store\EntityRedirect; use Wikibase\ParserOutputJsConfigBuilder; +use Wikibase\Repo\Content\EntityContentFactory; /** * @covers Wikibase\Hook\MakeGlobalVariablesScriptHandler @@ -123,7 +123,7 @@ * @return EntityContentFactory */ private function getEntityContentFactory() { - $entityContentFactory = $this->getMockBuilder( 'Wikibase\EntityContentFactory' ) + $entityContentFactory = $this->getMockBuilder( 'Wikibase\Repo\Content\EntityContentFactory' ) ->disableOriginalConstructor() ->getMock(); diff --git a/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php b/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php index bf6192e..1e9c5bf 100644 --- a/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php +++ b/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php @@ -65,7 +65,7 @@ } private function getPermissionCheckers() { - $permissionChecker = $this->getMock( 'Wikibase\EntityPermissionChecker' ); + $permissionChecker = $this->getMock( 'Wikibase\Repo\Store\EntityPermissionChecker' ); $permissionChecker->expects( $this->any() ) ->method( 'getPermissionStatusForEntityId' ) diff --git a/repo/tests/phpunit/includes/WikibaseRepoTest.php b/repo/tests/phpunit/includes/WikibaseRepoTest.php index e84dc9c..7742179 100644 --- a/repo/tests/phpunit/includes/WikibaseRepoTest.php +++ b/repo/tests/phpunit/includes/WikibaseRepoTest.php @@ -33,7 +33,7 @@ public function testGetEntityContentFactoryReturnType() { $returnValue = $this->getDefaultInstance()->getEntityContentFactory(); - $this->assertInstanceOf( 'Wikibase\EntityContentFactory', $returnValue ); + $this->assertInstanceOf( 'Wikibase\Repo\Content\EntityContentFactory', $returnValue ); } public function testGetEntityTitleLookupReturnType() { diff --git a/repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php b/repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php index a087e0f..4afe91e 100644 --- a/repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php +++ b/repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php @@ -69,7 +69,7 @@ } private function getPermissionCheckers() { - $permissionChecker = $this->getMock( 'Wikibase\EntityPermissionChecker' ); + $permissionChecker = $this->getMock( 'Wikibase\Repo\Store\EntityPermissionChecker' ); $permissionChecker->expects( $this->any() ) ->method( 'getPermissionStatusForEntityId' ) diff --git a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php index a5e7a27..fc2a906 100644 --- a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php +++ b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php @@ -2,15 +2,15 @@ namespace Wikibase\Test; +use ContentHandler; use Wikibase\DataModel\Entity\Entity; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\EntityContentFactory; use Wikibase\Lib\Store\EntityRedirect; +use Wikibase\Repo\Content\EntityContentFactory; use Wikibase\Repo\WikibaseRepo; -use ContentHandler; /** * @covers Wikibase\EntityContentFactory diff --git a/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php b/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php index 372bd8b..7155eec 100644 --- a/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php +++ b/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php @@ -11,13 +11,13 @@ use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\EntityContentFactory; use Wikibase\EntityPerPageTable; use Wikibase\Lib\Store\EntityRedirect; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\StorageException; use Wikibase\Lib\Store\WikiPageEntityRevisionLookup; +use Wikibase\Repo\Content\EntityContentFactory; use Wikibase\Repo\Store\WikiPageEntityStore; use Wikibase\Repo\WikibaseRepo; use Wikibase\SqlIdGenerator; -- To view, visit https://gerrit.wikimedia.org/r/155904 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02eb32ff83ab3a41d857edb6a10734a1cd4cddfc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <aude.w...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits