Use parameter class in method class

This commit is contained in:
Jake Barnby 2025-03-27 21:03:10 +13:00
parent 6615c1a382
commit 254c12b084
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -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;