1
0
mirror of synced 2024-11-25 05:06:02 +03:00
This commit is contained in:
Alex Komarichev 2024-06-24 21:07:47 +03:00
parent 8a20b86b17
commit 4b5041b05b
3 changed files with 23 additions and 22 deletions

View File

@ -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),

View File

@ -72,7 +72,7 @@ class Template implements ModelInterface
private $type;
/**
* @var array $template
* @var array<string, string> $template
*
* @Type("array")
* @Accessor(getter="getTemplate",setter="setTemplate")
@ -129,7 +129,7 @@ class Template implements ModelInterface
private $quality;
/**
* @var array $header
* @var array<string, string> $header
*
* @Type("array")
* @Accessor(getter="getHeader",setter="setHeader")
@ -138,7 +138,7 @@ class Template implements ModelInterface
private $header;
/**
* @var array $header
* @var array<string, array<string, string>> $buttons
*
* @Type("array")
* @Accessor(getter="getButtons",setter="setButtons")
@ -243,7 +243,7 @@ class Template implements ModelInterface
}
/**
* @return array|null
* @return array<string, string>|null
*/
public function getTemplate(): ?array
{
@ -251,9 +251,9 @@ class Template implements ModelInterface
}
/**
* @param mixed $template
* @param array<string, string> $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<string, string>|null
*/
public function getHeader(): ?array
{
@ -360,7 +360,7 @@ class Template implements ModelInterface
}
/**
* @param array $header
* @param array<string, string> $header
*/
public function setHeader(array $header): void
{
@ -368,7 +368,7 @@ class Template implements ModelInterface
}
/**
* @return array|null
* @return array<string, array<string, string>>|null
*/
public function getButtons(): ?array
{
@ -376,7 +376,7 @@ class Template implements ModelInterface
}
/**
* @param array $buttons
* @param array<string, array<string, string>> $buttons
*/
public function setButtons(array $buttons): void
{

View File

@ -15,7 +15,7 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
class TemplateVariables implements ModelInterface
{
/**
* @var array $header
* @var array<string, string> $header
*
* @Type("array")
* @Accessor(getter="getHeader",setter="setHeader")
@ -23,7 +23,7 @@ class TemplateVariables implements ModelInterface
private $header;
/**
* @var array $body
* @var array<string, string> $body
*
* @Type("array")
* @Accessor(getter="getBody",setter="setBody")
@ -31,7 +31,7 @@ class TemplateVariables implements ModelInterface
private $body;
/**
* @var array<array> $buttons
* @var array<string, array<string, string>> $buttons
*
* @Type("array")
* @Accessor(getter="getButtons",setter="setButtons")
@ -39,7 +39,7 @@ class TemplateVariables implements ModelInterface
private $buttons;
/**
* @return array|null
* @return array<string, string>|null
*/
public function getHeader(): ?array
{
@ -47,7 +47,7 @@ class TemplateVariables implements ModelInterface
}
/**
* @param array $header
* @param array<string, string> $header
*/
public function setHeader(array $header): void
{
@ -55,7 +55,7 @@ class TemplateVariables implements ModelInterface
}
/**
* @return array|null
* @return array<string, string>|null
*/
public function getBody(): ?array
{
@ -63,7 +63,7 @@ class TemplateVariables implements ModelInterface
}
/**
* @param array $body
* @param array<string, string> $body
*/
public function setBody(array $body): void
{
@ -71,7 +71,7 @@ class TemplateVariables implements ModelInterface
}
/**
* @return array[]|null
* @return array<string, array<string, string>>|null
*/
public function getButtons(): ?array
{
@ -79,7 +79,7 @@ class TemplateVariables implements ModelInterface
}
/**
* @param array[] $buttons
* @param array<string, array<string, string>> $buttons
*/
public function setButtons(array $buttons): void
{