Daniel Kinzler has uploaded a new change for review.
https://gerrit.wikimedia.org/r/75102
Change subject: Stop depending on global state for toString.
......................................................................
Stop depending on global state for toString.
__toString should be implemented in a way that doesn't rely on
global state or resources. This is now fixed for EntityId.
Change-Id: I319b5fb7952335864f4a29bb6170fd73b20dea52
---
M DataModel/Entity/EntityId.php
1 file changed, 4 insertions(+), 3 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseDataModel
refs/changes/02/75102/1
diff --git a/DataModel/Entity/EntityId.php b/DataModel/Entity/EntityId.php
index c1c82b3..45d2387 100644
--- a/DataModel/Entity/EntityId.php
+++ b/DataModel/Entity/EntityId.php
@@ -188,16 +188,17 @@
/**
* Return a string representation of this entity id.
+ * This is a human readable representation for use in logging and
reporting only.
*
- * Note: this was previously documented to be equal to the now
deprecated getPrefixedId
- * This will stop being the case when getPrefixedId gets removed, so
should not be relied upon.
+ * Note: This was previously documented to be equal to the now
deprecated getPrefixedId.
+ * This is no longer the case.
*
* @since 0.3
*
* @return String
*/
public function __toString() {
- return $this->getPrefixedId();
+ return $this->entityType . ':' . $this->numericId;
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/75102
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I319b5fb7952335864f4a29bb6170fd73b20dea52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseDataModel
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits