Skip to content

Commit

Permalink
phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
Chupocabra committed Jun 24, 2024
1 parent 8a20b86 commit 4b5041b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
7 changes: 4 additions & 3 deletions src/Bot/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;
Expand Down Expand Up @@ -465,10 +466,10 @@ public function messageDelete(string $request)
/**
* Returns templates list
*
* @return array
* @return Template[]
* @throws \Exception
*/
public function templates()
public function templates(): array
{
$response = $this->client->makeRequest(
'/templates',
Expand All @@ -480,7 +481,7 @@ public function templates()
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),
Expand Down
20 changes: 10 additions & 10 deletions src/Bot/Model/Entity/Template/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -243,17 +243,17 @@ public function setType(string $type): void
}

/**
* @return array|null
* @return array<string, string>|null
*/
public function getTemplate(): ?array
{
return $this->template;
}

/**
* @param mixed $template
* @param array<string, string> $template
*/
public function setTemplate($template): void
public function setTemplate(array $template): void
{
$this->template = $template;
}
Expand Down Expand Up @@ -352,31 +352,31 @@ public function setQuality(string $quality): void
}

/**
* @return array|null
* @return array<string, string>|null
*/
public function getHeader(): ?array
{
return $this->header;
}

/**
* @param array $header
* @param array<string, string> $header
*/
public function setHeader(array $header): void
{
$this->header = $header;
}

/**
* @return array|null
* @return array<string, array<string, string>>|null
*/
public function getButtons(): ?array
{
return $this->buttons;
}

/**
* @param array $buttons
* @param array<string, array<string, string>> $buttons
*/
public function setButtons(array $buttons): void
{
Expand Down
18 changes: 9 additions & 9 deletions src/Bot/Model/Entity/Template/TemplateVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,71 +15,71 @@
class TemplateVariables implements ModelInterface
{
/**
* @var array $header
* @var array<string, string> $header
*
* @Type("array")
* @Accessor(getter="getHeader",setter="setHeader")
*/
private $header;

/**
* @var array $body
* @var array<string, string> $body
*
* @Type("array")
* @Accessor(getter="getBody",setter="setBody")
*/
private $body;

/**
* @var array<array> $buttons
* @var array<string, array<string, string>> $buttons
*
* @Type("array")
* @Accessor(getter="getButtons",setter="setButtons")
*/
private $buttons;

/**
* @return array|null
* @return array<string, string>|null
*/
public function getHeader(): ?array
{
return $this->header;
}

/**
* @param array $header
* @param array<string, string> $header
*/
public function setHeader(array $header): void
{
$this->header = $header;
}

/**
* @return array|null
* @return array<string, string>|null
*/
public function getBody(): ?array
{
return $this->body;
}

/**
* @param array $body
* @param array<string, string> $body
*/
public function setBody(array $body): void
{
$this->body = $body;
}

/**
* @return array[]|null
* @return array<string, array<string, string>>|null
*/
public function getButtons(): ?array
{
return $this->buttons;
}

/**
* @param array[] $buttons
* @param array<string, array<string, string>> $buttons
*/
public function setButtons(array $buttons): void
{
Expand Down

0 comments on commit 4b5041b

Please sign in to comment.