From 4b5041b05b702604afb3267156ae944ebc135a84 Mon Sep 17 00:00:00 2001 From: Alex Komarichev Date: Mon, 24 Jun 2024 21:07:47 +0300 Subject: [PATCH] phpstan --- src/Bot/Client.php | 7 ++++--- src/Bot/Model/Entity/Template/Template.php | 20 +++++++++---------- .../Entity/Template/TemplateVariables.php | 18 ++++++++--------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/Bot/Client.php b/src/Bot/Client.php index 9a0784d..85a0fc5 100644 --- a/src/Bot/Client.php +++ b/src/Bot/Client.php @@ -24,6 +24,7 @@ use RetailCrm\Mg\Bot\Model\Entity\Message\Message; use RetailCrm\Mg\Bot\Model\Entity\Template\Template; use RetailCrm\Mg\Bot\Model\Entity\User; use RetailCrm\Mg\Bot\Model\ModelAdapter; +use RetailCrm\Mg\Bot\Model\ModelInterface; use RetailCrm\Mg\Bot\Model\Request\UploadFileByUrlRequest; use RetailCrm\Mg\Bot\Model\Response\AssignResponse; use RetailCrm\Mg\Bot\Model\Response\ErrorOnlyResponse; @@ -465,10 +466,10 @@ class Client /** * Returns templates list * - * @return array + * @return Template[] * @throws \Exception */ - public function templates() + public function templates(): array { $response = $this->client->makeRequest( '/templates', @@ -480,7 +481,7 @@ class Client return $adapter->getResponseList($response); } - public function templateSend(string $templateId, Model\Request\TemplateSendRequest $request) + public function templateSend(string $templateId, Model\Request\TemplateSendRequest $request): ModelInterface { $response = $this->client->makeRequest( sprintf('/templates/%d/send', $templateId), diff --git a/src/Bot/Model/Entity/Template/Template.php b/src/Bot/Model/Entity/Template/Template.php index c4ea038..b67ce56 100644 --- a/src/Bot/Model/Entity/Template/Template.php +++ b/src/Bot/Model/Entity/Template/Template.php @@ -72,7 +72,7 @@ class Template implements ModelInterface private $type; /** - * @var array $template + * @var array $template * * @Type("array") * @Accessor(getter="getTemplate",setter="setTemplate") @@ -129,7 +129,7 @@ class Template implements ModelInterface private $quality; /** - * @var array $header + * @var array $header * * @Type("array") * @Accessor(getter="getHeader",setter="setHeader") @@ -138,7 +138,7 @@ class Template implements ModelInterface private $header; /** - * @var array $header + * @var array> $buttons * * @Type("array") * @Accessor(getter="getButtons",setter="setButtons") @@ -243,7 +243,7 @@ class Template implements ModelInterface } /** - * @return array|null + * @return array|null */ public function getTemplate(): ?array { @@ -251,9 +251,9 @@ class Template implements ModelInterface } /** - * @param mixed $template + * @param array $template */ - public function setTemplate($template): void + public function setTemplate(array $template): void { $this->template = $template; } @@ -352,7 +352,7 @@ class Template implements ModelInterface } /** - * @return array|null + * @return array|null */ public function getHeader(): ?array { @@ -360,7 +360,7 @@ class Template implements ModelInterface } /** - * @param array $header + * @param array $header */ public function setHeader(array $header): void { @@ -368,7 +368,7 @@ class Template implements ModelInterface } /** - * @return array|null + * @return array>|null */ public function getButtons(): ?array { @@ -376,7 +376,7 @@ class Template implements ModelInterface } /** - * @param array $buttons + * @param array> $buttons */ public function setButtons(array $buttons): void { diff --git a/src/Bot/Model/Entity/Template/TemplateVariables.php b/src/Bot/Model/Entity/Template/TemplateVariables.php index 8469a29..1c2ffeb 100644 --- a/src/Bot/Model/Entity/Template/TemplateVariables.php +++ b/src/Bot/Model/Entity/Template/TemplateVariables.php @@ -15,7 +15,7 @@ use RetailCrm\Mg\Bot\Model\ModelInterface; class TemplateVariables implements ModelInterface { /** - * @var array $header + * @var array $header * * @Type("array") * @Accessor(getter="getHeader",setter="setHeader") @@ -23,7 +23,7 @@ class TemplateVariables implements ModelInterface private $header; /** - * @var array $body + * @var array $body * * @Type("array") * @Accessor(getter="getBody",setter="setBody") @@ -31,7 +31,7 @@ class TemplateVariables implements ModelInterface private $body; /** - * @var array $buttons + * @var array> $buttons * * @Type("array") * @Accessor(getter="getButtons",setter="setButtons") @@ -39,7 +39,7 @@ class TemplateVariables implements ModelInterface private $buttons; /** - * @return array|null + * @return array|null */ public function getHeader(): ?array { @@ -47,7 +47,7 @@ class TemplateVariables implements ModelInterface } /** - * @param array $header + * @param array $header */ public function setHeader(array $header): void { @@ -55,7 +55,7 @@ class TemplateVariables implements ModelInterface } /** - * @return array|null + * @return array|null */ public function getBody(): ?array { @@ -63,7 +63,7 @@ class TemplateVariables implements ModelInterface } /** - * @param array $body + * @param array $body */ public function setBody(array $body): void { @@ -71,7 +71,7 @@ class TemplateVariables implements ModelInterface } /** - * @return array[]|null + * @return array>|null */ public function getButtons(): ?array { @@ -79,7 +79,7 @@ class TemplateVariables implements ModelInterface } /** - * @param array[] $buttons + * @param array> $buttons */ public function setButtons(array $buttons): void {