From 35fc1b66ed32badd05bab40272d6302c998567fb Mon Sep 17 00:00:00 2001 From: Sebastian Marcet Date: Tue, 5 Apr 2016 16:04:07 -0300 Subject: [PATCH] [smarcet] Fix on StringOrURI overrided method getValue --- src/utils/json_types/JsonObject.php | 2 -- src/utils/json_types/StringOrURI.php | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/json_types/JsonObject.php b/src/utils/json_types/JsonObject.php index 50bce00..4c7c6b3 100644 --- a/src/utils/json_types/JsonObject.php +++ b/src/utils/json_types/JsonObject.php @@ -49,7 +49,6 @@ public function offsetUnset($offset) throw new \LogicException; } - /** * @return string * @throws exceptions\JsonParseException @@ -68,7 +67,6 @@ public function toJson() return $json; } - /** * @param int $errno * @throws exceptions\JsonParseException diff --git a/src/utils/json_types/StringOrURI.php b/src/utils/json_types/StringOrURI.php index 8640f4e..180c7c2 100644 --- a/src/utils/json_types/StringOrURI.php +++ b/src/utils/json_types/StringOrURI.php @@ -56,4 +56,11 @@ public function isString(){ public function isUri(){ return !(strstr($this->value, ':') === false); } + + /** + * @return string + */ + public function getValue(){ + return $this->isUri() ? $this->getUri() : $this->getString(); + } } \ No newline at end of file