Skip to content

Commit

Permalink
Merge pull request #677 from wmde/revert-676-revert-674-int32docs
Browse files Browse the repository at this point in the history
Definitely an improvement
  • Loading branch information
Daniel Kinzler committed Nov 9, 2016
2 parents d8b851c + 5344646 commit b4fe1fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Entity/Int32EntityId.php
Expand Up @@ -3,11 +3,11 @@
namespace Wikibase\DataModel\Entity;

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

Expand Down
3 changes: 2 additions & 1 deletion src/Entity/ItemId.php
Expand Up @@ -49,9 +49,10 @@ private function assertValidIdFormat( $idSerialization ) {
}

/**
* @return int
* @see Int32EntityId::getNumericId
*
* @throws RuntimeException if called on a foreign ID.
* @return int Guaranteed to be a distinct integer in the range [1..2147483647].
*/
public function getNumericId() {
if ( $this->isForeign() ) {
Expand Down
3 changes: 2 additions & 1 deletion src/Entity/PropertyId.php
Expand Up @@ -49,9 +49,10 @@ private function assertValidIdFormat( $idSerialization ) {
}

/**
* @return int
* @see Int32EntityId::getNumericId
*
* @throws RuntimeException if called on a foreign ID.
* @return int Guaranteed to be a distinct integer in the range [1..2147483647].
*/
public function getNumericId() {
if ( $this->isForeign() ) {
Expand Down

0 comments on commit b4fe1fc

Please sign in to comment.