diff options
| author | Loic GUEGAN <loic@Manzerbredes.home> | 2016-04-16 19:10:27 +0200 |
|---|---|---|
| committer | Loic GUEGAN <loic@Manzerbredes.home> | 2016-04-16 19:10:27 +0200 |
| commit | a3ff4d243e2ac37d4516ae56ff86985eadc00eb8 (patch) | |
| tree | 32e71c42855cc46d95d9c6b74ad2c145eb9ec7eb /server/vendor/php-opencloud/common/src/Common/Api/AbstractParams.php | |
| parent | 396c90f921c30de2d15d2ce52d5d1beabf8eb52d (diff) | |
| parent | 31d2d0c158ad4daa3dde7a905f3c2e312c194f2e (diff) | |
Test
Diffstat (limited to 'server/vendor/php-opencloud/common/src/Common/Api/AbstractParams.php')
| -rwxr-xr-x | server/vendor/php-opencloud/common/src/Common/Api/AbstractParams.php | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/server/vendor/php-opencloud/common/src/Common/Api/AbstractParams.php b/server/vendor/php-opencloud/common/src/Common/Api/AbstractParams.php deleted file mode 100755 index b21b3dd..0000000 --- a/server/vendor/php-opencloud/common/src/Common/Api/AbstractParams.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php declare(strict_types=1); - -namespace OpenCloud\Common\Api; - -abstract class AbstractParams -{ - // locations - const QUERY = 'query'; - const HEADER = 'header'; - const URL = 'url'; - const JSON = 'json'; - const RAW = 'raw'; - - // types - const STRING_TYPE = "string"; - const BOOL_TYPE = "boolean"; - const BOOLEAN_TYPE = self::BOOL_TYPE; - const OBJECT_TYPE = "object"; - const ARRAY_TYPE = "array"; - const NULL_TYPE = "NULL"; - const INT_TYPE = 'integer'; - const INTEGER_TYPE = self::INT_TYPE; - - public static function isSupportedLocation(string $val): bool - { - return in_array($val, [self::QUERY, self::HEADER, self::URL, self::JSON, self::RAW]); - } - - public function limit(): array - { - return [ - 'type' => self::INT_TYPE, - 'location' => 'query', - 'description' => <<<DESC -This will limit the total amount of elements returned in a list up to the number specified. For example, specifying a -limit of 10 will return 10 elements, regardless of the actual count. -DESC - ]; - } - - public function marker(): array - { - return [ - 'type' => 'string', - 'location' => 'query', - 'description' => <<<DESC -Specifying a marker will begin the list from the value specified. Elements will have a particular attribute that -identifies them, such as a name or ID. The marker value will search for an element whose identifying attribute matches -the marker value, and begin the list from there. -DESC - ]; - } - - public function id(string $type): array - { - return [ - 'description' => sprintf("The unique ID, or identifier, for the %s", $type), - 'type' => self::STRING_TYPE, - 'location' => self::JSON, - ]; - } - - public function idPath(): array - { - return [ - 'type' => self::STRING_TYPE, - 'location' => self::URL, - 'description' => 'The unique ID of the resource', - ]; - } - - public function name(string $resource): array - { - return [ - 'description' => sprintf("The name of the %s", $resource), - 'type' => self::STRING_TYPE, - 'location' => self::JSON, - ]; - } - - - public function sortDir(): array - { - return [ - 'type' => self::STRING_TYPE, - 'location' => self::QUERY, - 'description' => "Sorts by one or more sets of attribute and sort direction combinations.", - 'enum' => ['asc', 'desc'] - ]; - } - - public function sortKey(): array - { - return [ - 'type' => self::STRING_TYPE, - 'location' => self::QUERY, - 'description' => "Sorts by one or more sets of attribute and sort direction combinations.", - ]; - } -}
\ No newline at end of file |
