summaryrefslogtreecommitdiff
path: root/server/vendor/php-opencloud/common/src/Common/JsonPath.php
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-28 12:17:43 +0200
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-28 12:17:43 +0200
commit53f65de9d4163c9c095f2b8e87baca648c3645bd (patch)
tree37f167f38b25aa50bd7dd1429438c0245a280a28 /server/vendor/php-opencloud/common/src/Common/JsonPath.php
parent60cfe3ebc039df8d6a468a43a59e7fd8c2a16956 (diff)
parent804fa322d841d73ee7592885ec500dc94e91b9e6 (diff)
Test
Diffstat (limited to 'server/vendor/php-opencloud/common/src/Common/JsonPath.php')
-rwxr-xr-xserver/vendor/php-opencloud/common/src/Common/JsonPath.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/server/vendor/php-opencloud/common/src/Common/JsonPath.php b/server/vendor/php-opencloud/common/src/Common/JsonPath.php
index 0a6372e..b1a7b34 100755
--- a/server/vendor/php-opencloud/common/src/Common/JsonPath.php
+++ b/server/vendor/php-opencloud/common/src/Common/JsonPath.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types = 1);
namespace OpenCloud\Common;
@@ -42,7 +42,7 @@ class JsonPath
* @param $path The XPath to use
* @param $value The new value of the node
*/
- public function set($path, $value)
+ public function set(string $path, $value)
{
$this->jsonStructure = $this->setPath($path, $value, $this->jsonStructure);
}
@@ -53,9 +53,10 @@ class JsonPath
* @param $path
* @param $value
* @param $json
+ *
* @return mixed
*/
- private function setPath($path, $value, $json)
+ private function setPath(string $path, $value, array $json): array
{
$nodes = explode('.', $path);
$point = array_shift($nodes);
@@ -87,9 +88,10 @@ class JsonPath
* Get a path's value. If no path can be matched, NULL is returned.
*
* @param $path
+ *
* @return mixed|null
*/
- public function get($path)
+ public function get(string $path)
{
return $this->getPath($path, $this->jsonStructure);
}
@@ -99,9 +101,10 @@ class JsonPath
*
* @param $path
* @param $json
+ *
* @return null
*/
- private function getPath($path, $json)
+ private function getPath(string $path, $json)
{
$nodes = explode('.', $path);
$point = array_shift($nodes);