diff --git a/src/Request/AbstractRequest.php b/src/Request/AbstractRequest.php index 9bcedbd..97033b3 100644 --- a/src/Request/AbstractRequest.php +++ b/src/Request/AbstractRequest.php @@ -111,9 +111,7 @@ public function __construct(array $options = []) $this->setFormat($this->getOption('format')); } - if (true === $this->hasOption('headers') - && true === is_array($this->getOption('headers')) - ) { + if (true === $this->hasOption('headers') && true === is_array($this->getOption('headers'))) { $this->setHeaders($this->getOption('headers')); } @@ -138,7 +136,7 @@ public function getParams(): array } /** - * @param string|int $name + * @param string|integer $name * * @return mixed|null */ @@ -153,7 +151,7 @@ public function getParam($name) /** * @param string|integer $name * - * @return bool + * @return boolean */ public function hasParam($name): bool { @@ -188,7 +186,7 @@ public function setParams(array $params): self $optionalParams = []; foreach ($this->getOptionalParams() as $paramName => $paramDefinition) { # If optional paramater is provided... - if(isset($params[$paramName])) { + if (isset($params[$paramName])) { if (true === is_string($paramDefinition) && '' !== $paramDefinition && 1 !== preg_match("/^{$paramDefinition}$/", $this->getParam($paramName))) { throw new InvalidArgumentException(sprintf('Optional param %s is not valid. It must match "%s"', $paramName, $paramDefinition)); } @@ -204,7 +202,7 @@ public function setParams(array $params): self } /** - * @inheritDoc + * @return string */ public function getUri(): string { @@ -223,7 +221,7 @@ public function setUri(string $uri): self } /** - * @inheritDoc + * @return string */ public function getMethod(): string { @@ -346,16 +344,15 @@ public function getBody(): string * * @return AbstractRequest */ - public function setBody($body): self + public function setBody(mixed $body): self { $this->body = $body; return $this; } /** - * @inheritDoc - * - * @return AbstractRequest + * @param Client $client + * @return $this */ public function applyClient(Client $client): self { @@ -433,7 +430,7 @@ public function addFilter(FilterInterface $filter): self * * @return string */ - private function encodeBody($body): string + private function encodeBody(mixed $body): string { $encoder = new JsonEncoder(); $contentTypeHeader = 'application/json'; @@ -616,7 +613,7 @@ protected function flattenErrors(array $errors, string $context = ''): array * * @return void */ - protected function validateBody($body): void + protected function validateBody(mixed $body): void { if (true === is_string($body)) { return;