Skip to content

Commit

Permalink
Merge pull request #841 from wmde/update_data_values
Browse files Browse the repository at this point in the history
Update data-values to 3.0 and prepare for release
  • Loading branch information
chukarave authored Mar 31, 2021
2 parents 1e096d8 + 0d5d4e4 commit f02f536
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 58 deletions.
4 changes: 3 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wikibase DataModel release notes

## Version 9.6.0 (development)
## Version 9.6.0

* `ReferenceList::addNewReference()`, `Statement::addNewReference()` and the `StatementList` constructor
supported being called with a variadic argument list, with a single array argument,
Expand All @@ -10,6 +10,8 @@
for instance, change `->addNewReference( [ $x, $y ] )` to `->addNewReference( $x, $y )`,
and `->addNewReference( $snaks )` to `->addNewReference( ...$snaks )`.
* `Statement`, `Reference`, `SnakList` and `Snak` no longer implement the `Hashable` and `Immutable` interfaces from `DataValues/DataValues`.
* Removed usages of the `Comparable` interface
* Made the library installable together with DataValues 3.x

## Version 9.5.1 (2020-06-03)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"require": {
"php": "^8.0|^7.1",
"data-values/data-values": "~0.1|~1.0|~2.0",
"data-values/data-values": "~0.1|~1.0|~2.0|~3.0",
"wikimedia/assert": "~0.2.2|~0.3.0|~0.4.0|~0.5.0"
},
"require-dev": {
Expand Down
4 changes: 1 addition & 3 deletions src/Entity/EntityDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel\Entity;

use Comparable;
use InvalidArgumentException;

/**
Expand All @@ -15,7 +14,7 @@
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
* @author Bene* < benestar.wikimedia@gmail.com >
*/
interface EntityDocument extends Comparable {
interface EntityDocument {

/**
* Returns a type identifier for the entity, e.g. "item" or "property".
Expand Down Expand Up @@ -60,7 +59,6 @@ public function setId( $id );
public function isEmpty();

/**
* @see Comparable::equals
*
* Two entities are considered equal if they are of the same type and have the same value. The
* value does not include the id, so entities with the same value but different id are
Expand Down
4 changes: 1 addition & 3 deletions src/Entity/EntityId.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel\Entity;

use Comparable;
use InvalidArgumentException;
use Serializable;

Expand All @@ -12,7 +11,7 @@
*
* @license GPL-2.0-or-later
*/
abstract class EntityId implements Comparable, Serializable {
abstract class EntityId implements Serializable {

protected $serialization;

Expand Down Expand Up @@ -195,7 +194,6 @@ public function __toString() {
}

/**
* @see Comparable::equals
*
* @since 0.5
*
Expand Down
3 changes: 2 additions & 1 deletion src/Entity/EntityIdValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public static function getType() {
}

/**
* @see DataValue::getSortKey
* @deprecated Kept for compatibility with older DataValues versions.
* Do not use.
*
* @return string|float|int
*/
Expand Down
3 changes: 1 addition & 2 deletions src/Entity/ItemIdSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Wikibase\DataModel\Entity;

use ArrayIterator;
use Comparable;
use Countable;
use InvalidArgumentException;
use IteratorAggregate;
Expand All @@ -17,7 +16,7 @@
* @license GPL-2.0-or-later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class ItemIdSet implements IteratorAggregate, Countable, Comparable {
class ItemIdSet implements IteratorAggregate, Countable {

/**
* @var ItemId[]
Expand Down
4 changes: 1 addition & 3 deletions src/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel;

use Comparable;
use Countable;
use InvalidArgumentException;
use Wikibase\DataModel\Snak\Snak;
Expand All @@ -17,7 +16,7 @@
* @license GPL-2.0-or-later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class Reference implements Comparable, Countable {
class Reference implements Countable {

/**
* @var SnakList
Expand Down Expand Up @@ -91,7 +90,6 @@ public function getHash() {
}

/**
* @see Comparable::equals
*
* The comparison is done purely value based, ignoring the order of the snaks.
*
Expand Down
5 changes: 1 addition & 4 deletions src/ReferenceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Wikibase\DataModel;

use ArrayIterator;
use Comparable;
use Countable;
use InvalidArgumentException;
use IteratorAggregate;
Expand All @@ -25,7 +24,7 @@
* @author Thiemo Kreuz
* @author Bene* < benestar.wikimedia@gmail.com >
*/
class ReferenceList implements Comparable, Countable, IteratorAggregate, Serializable {
class ReferenceList implements Countable, IteratorAggregate, Serializable {

/**
* @var Reference[] Ordered list or references, indexed by SPL object hash.
Expand Down Expand Up @@ -286,8 +285,6 @@ public function getValueHash() {
}

/**
* @see Comparable::equals
*
* The comparison is done purely value based, ignoring the order of the elements in the array.
*
* @since 0.3
Expand Down
4 changes: 1 addition & 3 deletions src/SiteLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel;

use Comparable;
use InvalidArgumentException;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Entity\ItemIdSet;
Expand All @@ -20,7 +19,7 @@
* @author Michał Łazowik
* @author Thiemo Kreuz
*/
class SiteLink implements Comparable {
class SiteLink {

/**
* @var string
Expand Down Expand Up @@ -107,7 +106,6 @@ public function getBadges() {
}

/**
* @see Comparable::equals
*
* @since 0.7.4
*
Expand Down
4 changes: 1 addition & 3 deletions src/SiteLinkList.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Wikibase\DataModel;

use ArrayIterator;
use Comparable;
use Countable;
use InvalidArgumentException;
use Iterator;
Expand All @@ -23,7 +22,7 @@
* @license GPL-2.0-or-later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class SiteLinkList implements IteratorAggregate, Countable, Comparable {
class SiteLinkList implements IteratorAggregate, Countable {

/**
* @var SiteLink[]
Expand Down Expand Up @@ -151,7 +150,6 @@ public function hasLinkWithSiteId( $siteId ) {
}

/**
* @see Comparable::equals
*
* @since 0.7.4
*
Expand Down
3 changes: 1 addition & 2 deletions src/Snak/Snak.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel\Snak;

use Comparable;
use Serializable;
use Wikibase\DataModel\PropertyIdProvider;

Expand All @@ -15,7 +14,7 @@
* @license GPL-2.0-or-later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
interface Snak extends Serializable, Comparable, PropertyIdProvider {
interface Snak extends Serializable, PropertyIdProvider {

/**
* Returns a string that can be used to identify the type of snak.
Expand Down
4 changes: 1 addition & 3 deletions src/Snak/SnakList.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Wikibase\DataModel\Snak;

use ArrayObject;
use Comparable;
use InvalidArgumentException;
use Traversable;
use Wikibase\DataModel\Internal\MapValueHasher;
Expand All @@ -18,7 +17,7 @@
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
* @author Addshore
*/
class SnakList extends ArrayObject implements Comparable {
class SnakList extends ArrayObject {

/**
* Maps snak hashes to their offsets.
Expand Down Expand Up @@ -123,7 +122,6 @@ public function getSnak( $snakHash ) {
}

/**
* @see Comparable::equals
*
* The comparison is done purely value based, ignoring the order of the elements in the array.
*
Expand Down
1 change: 0 additions & 1 deletion src/Snak/SnakObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public function getHash() {
}

/**
* @see Comparable::equals
*
* @since 0.3
*
Expand Down
4 changes: 1 addition & 3 deletions src/Statement/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel\Statement;

use Comparable;
use InvalidArgumentException;
use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\DataModel\PropertyIdProvider;
Expand All @@ -20,7 +19,7 @@
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
* @author Bene* < benestar.wikimedia@gmail.com >
*/
class Statement implements Comparable, PropertyIdProvider {
class Statement implements PropertyIdProvider {

/**
* Rank enum. Higher values are more preferred.
Expand Down Expand Up @@ -272,7 +271,6 @@ public function getAllSnaks() {
}

/**
* @see Comparable::equals
*
* @since 0.7.4
*
Expand Down
3 changes: 1 addition & 2 deletions src/Statement/StatementGuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel\Statement;

use Comparable;
use InvalidArgumentException;
use Wikibase\DataModel\Entity\EntityId;

Expand All @@ -16,7 +15,7 @@
* @license GPL-2.0-or-later
* @author Addshore
*/
class StatementGuid implements Comparable {
class StatementGuid {

/**
* The separator for the prefix and suffix of the GUID.
Expand Down
4 changes: 1 addition & 3 deletions src/Statement/StatementList.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Wikibase\DataModel\Statement;

use ArrayIterator;
use Comparable;
use Countable;
use InvalidArgumentException;
use Iterator;
Expand All @@ -29,7 +28,7 @@
* @author Bene* < benestar.wikimedia@gmail.com >
* @author Thiemo Kreuz
*/
class StatementList implements IteratorAggregate, Comparable, Countable {
class StatementList implements IteratorAggregate, Countable {

/**
* @var Statement[]
Expand Down Expand Up @@ -267,7 +266,6 @@ public function count() {
}

/**
* @see Comparable::equals
*
* @param mixed $target
*
Expand Down
4 changes: 1 addition & 3 deletions src/Term/AliasGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel\Term;

use Comparable;
use Countable;
use InvalidArgumentException;

Expand All @@ -16,7 +15,7 @@
* @license GPL-2.0-or-later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class AliasGroup implements Comparable, Countable {
class AliasGroup implements Countable {

/**
* @var string Language code identifying the language of the aliases, but note that there is
Expand Down Expand Up @@ -82,7 +81,6 @@ public function isEmpty() {
}

/**
* @see Comparable::equals
*
* @param mixed $target
*
Expand Down
1 change: 0 additions & 1 deletion src/Term/AliasGroupFallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public function getSourceLanguageCode() {
}

/**
* @see Comparable::equals
*
* @param mixed $target
*
Expand Down
1 change: 0 additions & 1 deletion src/Term/AliasGroupList.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public function setGroup( AliasGroup $group ) {
}

/**
* @see Comparable::equals
*
* @since 0.7.4
*
Expand Down
4 changes: 1 addition & 3 deletions src/Term/Fingerprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\DataModel\Term;

use Comparable;
use InvalidArgumentException;
use OutOfBoundsException;

Expand All @@ -17,7 +16,7 @@
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
* @author Thiemo Kreuz
*/
class Fingerprint implements Comparable, LabelsProvider, DescriptionsProvider, AliasesProvider {
class Fingerprint implements LabelsProvider, DescriptionsProvider, AliasesProvider {

/**
* @deprecated since 2.5, use new Fingerprint() instead.
Expand Down Expand Up @@ -221,7 +220,6 @@ public function removeAliasGroup( $languageCode ) {
}

/**
* @see Comparable::equals
*
* @since 0.7.4
*
Expand Down
Loading

0 comments on commit f02f536

Please sign in to comment.