From 096eba5a54dfca1d728aa582e5b4c6c5b6f53ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiemo=20M=C3=A4ttig?= Date: Mon, 13 Feb 2017 14:47:57 +0100 Subject: [PATCH] Release 7.0.0 --- RELEASE-NOTES.md | 39 +++++++++++++++++++++++++++++---- WikibaseDataModel.php | 2 +- composer.json | 6 ++--- mediawiki-extension.json | 2 +- src/Entity/EntityIdValue.php | 2 +- src/Entity/ItemId.php | 4 ++++ src/Entity/PropertyId.php | 4 ++++ src/Snak/PropertyValueSnak.php | 2 +- src/Snak/SnakObject.php | 2 +- src/Statement/StatementList.php | 2 +- src/Term/AliasGroupList.php | 2 +- src/Term/TermList.php | 2 +- 12 files changed, 54 insertions(+), 15 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 2b3e968a..d9db67e5 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,21 +1,52 @@ # Wikibase DataModel release notes -## Version 7.0.0 (dev) - -* Removed `FingerprintHolder` +## Version 7.0.0 (2017-03-15) + +This release adds support for custom entity types to `EntityIdValue`, and thus changes the hashes of +snaks, qualifiers, and references. + +* Changed the internal `serialize()` format of several `EntityId` related classes. In all cases + `unserialize()` still supports the previous format. + * Serialization of `SnakObject` (includes `PropertyNoValueSnak` and `PropertySomeValueSnak`) + does not use numeric IDs any more + * Serialization of `PropertyValueSnak` (includes `DerivedPropertyValueSnak`) does not use + numeric IDs any more + * Serialization of `EntityIdValue` does not use numeric IDs any more + * `EntityIdValue` can now serialize and unserialize `EntityId`s other than `ItemId` and + `PropertyId` + * Minimized serialization of `ItemId` and `PropertyId` to not include the entity type any more + +#### Other breaking changes + +* Removed `FingerprintHolder`. Use `TermList::clear` and `AliasGroupList::clear` instead. `Item` and + `Property` also still implement `setFingerprint`. * Removed class aliases deprecated since 3.0: * `Wikibase\DataModel\Claim\Claim` * `Wikibase\DataModel\Claim\ClaimGuid` * `Wikibase\DataModel\StatementListProvider` +* Added a `SnakList` constructor that is not compatible with the `ArrayList` constructor any more, + and does not accept null any more. +* Removed `HashArray::equals`, and `HashArray` does not implement `Comparable` any more +* Removed `HashArray::getHash`, and `HashArray` does not implement `Hashable` any more * Removed `HashArray::rebuildIndices` * Removed `HashArray::indicesAreUpToDate` * Removed `HashArray::removeDuplicates` * Removed `$acceptDuplicates` feature from `HashArray` + +#### Additions + * Added `clear` to `TermList`, `AliasGroupList` and `StatementList` +* Added `newFromRepositoryAndNumber` to `ItemId` and `PropertyId` + +#### Other changes + +* Fixed `ReferenceList::addReference` sometimes moving existing references around +* Fixed exceptions in `DispatchingEntityIdParser` and `ItemIdParser` not forwarding the previous + exception ## Version 6.3.1 (2016-11-30) -* `ItemId::getNumericId` and `PropertyId::getNumericId` no longer throw exceptions for foreign ids +* `ItemId::getNumericId` and `PropertyId::getNumericId` no longer throw exceptions for foreign IDs ## Version 6.3.0 (2016-11-03) diff --git a/WikibaseDataModel.php b/WikibaseDataModel.php index beb9749c..d3f6b0e4 100644 --- a/WikibaseDataModel.php +++ b/WikibaseDataModel.php @@ -11,7 +11,7 @@ return; } -define( 'WIKIBASE_DATAMODEL_VERSION', '6.3.0' ); +define( 'WIKIBASE_DATAMODEL_VERSION', '7.0.0' ); if ( defined( 'MEDIAWIKI' ) && function_exists( 'wfLoadExtension' ) ) { wfLoadExtension( 'WikibaseDataModel', __DIR__ . '/mediawiki-extension.json' ); diff --git a/composer.json b/composer.json index a59d8f78..fe424cf7 100644 --- a/composer.json +++ b/composer.json @@ -28,10 +28,10 @@ "wikimedia/assert": "~0.2.2" }, "require-dev": { - "phpunit/phpunit": "~4.8", "ockcyp/covers-validator": "~0.4.0", - "squizlabs/php_codesniffer": "~2.3", - "phpmd/phpmd": "~2.3" + "phpmd/phpmd": "~2.3", + "phpunit/phpunit": "~4.8", + "squizlabs/php_codesniffer": "~2.3" }, "autoload": { "files" : [ diff --git a/mediawiki-extension.json b/mediawiki-extension.json index 6cc08219..2145d9b8 100644 --- a/mediawiki-extension.json +++ b/mediawiki-extension.json @@ -1,6 +1,6 @@ { "name": "Wikibase DataModel", - "version": "6.3.0", + "version": "7.0.0", "author": [ "[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]", "Thiemo Mättig" diff --git a/src/Entity/EntityIdValue.php b/src/Entity/EntityIdValue.php index 93129d27..71815502 100644 --- a/src/Entity/EntityIdValue.php +++ b/src/Entity/EntityIdValue.php @@ -25,7 +25,7 @@ public function __construct( EntityId $entityId ) { /** * @see Serializable::serialize * - * @since 0.5 + * @since 7.0 serialization format changed in an incompatible way * * @return string */ diff --git a/src/Entity/ItemId.php b/src/Entity/ItemId.php index e715804b..01a2200d 100644 --- a/src/Entity/ItemId.php +++ b/src/Entity/ItemId.php @@ -67,6 +67,8 @@ public function getEntityType() { /** * @see Serializable::serialize * + * @since 7.0 serialization format changed in an incompatible way + * * @return string */ public function serialize() { @@ -106,6 +108,8 @@ public static function newFromNumber( $numericId ) { /** * CAUTION: Use the full string serialization whenever you can and avoid using numeric IDs. * + * @since 7.0 + * * @param string $repositoryName * @param int|float|string $numericId * diff --git a/src/Entity/PropertyId.php b/src/Entity/PropertyId.php index 1ea69f46..bd7e3d59 100644 --- a/src/Entity/PropertyId.php +++ b/src/Entity/PropertyId.php @@ -67,6 +67,8 @@ public function getEntityType() { /** * @see Serializable::serialize * + * @since 7.0 serialization format changed in an incompatible way + * * @return string */ public function serialize() { @@ -106,6 +108,8 @@ public static function newFromNumber( $numericId ) { /** * CAUTION: Use the full string serialization whenever you can and avoid using numeric IDs. * + * @since 7.0 + * * @param string $repositoryName * @param int|float|string $numericId * diff --git a/src/Snak/PropertyValueSnak.php b/src/Snak/PropertyValueSnak.php index b4bdbe58..206377d0 100644 --- a/src/Snak/PropertyValueSnak.php +++ b/src/Snak/PropertyValueSnak.php @@ -48,7 +48,7 @@ public function getDataValue() { /** * @see Serializable::serialize * - * @since 7.0 + * @since 7.0 serialization format changed in an incompatible way * * @return string */ diff --git a/src/Snak/SnakObject.php b/src/Snak/SnakObject.php index cfe78ded..9f1a72a2 100644 --- a/src/Snak/SnakObject.php +++ b/src/Snak/SnakObject.php @@ -97,7 +97,7 @@ public function equals( $target ) { /** * @see Serializable::serialize * - * @since 7.0 + * @since 7.0 serialization format changed in an incompatible way * * @return string */ diff --git a/src/Statement/StatementList.php b/src/Statement/StatementList.php index ea79ef69..18fa92ad 100644 --- a/src/Statement/StatementList.php +++ b/src/Statement/StatementList.php @@ -344,7 +344,7 @@ public function filter( StatementFilter $filter ) { /** * Removes all statements from this list. * - * @since 6.0 + * @since 7.0 */ public function clear() { $this->statements = []; diff --git a/src/Term/AliasGroupList.php b/src/Term/AliasGroupList.php index 33cc8eb0..0d8d8638 100644 --- a/src/Term/AliasGroupList.php +++ b/src/Term/AliasGroupList.php @@ -207,7 +207,7 @@ public function toTextArray() { /** * Removes all alias groups from this list. * - * @since 6.0 + * @since 7.0 */ public function clear() { $this->groups = []; diff --git a/src/Term/TermList.php b/src/Term/TermList.php index 4f6b0fa8..5c3af3d8 100644 --- a/src/Term/TermList.php +++ b/src/Term/TermList.php @@ -190,7 +190,7 @@ public function hasTerm( Term $term ) { /** * Removes all terms from this list. * - * @since 6.0 + * @since 7.0 */ public function clear() { $this->terms = [];