Jeroen De Dauw has submitted this change and it was merged.

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(-)

Approvals:
  Jeroen De Dauw: Verified; Looks good to me, approved



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: merged
Gerrit-Change-Id: I319b5fb7952335864f4a29bb6170fd73b20dea52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseDataModel
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <daniel.kinz...@wikimedia.de>
Gerrit-Reviewer: Daniel Werner <daniel.wer...@wikimedia.de>
Gerrit-Reviewer: Denny Vrandecic <denny.vrande...@wikimedia.de>
Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to