Skip to content

Commit 5344646

Browse files
JeroenDeDauwthiemowmde
authored andcommitted
Document usages of the Int32EntityId interface
1 parent a7bab57 commit 5344646

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/Entity/Int32EntityId.php

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

55
/**
6-
* Interface for EntityIds that can be converted to a unique, positive, signed 32 bit integer in the
7-
* range [1..2147483647], and back from the entity type and the number. When an ID can not be
8-
* represented as an unique integer, an InvalidArgumentException must be thrown on construction
9-
* time. For example, when "Q1" and "Q01" have the same integer representation, only one should be
10-
* allowed.
6+
* Interface for EntityIds that can be converted to a positive, signed 32 bit integer in the range
7+
* [1..2147483647], and back from the entity type and the number. The number must be distinct for
8+
* different IDs. When an ID can not be represented as a distinct integer, an
9+
* InvalidArgumentException must be thrown on construction time. For example, when "Q1" and "Q01"
10+
* have the same integer representation, only one should be allowed.
1111
*
1212
* Entity types that do not meet this criteria should not implement this interface.
1313
*
@@ -26,7 +26,7 @@ interface Int32EntityId {
2626
/**
2727
* @since 6.1
2828
*
29-
* @return int Guaranteed to be a unique integer in the range [1..2147483647].
29+
* @return int Guaranteed to be a distinct integer in the range [1..2147483647].
3030
*/
3131
public function getNumericId();
3232

src/Entity/ItemId.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ private function assertValidIdFormat( $idSerialization ) {
4949
}
5050

5151
/**
52-
* @return int
52+
* @see Int32EntityId::getNumericId
5353
*
5454
* @throws RuntimeException if called on a foreign ID.
55+
* @return int Guaranteed to be a distinct integer in the range [1..2147483647].
5556
*/
5657
public function getNumericId() {
5758
if ( $this->isForeign() ) {

src/Entity/PropertyId.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ private function assertValidIdFormat( $idSerialization ) {
4949
}
5050

5151
/**
52-
* @return int
52+
* @see Int32EntityId::getNumericId
5353
*
5454
* @throws RuntimeException if called on a foreign ID.
55+
* @return int Guaranteed to be a distinct integer in the range [1..2147483647].
5556
*/
5657
public function getNumericId() {
5758
if ( $this->isForeign() ) {

0 commit comments

Comments
 (0)