diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 626459ea7f..b2b2632012 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -20,16 +20,14 @@ class Method * @param string $description * @param array $auth * @param array $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 $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 + */ public function getParameters(): array { return $this->parameters;