diff options
| author | EoleDev <EoleDev@outlook.fr> | 2016-03-23 15:30:47 +0100 |
|---|---|---|
| committer | EoleDev <EoleDev@outlook.fr> | 2016-03-23 15:30:47 +0100 |
| commit | 54ec6723deb44e325782afd366eeec01ee29ac55 (patch) | |
| tree | 5431400d307754a02e6c40b35a40e6761d7dac0c /server/vendor/php-opencloud/common/src/Common/JsonPath.php | |
| parent | 0dc17aa9efb987dcdf6f864f4110450bcc0c9003 (diff) | |
Maj Library
Diffstat (limited to 'server/vendor/php-opencloud/common/src/Common/JsonPath.php')
| -rw-r--r-- | server/vendor/php-opencloud/common/src/Common/JsonPath.php | 13 |
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 100644 --- 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); |
