jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/370949 )
Change subject: Temporarily add class alias for EntityRevision ...................................................................... Temporarily add class alias for EntityRevision Apparently there are serialized instances of EntityRevision using the old FQN in cache. The alias could be removed after all caches are only using new namespace. Bug: T172616 Change-Id: I3839fff8d8bf21391e50a3f6dfd964ab5e4a4edd --- M client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php M data-access/src/DispatchingServiceFactory.php M data-access/src/RepositoryServiceContainer.php M data-access/tests/phpunit/DispatchingServiceFactoryTest.php M data-access/tests/phpunit/RepositoryServiceContainerTest.php M lib/WikibaseLib.php M lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php M lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php M lib/tests/phpunit/EntityRevisionLookupTest.php M lib/tests/phpunit/MockRepository.php M lib/tests/phpunit/MockRepositoryTest.php M lib/tests/phpunit/Store/CachingEntityRevisionLookupTest.php M lib/tests/phpunit/Store/DispatchingEntityRevisionLookupTest.php M lib/tests/phpunit/Store/EntityRevisionTest.php M lib/tests/phpunit/Store/PrefetchingWikiPageEntityMetaDataAccessorTest.php M repo/Wikibase.hooks.php M repo/includes/Api/EntityLoadingHelper.php M repo/includes/Api/GetEntities.php M repo/includes/Api/MergeItems.php M repo/includes/Api/ResultBuilder.php M repo/includes/Content/EntityContent.php M repo/includes/EditEntity.php M repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php M repo/includes/LinkedData/EntityDataRequestHandler.php M repo/includes/LinkedData/EntityDataSerializationService.php M repo/includes/Specials/SpecialMergeItems.php M repo/includes/Specials/SpecialModifyEntity.php M repo/includes/Store/DispatchingEntityStoreWatcher.php M repo/includes/Store/Sql/WikiPageEntityStore.php M repo/tests/phpunit/includes/Actions/ActionTestCase.php M repo/tests/phpunit/includes/Api/ApiFormatTestCase.php M repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php M repo/tests/phpunit/includes/Api/ResultBuilderTest.php M repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php M repo/tests/phpunit/includes/Hooks/OutputPageBeforeHTMLHookHandlerTest.php M repo/tests/phpunit/includes/ItemMoveTest.php M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php M repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php M repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php M repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php M repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php 41 files changed, 139 insertions(+), 134 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php index 8b1349d..dc5b87a 100644 --- a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php +++ b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php @@ -17,7 +17,7 @@ use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\DataModel\Snak\Snak; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\SnakFormatter; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\RevisionBasedEntityLookup; @@ -231,7 +231,7 @@ ->will( $this->returnCallback( function( EntityId $entityId ) { switch ( $entityId->getSerialization() ) { case 'Q42': - return new EntityRevision( new Item( new ItemId( 'Q42' ) ) ); + return new TheEntityRevision( new Item( new ItemId( 'Q42' ) ) ); case 'Q43': throw new RevisionedUnresolvedRedirectException( $entityId, diff --git a/data-access/src/DispatchingServiceFactory.php b/data-access/src/DispatchingServiceFactory.php index c3ef487..825ac17 100644 --- a/data-access/src/DispatchingServiceFactory.php +++ b/data-access/src/DispatchingServiceFactory.php @@ -8,7 +8,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityRedirect; use Wikibase\DataModel\Services\Term\TermBuffer; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Interactors\TermSearchInteractorFactory; use Wikibase\Lib\RepositoryDefinitions; use Wikibase\Lib\Store\EntityInfoBuilderFactory; @@ -88,9 +88,9 @@ /** * @see EntityStoreWatcher::entityUpdated * - * @param EntityRevision $entityRevision + * @param TheEntityRevision $entityRevision */ - public function entityUpdated( EntityRevision $entityRevision ) { + public function entityUpdated( TheEntityRevision $entityRevision ) { $container = $this->getContainerForRepository( $entityRevision->getEntity()->getId()->getRepositoryName() ); diff --git a/data-access/src/RepositoryServiceContainer.php b/data-access/src/RepositoryServiceContainer.php index 1db0ac2..6ea872b 100644 --- a/data-access/src/RepositoryServiceContainer.php +++ b/data-access/src/RepositoryServiceContainer.php @@ -11,7 +11,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\EntityRedirect; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\InternalSerialization\DeserializerFactory as InternalDeserializerFactory; use Wikibase\Lib\Store\EntityStoreWatcher; @@ -128,9 +128,9 @@ /** * @see EntityStoreWatcher::entityUpdated * - * @param EntityRevision $entityRevision + * @param TheEntityRevision $entityRevision */ - public function entityUpdated( EntityRevision $entityRevision ) { + public function entityUpdated( TheEntityRevision $entityRevision ) { foreach ( $this->getServiceNames() as $serviceName ) { $service = $this->peekService( $serviceName ); if ( $service instanceof EntityStoreWatcher ) { diff --git a/data-access/tests/phpunit/DispatchingServiceFactoryTest.php b/data-access/tests/phpunit/DispatchingServiceFactoryTest.php index b09f95e..c9c144f 100644 --- a/data-access/tests/phpunit/DispatchingServiceFactoryTest.php +++ b/data-access/tests/phpunit/DispatchingServiceFactoryTest.php @@ -10,7 +10,7 @@ use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\Property; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\RepositoryDefinitions; /** @@ -116,10 +116,10 @@ ) ); - $factory->entityUpdated( new EntityRevision( new Item( new ItemId( 'foo:Q123' ) ) ) ); + $factory->entityUpdated( new TheEntityRevision( new Item( new ItemId( 'foo:Q123' ) ) ) ); $fooContainer->entityUpdated( - new EntityRevision( new Item( new ItemId( 'foo:Q123' ) ) ) + new TheEntityRevision( new Item( new ItemId( 'foo:Q123' ) ) ) )->shouldHaveBeenCalled(); $localContainer->entityUpdated( Argument::any() )->shouldNotHaveBeenCalled(); } diff --git a/data-access/tests/phpunit/RepositoryServiceContainerTest.php b/data-access/tests/phpunit/RepositoryServiceContainerTest.php index b6f6fcb..d74086f 100644 --- a/data-access/tests/phpunit/RepositoryServiceContainerTest.php +++ b/data-access/tests/phpunit/RepositoryServiceContainerTest.php @@ -12,7 +12,7 @@ use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Services\EntityId\PrefixMappingEntityIdParser; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\DataTypeDefinitions; use Wikibase\Lib\EntityTypeDefinitions; use Wikibase\Lib\RepositoryDefinitions; @@ -158,7 +158,7 @@ public function testEntityUpdatedDelegatesEventToAllWatchersThatHaveAlreadyBeenUsed() { $container = $this->getRepositoryServiceContainerForEventTest( 'entityUpdated' ); - $container->entityUpdated( new EntityRevision( new Item( new ItemId( 'foo:Q123' ) ) ) ); + $container->entityUpdated( new TheEntityRevision( new Item( new ItemId( 'foo:Q123' ) ) ) ); } public function testEntityDeletedDelegatesEventToAllWatchersThatHaveAlreadyBeenUsed() { diff --git a/lib/WikibaseLib.php b/lib/WikibaseLib.php index 8f7681a..02fff5e 100644 --- a/lib/WikibaseLib.php +++ b/lib/WikibaseLib.php @@ -22,6 +22,8 @@ * and join the open data revolution. <> */ +use Wikibase\Lib\Store\EntityRevision; + /** * Entry point for the WikibaseLib extension. * @@ -52,6 +54,9 @@ require_once __DIR__ . '/../vendor/autoload.php'; } +// Remove once the cache used by CachingEntityRevisionLookup has expired, see: T172616 +class_alias( EntityRevision::class, 'Wikibase\EntityRevision' ); + call_user_func( function() { global $wgExtensionCredits, $wgHooks, $wgResourceModules, $wgMessagesDirs; diff --git a/lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php b/lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php index ae9c0c4..456d491 100644 --- a/lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php +++ b/lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php @@ -8,7 +8,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityRedirect; use Wikibase\DataModel\Services\Entity\EntityPrefetcher; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStoreWatcher; @@ -116,9 +116,9 @@ /** * @see EntityStoreWatcher::entityDeleted * - * @param EntityRevision $entityRevision + * @param TheEntityRevision $entityRevision */ - public function entityUpdated( EntityRevision $entityRevision ) { + public function entityUpdated( TheEntityRevision $entityRevision ) { $this->purge( $entityRevision->getEntity()->getId() ); } diff --git a/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php b/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php index b14f67e..928f6d4 100644 --- a/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php +++ b/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php @@ -12,7 +12,7 @@ use Wikibase\Lib\Store\EntityContentDataCodec; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\StorageException; use Wikimedia\Assert\Assert; @@ -63,7 +63,7 @@ * * @throws RevisionedUnresolvedRedirectException * @throws StorageException - * @return EntityRevision|null + * @return TheEntityRevision|null */ public function getEntityRevision( EntityId $entityId, @@ -76,7 +76,7 @@ wfDebugLog( __CLASS__, __FUNCTION__ . ': Looking up entity ' . $entityId . " (revision $revisionId)." ); - /** @var EntityRevision $entityRevision */ + /** @var TheEntityRevision $entityRevision */ $entityRevision = null; if ( $revisionId > 0 ) { @@ -163,7 +163,7 @@ $entity = $this->contentCodec->decodeEntity( $blob, $row->rev_content_format ); if ( $entity ) { - $entityRevision = new EntityRevision( $entity, (int)$row->rev_id, $row->rev_timestamp ); + $entityRevision = new TheEntityRevision( $entity, (int)$row->rev_id, $row->rev_timestamp ); $result = [ $entityRevision, null ]; } else { diff --git a/lib/tests/phpunit/EntityRevisionLookupTest.php b/lib/tests/phpunit/EntityRevisionLookupTest.php index ecf2692..253abc8 100644 --- a/lib/tests/phpunit/EntityRevisionLookupTest.php +++ b/lib/tests/phpunit/EntityRevisionLookupTest.php @@ -8,7 +8,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; use Wikibase\Lib\Store\StorageException; @@ -24,24 +24,24 @@ abstract class EntityRevisionLookupTest extends \MediaWikiTestCase { /** - * @return EntityRevision[] + * @return TheEntityRevision[] */ protected function getTestRevisions() { $entities = []; $item = new Item( new ItemId( 'Q42' ) ); - $entities[11] = new EntityRevision( $item, 11, '20130101001100' ); + $entities[11] = new TheEntityRevision( $item, 11, '20130101001100' ); $item = new Item( new ItemId( 'Q42' ) ); $item->setLabel( 'en', "Foo" ); - $entities[12] = new EntityRevision( $item, 12, '20130101001200' ); + $entities[12] = new TheEntityRevision( $item, 12, '20130101001200' ); $prop = Property::newFromType( "string" ); $prop->setId( 753 ); - $entities[13] = new EntityRevision( $prop, 13, '20130101001300' ); + $entities[13] = new TheEntityRevision( $prop, 13, '20130101001300' ); return $entities; } @@ -74,7 +74,7 @@ } /** - * @param EntityRevision[] $entityRevisions + * @param TheEntityRevision[] $entityRevisions * @param EntityRedirect[] $entityRedirects * * @return EntityRevisionLookup @@ -191,7 +191,7 @@ $this->assertEquals( $expected, $result ); $entityRev = $lookup->getEntityRevision( $id ); - $this->assertInstanceOf( EntityRevision::class, $entityRev ); + $this->assertInstanceOf( TheEntityRevision::class, $entityRev ); } public function testGetLatestRevisionForMissing() { diff --git a/lib/tests/phpunit/MockRepository.php b/lib/tests/phpunit/MockRepository.php index 15b338b..6ad526e 100644 --- a/lib/tests/phpunit/MockRepository.php +++ b/lib/tests/phpunit/MockRepository.php @@ -21,7 +21,7 @@ use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException; use Wikibase\DataModel\SiteLink; use Wikibase\DataModel\Term\LabelsProvider; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityInfoBuilderFactory; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; @@ -118,7 +118,7 @@ * * @throws RevisionedUnresolvedRedirectException * @throws StorageException - * @return EntityRevision|null + * @return TheEntityRevision|null */ public function getEntityRevision( EntityId $entityId, @@ -146,7 +146,7 @@ $revisionId = 0; } - /** @var EntityRevision[] $revisions */ + /** @var TheEntityRevision[] $revisions */ $revisions = $this->entities[$key]; if ( $revisionId === 0 ) { @@ -157,7 +157,7 @@ } $revision = $revisions[$revisionId]; - $revision = new EntityRevision( // return a copy! + $revision = new TheEntityRevision( // return a copy! $revision->getEntity()->copy(), // return a copy! $revision->getRevisionId(), $revision->getTimestamp() @@ -229,7 +229,7 @@ * @param User|string|null $user * * @throws StorageException - * @return EntityRevision + * @return TheEntityRevision */ public function putEntity( EntityDocument $entity, $revisionId = 0, $timestamp = 0, $user = null ) { if ( $entity->getId() === null ) { @@ -255,7 +255,7 @@ $this->updateMaxNumericId( $entity->getId() ); $this->maxRevisionId = max( $this->maxRevisionId, $revisionId ); - $revision = new EntityRevision( + $revision = new TheEntityRevision( $entity->copy(), // note: always clone $revisionId, wfTimestamp( TS_MW, $timestamp ) @@ -479,7 +479,7 @@ * * @see WikiPage::doEditContent * - * @return EntityRevision + * @return TheEntityRevision * @throws StorageException */ public function saveEntity( EntityDocument $entity, $summary, User $user, $flags = 0, $baseRevisionId = false ) { @@ -568,7 +568,7 @@ return false; } - /** @var EntityRevision $revision */ + /** @var TheEntityRevision $revision */ foreach ( $this->entities[$key] as $revision ) { if ( $revision->getRevisionId() >= $lastRevisionId ) { if ( isset( $revision->user ) && $revision->user !== $user->getName() ) { diff --git a/lib/tests/phpunit/MockRepositoryTest.php b/lib/tests/phpunit/MockRepositoryTest.php index 759d567..03adf33 100644 --- a/lib/tests/phpunit/MockRepositoryTest.php +++ b/lib/tests/phpunit/MockRepositoryTest.php @@ -10,7 +10,7 @@ use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException; use Wikibase\DataModel\SiteLink; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; use Wikibase\Lib\Store\StorageException; @@ -121,14 +121,14 @@ // test latest item $itemRev = $this->repo->getEntityRevision( $itemId ); $this->assertNotNull( $item, 'Entity ' . $itemId ); - $this->assertInstanceOf( EntityRevision::class, $itemRev, 'Entity ' . $itemId ); + $this->assertInstanceOf( TheEntityRevision::class, $itemRev, 'Entity ' . $itemId ); $this->assertInstanceOf( Item::class, $itemRev->getEntity(), 'Entity ' . $itemId ); $this->assertEquals( 24, $itemRev->getRevisionId() ); // test item by rev id $itemRev = $this->repo->getEntityRevision( $itemId, 23 ); $this->assertNotNull( $item, 'Entity ' . $itemId . '@23' ); - $this->assertInstanceOf( EntityRevision::class, $itemRev, 'Entity ' . $itemId ); + $this->assertInstanceOf( TheEntityRevision::class, $itemRev, 'Entity ' . $itemId ); $this->assertInstanceOf( Item::class, $itemRev->getEntity(), 'Entity ' . $itemId ); $this->assertEquals( 23, $itemRev->getRevisionId() ); $this->assertEquals( '20130101000000', $itemRev->getTimestamp() ); @@ -136,7 +136,7 @@ // test latest prop $propRev = $this->repo->getEntityRevision( $propId ); $this->assertNotNull( $propRev, 'Entity ' . $propId ); - $this->assertInstanceOf( EntityRevision::class, $propRev, 'Entity ' . $propId ); + $this->assertInstanceOf( TheEntityRevision::class, $propRev, 'Entity ' . $propId ); $this->assertInstanceOf( Property::class, $propRev->getEntity(), 'Entity ' . $propId ); } diff --git a/lib/tests/phpunit/Store/CachingEntityRevisionLookupTest.php b/lib/tests/phpunit/Store/CachingEntityRevisionLookupTest.php index 93dd33f..d8a8614 100644 --- a/lib/tests/phpunit/Store/CachingEntityRevisionLookupTest.php +++ b/lib/tests/phpunit/Store/CachingEntityRevisionLookupTest.php @@ -7,7 +7,7 @@ use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Services\Lookup\EntityLookup; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\CachingEntityRevisionLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; @@ -28,7 +28,7 @@ /** * @see EntityLookupTest::newEntityLoader(newEntityLookup * - * @param EntityRevision[] $entityRevisions + * @param TheEntityRevision[] $entityRevisions * @param EntityRedirect[] $entityRedirects * * @return EntityLookup diff --git a/lib/tests/phpunit/Store/DispatchingEntityRevisionLookupTest.php b/lib/tests/phpunit/Store/DispatchingEntityRevisionLookupTest.php index 0c8ebdb..aaabf0a 100644 --- a/lib/tests/phpunit/Store/DispatchingEntityRevisionLookupTest.php +++ b/lib/tests/phpunit/Store/DispatchingEntityRevisionLookupTest.php @@ -4,7 +4,7 @@ use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\DispatchingEntityRevisionLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\StorageException; @@ -35,7 +35,7 @@ $localLookup->expects( $this->any() ) ->method( 'getEntityRevision' ) ->with( $itemId ) - ->willReturn( new EntityRevision( $item, 123 ) ); + ->willReturn( new TheEntityRevision( $item, 123 ) ); $foreignItemId = new ItemId( 'foo:Q303' ); $foreignItem = new Item( $foreignItemId ); @@ -44,7 +44,7 @@ $fooLookup->expects( $this->any() ) ->method( 'getEntityRevision' ) ->with( $foreignItemId ) - ->willReturn( new EntityRevision( $foreignItem, 100 ) ); + ->willReturn( new TheEntityRevision( $foreignItem, 100 ) ); $dispatchingLookup = new DispatchingEntityRevisionLookup( [ '' => $localLookup, 'foo' => $fooLookup, ] diff --git a/lib/tests/phpunit/Store/EntityRevisionTest.php b/lib/tests/phpunit/Store/EntityRevisionTest.php index 8747ea4..7b23e96 100644 --- a/lib/tests/phpunit/Store/EntityRevisionTest.php +++ b/lib/tests/phpunit/Store/EntityRevisionTest.php @@ -5,7 +5,7 @@ use InvalidArgumentException; use PHPUnit_Framework_TestCase; use Wikibase\DataModel\Entity\Item; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; /** * @covers Wikibase\Lib\Store\EntityRevision @@ -20,7 +20,7 @@ public function testMinimalConstructorArguments() { $entity = new Item(); - $revision = new EntityRevision( $entity ); + $revision = new TheEntityRevision( $entity ); $this->assertSame( $entity, $revision->getEntity() ); $this->assertSame( 0, $revision->getRevisionId() ); @@ -29,7 +29,7 @@ public function testAllConstructorArguments() { $entity = new Item(); - $revision = new EntityRevision( $entity, 42, '20150211000000' ); + $revision = new TheEntityRevision( $entity, 42, '20150211000000' ); $this->assertSame( $entity, $revision->getEntity() ); $this->assertSame( 42, $revision->getRevisionId() ); @@ -41,7 +41,7 @@ */ public function testInvalidConstructorArguments( $revisionId, $mwTimestamp ) { $this->setExpectedException( InvalidArgumentException::class ); - new EntityRevision( new Item(), $revisionId, $mwTimestamp ); + new TheEntityRevision( new Item(), $revisionId, $mwTimestamp ); } public function invalidConstructorArgumentsProvider() { diff --git a/lib/tests/phpunit/Store/PrefetchingWikiPageEntityMetaDataAccessorTest.php b/lib/tests/phpunit/Store/PrefetchingWikiPageEntityMetaDataAccessorTest.php index 2059810..9123ae8 100644 --- a/lib/tests/phpunit/Store/PrefetchingWikiPageEntityMetaDataAccessorTest.php +++ b/lib/tests/phpunit/Store/PrefetchingWikiPageEntityMetaDataAccessorTest.php @@ -7,7 +7,7 @@ use Wikibase\DataModel\Entity\EntityRedirect; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor; use Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor; @@ -287,7 +287,7 @@ } public function testEntityUpdated() { - $entityRevision = new EntityRevision( + $entityRevision = new TheEntityRevision( new Item( new ItemId( 'Q1' ) ), 123 ); diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php index f31a55c..bab1d43 100644 --- a/repo/Wikibase.hooks.php +++ b/repo/Wikibase.hooks.php @@ -29,7 +29,7 @@ use Title; use User; use Wikibase\Lib\AutoCommentFormatter; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\Sql\EntityChangeLookup; use Wikibase\Repo\Content\EntityHandler; use Wikibase\Repo\Hooks\InfoActionHookHandler; @@ -213,7 +213,7 @@ $revision->getId() ); } else { - $watcher->entityUpdated( new EntityRevision( + $watcher->entityUpdated( new TheEntityRevision( $content->getEntity(), $revision->getId(), $revision->getTimestamp() diff --git a/repo/includes/Api/EntityLoadingHelper.php b/repo/includes/Api/EntityLoadingHelper.php index 43b8883..5a84a15 100644 --- a/repo/includes/Api/EntityLoadingHelper.php +++ b/repo/includes/Api/EntityLoadingHelper.php @@ -9,7 +9,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\EntityIdParsingException; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\BadRevisionException; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\SiteLinkLookup; @@ -131,7 +131,7 @@ * * @throws ApiUsageException * @throws LogicException - * @return EntityRevision|null + * @return TheEntityRevision|null */ protected function loadEntityRevision( EntityId $entityId, diff --git a/repo/includes/Api/GetEntities.php b/repo/includes/Api/GetEntities.php index c89a41d..15d0308 100644 --- a/repo/includes/Api/GetEntities.php +++ b/repo/includes/Api/GetEntities.php @@ -10,7 +10,7 @@ use Wikibase\DataModel\Services\Entity\EntityPrefetcher; use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\EntityIdParsingException; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\LanguageFallbackChainFactory; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; @@ -239,7 +239,7 @@ * @param EntityId[] $entityIds * @param bool $resolveRedirects * - * @return EntityRevision[] + * @return TheEntityRevision[] */ private function getEntityRevisionsFromEntityIds( array $entityIds, $resolveRedirects = false ) { $revisionArray = []; @@ -260,7 +260,7 @@ * @param EntityId $entityId * @param bool $resolveRedirects * - * @return null|EntityRevision + * @return null|TheEntityRevision */ private function getEntityRevision( EntityId $entityId, $resolveRedirects = false ) { $entityRevision = null; @@ -286,12 +286,12 @@ * Adds the given EntityRevision to the API result. * * @param string|null $sourceEntityId - * @param EntityRevision|null $entityRevision + * @param TheEntityRevision|null $entityRevision * @param array $params */ private function handleEntity( $sourceEntityId, - EntityRevision $entityRevision = null, + TheEntityRevision $entityRevision = null, array $params = [] ) { if ( $entityRevision === null ) { diff --git a/repo/includes/Api/MergeItems.php b/repo/includes/Api/MergeItems.php index 96a55b9..bf8d2c5 100644 --- a/repo/includes/Api/MergeItems.php +++ b/repo/includes/Api/MergeItems.php @@ -12,7 +12,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\EntityIdParsingException; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Repo\Interactors\ItemMergeException; use Wikibase\Repo\Interactors\ItemMergeInteractor; use Wikibase\Repo\Interactors\RedirectCreationException; @@ -155,7 +155,7 @@ } } - private function addEntityToOutput( EntityRevision $entityRevision, $name ) { + private function addEntityToOutput( TheEntityRevision $entityRevision, $name ) { $entityId = $entityRevision->getEntity()->getId(); $revisionId = $entityRevision->getRevisionId(); diff --git a/repo/includes/Api/ResultBuilder.php b/repo/includes/Api/ResultBuilder.php index 9f5e86e..433fb5b 100644 --- a/repo/includes/Api/ResultBuilder.php +++ b/repo/includes/Api/ResultBuilder.php @@ -17,7 +17,7 @@ use Wikibase\DataModel\Statement\StatementList; use Wikibase\DataModel\Term\AliasGroupList; use Wikibase\DataModel\Term\TermList; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\LanguageFallbackChain; use Wikibase\Lib\Serialization\CallbackFactory; use Wikibase\Lib\Serialization\SerializationModifier; @@ -252,7 +252,7 @@ * Used as the key for the entity in the 'entities' structure and for adding redirect * info Will default to the entity's serialized ID if null. If given this must be the * entity id before any redirects were resolved. - * @param EntityRevision $entityRevision + * @param TheEntityRevision $entityRevision * @param string[]|string $props a list of fields to include, or "all" * @param string[]|null $filterSiteIds A list of site IDs to filter by * @param string[] $filterLangCodes A list of language codes to filter by @@ -260,7 +260,7 @@ */ public function addEntityRevision( $sourceEntityIdSerialization, - EntityRevision $entityRevision, + TheEntityRevision $entityRevision, $props = 'all', array $filterSiteIds = null, array $filterLangCodes = [], @@ -1080,7 +1080,7 @@ private function getRevisionId( $revision ) { if ( $revision instanceof Revision ) { $revisionId = $revision->getId(); - } elseif ( $revision instanceof EntityRevision ) { + } elseif ( $revision instanceof TheEntityRevision ) { $revisionId = $revision->getRevisionId(); } diff --git a/repo/includes/Content/EntityContent.php b/repo/includes/Content/EntityContent.php index 7464ed2..a81807c 100644 --- a/repo/includes/Content/EntityContent.php +++ b/repo/includes/Content/EntityContent.php @@ -27,7 +27,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityRedirect; use Wikibase\DataModel\Term\DescriptionsProvider; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Repo\Content\EntityContentDiff; use Wikibase\Repo\Content\EntityHandler; use Wikibase\Repo\FingerprintSearchTextGenerator; @@ -284,19 +284,19 @@ /** * @param int|null $revisionId * - * @return EntityRevision + * @return TheEntityRevision */ private function getEntityRevision( $revisionId = null ) { $entity = $this->getEntity(); if ( $revisionId !== null ) { - return new EntityRevision( $entity, $revisionId ); + return new TheEntityRevision( $entity, $revisionId ); } // Revision defaults to 0 (latest), which is desired and suitable in cases where // getParserOutput specifies no revision. (e.g. is called during save process // when revision id is unknown or not assigned yet) - return new EntityRevision( $entity ); + return new TheEntityRevision( $entity ); } /** diff --git a/repo/includes/EditEntity.php b/repo/includes/EditEntity.php index 5b1306f..5aead7a 100644 --- a/repo/includes/EditEntity.php +++ b/repo/includes/EditEntity.php @@ -13,7 +13,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Services\Diff\EntityDiffer; use Wikibase\DataModel\Services\Diff\EntityPatcher; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Repo\Store\EntityTitleStoreLookup; @@ -70,7 +70,7 @@ private $entityId = null; /** - * @var EntityRevision|null + * @var TheEntityRevision|null */ private $baseRev = null; @@ -80,7 +80,7 @@ private $baseRevId; /** - * @var EntityRevision|null + * @var TheEntityRevision|null */ private $latestRev = null; @@ -242,7 +242,7 @@ /** * Returns the latest revision of the entity. * - * @return EntityRevision|null + * @return TheEntityRevision|null */ public function getLatestRevision() { if ( $this->latestRev === null ) { @@ -315,7 +315,7 @@ * the constructor, this returns the latest revision. If the entity does not exist * yet, this returns null. * - * @return EntityRevision|null + * @return TheEntityRevision|null * @throws MWException */ public function getBaseRevision() { diff --git a/repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php b/repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php index 9a3b192..b40141d 100644 --- a/repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php +++ b/repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php @@ -7,7 +7,7 @@ use Wikibase\DataModel\Entity\EntityDocument; use Wikibase\DataModel\Entity\EntityId; use Wikibase\EntityFactory; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\ContentLanguages; use Wikibase\Lib\LanguageNameLookup; use Wikibase\Lib\Store\EntityRevisionLookup; @@ -188,7 +188,7 @@ // The parser cache content is too old to contain the terms list items // Pass the correct entity to generate terms list items on the fly $entityRev = $this->entityRevisionLookup->getEntityRevision( $entityId, $revisionId ); - if ( !( $entityRev instanceof EntityRevision ) ) { + if ( !( $entityRev instanceof TheEntityRevision ) ) { return null; } $entity = $entityRev->getEntity(); diff --git a/repo/includes/LinkedData/EntityDataRequestHandler.php b/repo/includes/LinkedData/EntityDataRequestHandler.php index e9b3fb5..53fbc1a 100644 --- a/repo/includes/LinkedData/EntityDataRequestHandler.php +++ b/repo/includes/LinkedData/EntityDataRequestHandler.php @@ -13,7 +13,7 @@ use Wikibase\DataModel\Entity\EntityIdParsingException; use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup; use Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\BadRevisionException; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityTitleLookup; @@ -420,7 +420,7 @@ $flavor = $request->getVal( "flavor" ); - /** @var EntityRevision $entityRevision */ + /** @var TheEntityRevision $entityRevision */ /** @var RedirectRevision $followedRedirectRevision */ list( $entityRevision, $followedRedirectRevision ) = $this->getEntityRevision( $id, $revision ); diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php b/repo/includes/LinkedData/EntityDataSerializationService.php index 9d1598c..02ba28b 100644 --- a/repo/includes/LinkedData/EntityDataSerializationService.php +++ b/repo/includes/LinkedData/EntityDataSerializationService.php @@ -18,7 +18,7 @@ use Wikibase\DataModel\SerializerFactory; use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Rdf\EntityRdfBuilderFactory; use Wikibase\Rdf\ValueSnakRdfBuilderFactory; @@ -138,7 +138,7 @@ * Output entity data. * * @param string $format The name (mime type of file extension) of the format to use - * @param EntityRevision $entityRevision The entity + * @param TheEntityRevision $entityRevision The entity * @param RedirectRevision|null $followedRedirect The redirect that led to the entity, or null * @param EntityId[] $incomingRedirects Incoming redirects to include in the output * @param string|null $flavor The type of the output provided by serializer @@ -148,7 +148,7 @@ */ public function getSerializedData( $format, - EntityRevision $entityRevision, + TheEntityRevision $entityRevision, RedirectRevision $followedRedirect = null, array $incomingRedirects = [], $flavor = null @@ -182,7 +182,7 @@ } /** - * @param EntityRevision $entityRevision + * @param TheEntityRevision $entityRevision * @param RedirectRevision|null $followedRedirect a redirect leading to the entity for use in the output * @param EntityId[] $incomingRedirects Incoming redirects to include in the output * @param RdfBuilder $rdfBuilder @@ -191,7 +191,7 @@ * @return string RDF */ private function rdfSerialize( - EntityRevision $entityRevision, + TheEntityRevision $entityRevision, RedirectRevision $followedRedirect = null, array $incomingRedirects, RdfBuilder $rdfBuilder, @@ -385,14 +385,14 @@ * result, if $printer was generated from that same ApiMain module, as * createApiPrinter() does. * - * @param EntityRevision $entityRevision The entity to convert ot an ApiResult + * @param TheEntityRevision $entityRevision The entity to convert ot an ApiResult * @param ApiFormatBase $printer The output printer that will be used for serialization. * Used to provide context for generating the ApiResult, and may also be manipulated * to fine-tune the output. * * @return ApiResult */ - private function generateApiResult( EntityRevision $entityRevision, ApiFormatBase $printer ) { + private function generateApiResult( TheEntityRevision $entityRevision, ApiFormatBase $printer ) { $res = $printer->getResult(); // Make sure result is empty. May still be full if this @@ -420,13 +420,13 @@ * representation of data entities. Using the ContentHandler to serialize the entity would * expose internal implementation details. * - * @param EntityRevision $entityRevision the entity to output. + * @param TheEntityRevision $entityRevision the entity to output. * @param ApiFormatBase $printer the printer to use to generate the output * * @return string the serialized data */ private function getApiSerialization( - EntityRevision $entityRevision, + TheEntityRevision $entityRevision, ApiFormatBase $printer ) { // NOTE: The way the ApiResult is provided to $printer is somewhat diff --git a/repo/includes/Specials/SpecialMergeItems.php b/repo/includes/Specials/SpecialMergeItems.php index 600b94a..0107956 100644 --- a/repo/includes/Specials/SpecialMergeItems.php +++ b/repo/includes/Specials/SpecialMergeItems.php @@ -9,7 +9,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\EntityIdParsingException; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; use Wikibase\Lib\UserInputException; @@ -175,8 +175,8 @@ $fromTitle = $this->titleLookup->getTitleForId( $fromId ); $toTitle = $this->titleLookup->getTitleForId( $toId ); - /** @var EntityRevision $newRevisionFrom */ - /** @var EntityRevision $newRevisionTo */ + /** @var TheEntityRevision $newRevisionFrom */ + /** @var TheEntityRevision $newRevisionTo */ list( $newRevisionFrom, $newRevisionTo, ) = $this->interactor->mergeItems( $fromId, $toId, $ignoreConflicts, $summary ); diff --git a/repo/includes/Specials/SpecialModifyEntity.php b/repo/includes/Specials/SpecialModifyEntity.php index c26a165..a5e0b18 100644 --- a/repo/includes/Specials/SpecialModifyEntity.php +++ b/repo/includes/Specials/SpecialModifyEntity.php @@ -12,7 +12,7 @@ use Wikibase\Repo\ChangeOp\ChangeOpValidationException; use Wikibase\DataModel\Entity\EntityDocument; use Wikibase\EditEntityFactory; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\MessageException; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; @@ -87,7 +87,7 @@ * * @throws UserInputException * - * @return EntityRevision + * @return TheEntityRevision */ protected function getBaseRevision() { $id = $this->getEntityId(); @@ -123,7 +123,7 @@ * * @throws UserInputException * - * @return null|EntityRevision + * @return null|TheEntityRevision */ protected function getLatestRevision() { $id = $this->getEntityId(); diff --git a/repo/includes/Store/DispatchingEntityStoreWatcher.php b/repo/includes/Store/DispatchingEntityStoreWatcher.php index a542e9f..b7535db 100644 --- a/repo/includes/Store/DispatchingEntityStoreWatcher.php +++ b/repo/includes/Store/DispatchingEntityStoreWatcher.php @@ -4,7 +4,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityRedirect; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityStoreWatcher; use Wikibase\Repo\GenericEventDispatcher; @@ -23,9 +23,9 @@ /** * @see EntityStoreWatcher::entityUpdated * - * @param EntityRevision $entityRevision + * @param TheEntityRevision $entityRevision */ - public function entityUpdated( EntityRevision $entityRevision ) { + public function entityUpdated( TheEntityRevision $entityRevision ) { $this->dispatch( 'entityUpdated', $entityRevision ); } diff --git a/repo/includes/Store/Sql/WikiPageEntityStore.php b/repo/includes/Store/Sql/WikiPageEntityStore.php index 4465678..0597c2d 100644 --- a/repo/includes/Store/Sql/WikiPageEntityStore.php +++ b/repo/includes/Store/Sql/WikiPageEntityStore.php @@ -13,7 +13,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityRedirect; use Wikibase\EntityContent; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\IdGenerator; use Wikibase\Lib\EntityIdComposer; use Wikibase\Lib\Store\EntityStore; @@ -166,7 +166,7 @@ * * @throws InvalidArgumentException * @throws StorageException - * @return EntityRevision + * @return TheEntityRevision */ public function saveEntity( EntityDocument $entity, @@ -188,7 +188,7 @@ $content = $this->contentFactory->newFromEntity( $entity ); $revision = $this->saveEntityContent( $content, $summary, $user, $flags, $baseRevId ); - $entityRevision = new EntityRevision( + $entityRevision = new TheEntityRevision( $entity, $revision->getId(), $revision->getTimestamp() diff --git a/repo/tests/phpunit/includes/Actions/ActionTestCase.php b/repo/tests/phpunit/includes/Actions/ActionTestCase.php index 19ccd39..5344b32 100644 --- a/repo/tests/phpunit/includes/Actions/ActionTestCase.php +++ b/repo/tests/phpunit/includes/Actions/ActionTestCase.php @@ -16,7 +16,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityRedirect; use Wikibase\DataModel\Entity\Item; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\ItemContent; use Wikibase\Repo\WikibaseRepo; use WikiPage; @@ -260,7 +260,7 @@ private function createTestContent( $handle, array $revisions ) { global $wgUser; - /** @var EntityRevision $rev */ + /** @var TheEntityRevision $rev */ $id = null; $result = null; diff --git a/repo/tests/phpunit/includes/Api/ApiFormatTestCase.php b/repo/tests/phpunit/includes/Api/ApiFormatTestCase.php index 320279f..92779f6 100644 --- a/repo/tests/phpunit/includes/Api/ApiFormatTestCase.php +++ b/repo/tests/phpunit/includes/Api/ApiFormatTestCase.php @@ -8,7 +8,7 @@ use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Snak\PropertyNoValueSnak; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Repo\WikibaseRepo; /** @@ -94,7 +94,7 @@ return $entityRevision; } - private function storePresetDataInStatement( EntityRevision $entityRevision, PropertyId $propertyId ) { + private function storePresetDataInStatement( TheEntityRevision $entityRevision, PropertyId $propertyId ) { global $wgUser; $store = WikibaseRepo::getDefaultInstance()->getEntityStore(); diff --git a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php index b53cdf9..60feb2b 100644 --- a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php +++ b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php @@ -10,7 +10,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\ItemIdParser; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\BadRevisionException; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\SiteLinkLookup; @@ -50,14 +50,14 @@ /** * @param EntityId|null $entityId Entity ID getEntityRevision() should expect. - * @param EntityRevision|null $entityRevision The EntityRevision getEntityRevision() should return. + * @param TheEntityRevision|null $entityRevision The EntityRevision getEntityRevision() should return. * @param Exception|null $exception The Exception getEntityRevision() should throw. * * @return EntityRevisionLookup|PHPUnit_Framework_MockObject_MockObject */ protected function getMockEntityRevisionLookup( EntityId $entityId = null, - EntityRevision $entityRevision = null, + TheEntityRevision $entityRevision = null, Exception $exception = null ) { $mock = $this->getMock( EntityRevisionLookup::class ); @@ -119,12 +119,12 @@ } /** - * @return EntityRevision|PHPUnit_Framework_MockObject_MockObject + * @return TheEntityRevision|PHPUnit_Framework_MockObject_MockObject */ protected function getMockRevision() { $entity = $this->getMock( EntityDocument::class ); - $revision = $this->getMockBuilder( EntityRevision::class ) + $revision = $this->getMockBuilder( TheEntityRevision::class ) ->disableOriginalConstructor() ->getMock(); diff --git a/repo/tests/phpunit/includes/Api/ResultBuilderTest.php b/repo/tests/phpunit/includes/Api/ResultBuilderTest.php index f79e7be..dac698e 100644 --- a/repo/tests/phpunit/includes/Api/ResultBuilderTest.php +++ b/repo/tests/phpunit/includes/Api/ResultBuilderTest.php @@ -28,7 +28,7 @@ use Wikibase\DataModel\Term\AliasGroupList; use Wikibase\DataModel\Term\Term; use Wikibase\DataModel\Term\TermList; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\LanguageFallbackChainFactory; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Repo\Api\ResultBuilder; @@ -385,7 +385,7 @@ $guid = 'imaguid'; $item->getStatements()->addNewStatement( $snak, $qualifiers, $references, $guid ); - $entityRevision = new EntityRevision( $item, 33, '20131126202923' ); + $entityRevision = new TheEntityRevision( $item, 33, '20131126202923' ); $resultBuilder = $this->getResultBuilder( $result, $addMetaData ); $resultBuilder->addEntityRevision( 'Q1230000', $entityRevision ); @@ -398,7 +398,7 @@ public function testAddEntityRevisionKey() { $item = new Item( new ItemId( 'Q11' ) ); - $entityRevision = new EntityRevision( $item, 33, '20131126202923' ); + $entityRevision = new TheEntityRevision( $item, 33, '20131126202923' ); $props = []; $result = $this->getDefaultResult(); @@ -497,7 +497,7 @@ $item->getFingerprint()->setLabel( 'en', 'Oslo-en' ); $item->getFingerprint()->setDescription( 'es', 'desc-es' ); $item->getFingerprint()->setDescription( 'zh-sg', 'desc-zh-sg' ); - $entityRevision = new EntityRevision( $item ); + $entityRevision = new TheEntityRevision( $item ); $fallbackChainFactory = new LanguageFallbackChainFactory(); $fallbackMode = LanguageFallbackChainFactory::FALLBACK_ALL; @@ -533,7 +533,7 @@ $item->setDescription( 'de', 'text' ); $item->setAliases( 'en', [ 'text' ] ); $item->setAliases( 'de', [ 'text' ] ); - $entityRevision = new EntityRevision( $item ); + $entityRevision = new TheEntityRevision( $item ); $result = $this->getDefaultResult(); $resultBuilder = $this->getResultBuilder( $result ); @@ -585,7 +585,7 @@ $item = new Item( new ItemId( 'Q123099' ) ); $item->getSiteLinkList()->addNewSiteLink( 'enwiki', 'Berlin' ); $item->getSiteLinkList()->addNewSiteLink( 'dewiki', 'Berlin' ); - $entityRevision = new EntityRevision( $item ); + $entityRevision = new TheEntityRevision( $item ); $props = [ 'sitelinks' ]; $siteIds = [ 'enwiki' ]; @@ -624,7 +624,7 @@ $item = new Item( new ItemId( 'Q123100' ) ); $item->getSiteLinkList()->addNewSiteLink( 'enwiki', 'Berlin' ); $item->getSiteLinkList()->addNewSiteLink( 'dewiki', 'Berlin' ); - $entityRevision = new EntityRevision( $item ); + $entityRevision = new TheEntityRevision( $item ); $props = [ 'sitelinks' ]; $siteIds = [ 'enwiki' ]; diff --git a/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php b/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php index 58a8114..0aed836 100644 --- a/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php +++ b/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php @@ -15,7 +15,7 @@ use Wikibase\DataModel\Services\Entity\NullEntityPrefetcher; use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Dumpers\RdfDumpGenerator; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; @@ -189,7 +189,7 @@ if ( !$entity ) { return null; } - return new EntityRevision( $entity, 12, wfTimestamp( TS_MW, 1000000 ) ); + return new TheEntityRevision( $entity, 12, wfTimestamp( TS_MW, 1000000 ) ); } ) ); diff --git a/repo/tests/phpunit/includes/Hooks/OutputPageBeforeHTMLHookHandlerTest.php b/repo/tests/phpunit/includes/Hooks/OutputPageBeforeHTMLHookHandlerTest.php index b113ff5..56ade9f 100644 --- a/repo/tests/phpunit/includes/Hooks/OutputPageBeforeHTMLHookHandlerTest.php +++ b/repo/tests/phpunit/includes/Hooks/OutputPageBeforeHTMLHookHandlerTest.php @@ -10,7 +10,7 @@ use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\Item; use Wikibase\EntityFactory; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\LanguageNameLookup; use Wikibase\Lib\StaticContentLanguages; use Wikibase\Lib\Store\EntityRevisionLookup; @@ -66,7 +66,7 @@ $entityRevisionLookup = $this->getMock( EntityRevisionLookup::class ); $entityRevisionLookup->expects( $this->once() ) ->method( 'getEntityRevision' ) - ->will( $this->returnValue( new EntityRevision( new Item( $itemId ) ) ) ); + ->will( $this->returnValue( new TheEntityRevision( new Item( $itemId ) ) ) ); $outputPageBeforeHTMLHookHandler = new OutputPageBeforeHTMLHookHandler( TemplateFactory::getDefaultInstance(), diff --git a/repo/tests/phpunit/includes/ItemMoveTest.php b/repo/tests/phpunit/includes/ItemMoveTest.php index a2199cd..4577922 100644 --- a/repo/tests/phpunit/includes/ItemMoveTest.php +++ b/repo/tests/phpunit/includes/ItemMoveTest.php @@ -7,7 +7,7 @@ use Title; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Repo\WikibaseRepo; use WikiPage; use WikitextContent; @@ -28,7 +28,7 @@ //@todo: make this a baseclass to use with all types of entities. /** - * @var EntityRevision + * @var TheEntityRevision */ protected $entityRevision; diff --git a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php index 2de0537..ac53aa4 100644 --- a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php +++ b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php @@ -16,7 +16,7 @@ use Wikibase\DataModel\SerializerFactory; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\DataModel\Snak\PropertyValueSnak; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Tests\MockRepository; use Wikibase\Rdf\RdfVocabulary; @@ -323,7 +323,7 @@ */ public function testGetSerializedData( $format, - EntityRevision $entityRev, + TheEntityRevision $entityRev, RedirectRevision $followedRedirect = null, array $incomingRedirects, $flavor, diff --git a/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php b/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php index f335d46..105f7ea 100644 --- a/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php +++ b/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php @@ -5,7 +5,7 @@ use Wikibase\DataModel\Entity\EntityRedirect; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Tests\MockRepository; /** @@ -19,13 +19,13 @@ class EntityDataTestProvider { /** - * @return EntityRevision[] + * @return TheEntityRevision[] */ public static function getEntityRevisions() { $item = new Item( new ItemId( 'Q42' ) ); $item->setLabel( 'en', 'Raarrr!' ); - $itemRev = new EntityRevision( $item, 4242, '20131211100908' ); + $itemRev = new TheEntityRevision( $item, 4242, '20131211100908' ); return [ $itemRev ]; } diff --git a/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php b/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php index bd5444b..f3dec05 100644 --- a/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php +++ b/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php @@ -9,7 +9,7 @@ use User; use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; use Wikibase\Lib\Store\StorageException; @@ -39,7 +39,7 @@ $this->isInstanceOf( User::class ), EDIT_UPDATE, 6789 ) - ->will( $this->returnValue( new EntityRevision( $expectedProperty, 6790 ) ) ); + ->will( $this->returnValue( new TheEntityRevision( $expectedProperty, 6790 ) ) ); $propertyDataTypeChanger = $this->getPropertyDataTypeChanger( $entityStore ); $propertyDataTypeChanger->changeDataType( $propertyId, $this->getMock( User::class ), 'shinydata' ); @@ -114,7 +114,7 @@ 'rustydata' ); - return new EntityRevision( $property, 6789, '20151015195144' ); + return new TheEntityRevision( $property, 6789, '20151015195144' ); } else { return null; } diff --git a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php index cbbf448..4600d40 100644 --- a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php +++ b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php @@ -8,7 +8,7 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityNamespaceLookup; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup; @@ -32,7 +32,7 @@ class WikiPageEntityMetaDataLookupTest extends MediaWikiTestCase { /** - * @var EntityRevision[] + * @var TheEntityRevision[] */ private $data = []; diff --git a/repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php b/repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php index f8c6783..1c68128 100644 --- a/repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php +++ b/repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php @@ -6,7 +6,7 @@ use Wikibase\DataModel\Entity\EntityRedirect; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Services\Lookup\EntityLookup; -use Wikibase\Lib\Store\EntityRevision; +use Wikibase\Lib\Store\EntityRevision as TheEntityRevision; use Wikibase\Lib\Store\EntityContentDataCodec; use Wikibase\Lib\Store\EntityNamespaceLookup; use Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup; @@ -30,7 +30,7 @@ class WikiPageEntityRevisionLookupTest extends EntityRevisionLookupTest { /** - * @var EntityRevision[] + * @var TheEntityRevision[] */ private static $testEntities = []; @@ -55,7 +55,7 @@ /** * @see EntityLookupTest::newEntityLoader(newEntityLookup * - * @param EntityRevision[] $entityRevisions + * @param TheEntityRevision[] $entityRevisions * @param EntityRedirect[] $entityRedirects * * @return EntityLookup -- To view, visit https://gerrit.wikimedia.org/r/370949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3839fff8d8bf21391e50a3f6dfd964ab5e4a4edd Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: WMDE-leszek <leszek.mani...@wikimedia.de> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: WMDE-leszek <leszek.mani...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits