summaryrefslogtreecommitdiff
path: root/server/vendor/php-opencloud/common/src/Common/Api/Operation.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/Api/Operation.php
parent60cfe3ebc039df8d6a468a43a59e7fd8c2a16956 (diff)
parent804fa322d841d73ee7592885ec500dc94e91b9e6 (diff)
Test
Diffstat (limited to 'server/vendor/php-opencloud/common/src/Common/Api/Operation.php')
-rwxr-xr-xserver/vendor/php-opencloud/common/src/Common/Api/Operation.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/server/vendor/php-opencloud/common/src/Common/Api/Operation.php b/server/vendor/php-opencloud/common/src/Common/Api/Operation.php
index 3155ca4..927af5a 100755
--- a/server/vendor/php-opencloud/common/src/Common/Api/Operation.php
+++ b/server/vendor/php-opencloud/common/src/Common/Api/Operation.php
@@ -1,9 +1,7 @@
-<?php
+<?php declare(strict_types=1);
namespace OpenCloud\Common\Api;
-use GuzzleHttp\Utils;
-
/**
* This class represents an OpenCloud API operation. It encapsulates most aspects of the REST operation: its HTTP
* method, the URL path, its top-level JSON key, and all of its {@see Parameter} objects.
@@ -49,7 +47,7 @@ class Operation
/**
* @return string
*/
- public function getPath()
+ public function getPath(): string
{
return $this->path;
}
@@ -57,7 +55,7 @@ class Operation
/**
* @return string
*/
- public function getMethod()
+ public function getMethod(): string
{
return $this->method;
}
@@ -69,7 +67,7 @@ class Operation
*
* @return bool
*/
- public function hasParam($key)
+ public function hasParam(string $key): bool
{
return isset($this->params[$key]);
}
@@ -79,7 +77,7 @@ class Operation
*
* @return Parameter
*/
- public function getParam($name)
+ public function getParam(string $name)
{
return isset($this->params[$name]) ? $this->params[$name] : null;
}
@@ -87,9 +85,9 @@ class Operation
/**
* @return string
*/
- public function getJsonKey()
+ public function getJsonKey(): string
{
- return $this->jsonKey;
+ return $this->jsonKey ?: '';
}
/**
@@ -100,7 +98,7 @@ class Operation
*
* @return array
*/
- public static function toParamArray(array $data)
+ public static function toParamArray(array $data): array
{
$params = [];
@@ -121,7 +119,7 @@ class Operation
* @return bool TRUE if validation passes
* @throws \Exception If validate fails
*/
- public function validate(array $userValues)
+ public function validate(array $userValues): bool
{
foreach ($this->params as $paramName => $param) {
if (array_key_exists($paramName, $userValues)) {
@@ -133,4 +131,4 @@ class Operation
return true;
}
-}
+} \ No newline at end of file