Skip to content

Commit f02f536

Browse files
authored
Merge pull request #841 from wmde/update_data_values
Update data-values to 3.0 and prepare for release
2 parents 1e096d8 + 0d5d4e4 commit f02f536

24 files changed

+22
-58
lines changed

RELEASE-NOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Wikibase DataModel release notes
22

3-
## Version 9.6.0 (development)
3+
## Version 9.6.0
44

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

1416
## Version 9.5.1 (2020-06-03)
1517

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"require": {
3030
"php": "^8.0|^7.1",
31-
"data-values/data-values": "~0.1|~1.0|~2.0",
31+
"data-values/data-values": "~0.1|~1.0|~2.0|~3.0",
3232
"wikimedia/assert": "~0.2.2|~0.3.0|~0.4.0|~0.5.0"
3333
},
3434
"require-dev": {

src/Entity/EntityDocument.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Wikibase\DataModel\Entity;
44

5-
use Comparable;
65
use InvalidArgumentException;
76

87
/**
@@ -15,7 +14,7 @@
1514
* @author Jeroen De Dauw < [email protected] >
1615
* @author Bene* < [email protected] >
1716
*/
18-
interface EntityDocument extends Comparable {
17+
interface EntityDocument {
1918

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

6261
/**
63-
* @see Comparable::equals
6462
*
6563
* Two entities are considered equal if they are of the same type and have the same value. The
6664
* value does not include the id, so entities with the same value but different id are

src/Entity/EntityId.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Wikibase\DataModel\Entity;
44

5-
use Comparable;
65
use InvalidArgumentException;
76
use Serializable;
87

@@ -12,7 +11,7 @@
1211
*
1312
* @license GPL-2.0-or-later
1413
*/
15-
abstract class EntityId implements Comparable, Serializable {
14+
abstract class EntityId implements Serializable {
1615

1716
protected $serialization;
1817

@@ -195,7 +194,6 @@ public function __toString() {
195194
}
196195

197196
/**
198-
* @see Comparable::equals
199197
*
200198
* @since 0.5
201199
*

src/Entity/EntityIdValue.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public static function getType() {
7272
}
7373

7474
/**
75-
* @see DataValue::getSortKey
75+
* @deprecated Kept for compatibility with older DataValues versions.
76+
* Do not use.
7677
*
7778
* @return string|float|int
7879
*/

src/Entity/ItemIdSet.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Wikibase\DataModel\Entity;
44

55
use ArrayIterator;
6-
use Comparable;
76
use Countable;
87
use InvalidArgumentException;
98
use IteratorAggregate;
@@ -17,7 +16,7 @@
1716
* @license GPL-2.0-or-later
1817
* @author Jeroen De Dauw < [email protected] >
1918
*/
20-
class ItemIdSet implements IteratorAggregate, Countable, Comparable {
19+
class ItemIdSet implements IteratorAggregate, Countable {
2120

2221
/**
2322
* @var ItemId[]

src/Reference.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Wikibase\DataModel;
44

5-
use Comparable;
65
use Countable;
76
use InvalidArgumentException;
87
use Wikibase\DataModel\Snak\Snak;
@@ -17,7 +16,7 @@
1716
* @license GPL-2.0-or-later
1817
* @author Jeroen De Dauw < [email protected] >
1918
*/
20-
class Reference implements Comparable, Countable {
19+
class Reference implements Countable {
2120

2221
/**
2322
* @var SnakList
@@ -91,7 +90,6 @@ public function getHash() {
9190
}
9291

9392
/**
94-
* @see Comparable::equals
9593
*
9694
* The comparison is done purely value based, ignoring the order of the snaks.
9795
*

src/ReferenceList.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Wikibase\DataModel;
44

55
use ArrayIterator;
6-
use Comparable;
76
use Countable;
87
use InvalidArgumentException;
98
use IteratorAggregate;
@@ -25,7 +24,7 @@
2524
* @author Thiemo Kreuz
2625
* @author Bene* < [email protected] >
2726
*/
28-
class ReferenceList implements Comparable, Countable, IteratorAggregate, Serializable {
27+
class ReferenceList implements Countable, IteratorAggregate, Serializable {
2928

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

288287
/**
289-
* @see Comparable::equals
290-
*
291288
* The comparison is done purely value based, ignoring the order of the elements in the array.
292289
*
293290
* @since 0.3

src/SiteLink.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Wikibase\DataModel;
44

5-
use Comparable;
65
use InvalidArgumentException;
76
use Wikibase\DataModel\Entity\ItemId;
87
use Wikibase\DataModel\Entity\ItemIdSet;
@@ -20,7 +19,7 @@
2019
* @author Michał Łazowik
2120
* @author Thiemo Kreuz
2221
*/
23-
class SiteLink implements Comparable {
22+
class SiteLink {
2423

2524
/**
2625
* @var string
@@ -107,7 +106,6 @@ public function getBadges() {
107106
}
108107

109108
/**
110-
* @see Comparable::equals
111109
*
112110
* @since 0.7.4
113111
*

src/SiteLinkList.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Wikibase\DataModel;
44

55
use ArrayIterator;
6-
use Comparable;
76
use Countable;
87
use InvalidArgumentException;
98
use Iterator;
@@ -23,7 +22,7 @@
2322
* @license GPL-2.0-or-later
2423
* @author Jeroen De Dauw < [email protected] >
2524
*/
26-
class SiteLinkList implements IteratorAggregate, Countable, Comparable {
25+
class SiteLinkList implements IteratorAggregate, Countable {
2726

2827
/**
2928
* @var SiteLink[]
@@ -151,7 +150,6 @@ public function hasLinkWithSiteId( $siteId ) {
151150
}
152151

153152
/**
154-
* @see Comparable::equals
155153
*
156154
* @since 0.7.4
157155
*

0 commit comments

Comments
 (0)