mirror of
https://github.com/appwrite/appwrite
synced 2026-05-21 16:08:22 +00:00
Use parameter class in method class
This commit is contained in:
parent
6615c1a382
commit
254c12b084
1 changed files with 10 additions and 9 deletions
|
|
@ -20,16 +20,14 @@ class Method
|
|||
* @param string $description
|
||||
* @param array<AuthType> $auth
|
||||
* @param array<SDKResponse> $responses
|
||||
* @param ContentType $responseType
|
||||
* @param MethodType|null $methodType
|
||||
* @param ContentType $contentType
|
||||
* @param MethodType|null $type
|
||||
* @param bool $deprecated
|
||||
* @param array|bool $hide
|
||||
* @param bool $packaging
|
||||
* @param string $requestType
|
||||
* @param array $parameters
|
||||
* @param ContentType $requestType
|
||||
* @param array<Parameter> $parameters
|
||||
* @param array $additionalParameters
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct(
|
||||
protected string $namespace,
|
||||
|
|
@ -42,16 +40,16 @@ class Method
|
|||
protected bool $deprecated = false,
|
||||
protected array|bool $hide = false,
|
||||
protected bool $packaging = false,
|
||||
protected string $requestType = 'application/json',
|
||||
protected ContentType $requestType = ContentType::JSON,
|
||||
protected array $parameters = [],
|
||||
protected array $additionalParameters = []
|
||||
) {
|
||||
)
|
||||
{
|
||||
$this->validateMethod($name, $namespace);
|
||||
$this->validateAuthTypes($auth);
|
||||
$this->validateDesc($description);
|
||||
|
||||
foreach ($responses as $response) {
|
||||
/** @var SDKResponse $response */
|
||||
$this->validateResponseModel($response->getModel());
|
||||
$this->validateNoContent($response);
|
||||
}
|
||||
|
|
@ -189,6 +187,9 @@ class Method
|
|||
return $this->requestType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Parameter>
|
||||
*/
|
||||
public function getParameters(): array
|
||||
{
|
||||
return $this->parameters;
|
||||
|
|
|
|||
Loading…
Reference in a new issue