diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 25f506f..012848f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1450,6 +1450,11 @@ parameters: count: 1 path: src/Bot/Model/Request/MessagesRequest.php + - + message: "#^Method RetailCrm\\\\Mg\\\\Bot\\\\Model\\\\Request\\\\MessagesRequest\\:\\:setLimit\\(\\) has no return typehint specified\\.$#" + count: 1 + path: src/Bot/Model/Request/MessagesRequest.php + - message: "#^Method RetailCrm\\\\Mg\\\\Bot\\\\Model\\\\Request\\\\MessagesRequest\\:\\:setChannelId\\(\\) has no return typehint specified\\.$#" count: 1 diff --git a/src/Bot/Model/Request/MessagesRequest.php b/src/Bot/Model/Request/MessagesRequest.php index c15bccf..e691b8d 100644 --- a/src/Bot/Model/Request/MessagesRequest.php +++ b/src/Bot/Model/Request/MessagesRequest.php @@ -105,6 +105,15 @@ class MessagesRequest implements ModelInterface */ private $type; + /** + * @var int $limit + * + * @Type("int") + * @Accessor(getter="getLimit",setter="setLimit") + * @SkipWhenEmpty() + */ + private $limit; + /** * @return int */ @@ -248,4 +257,20 @@ class MessagesRequest implements ModelInterface { $this->type = $type; } + + /** + * @return int + */ + public function getLimit() + { + return $this->limit; + } + + /** + * @param int $limit + */ + public function setLimit(int $limit) + { + $this->limit = $limit; + } } diff --git a/tests/Bot/Tests/ClientListTest.php b/tests/Bot/Tests/ClientListTest.php index 4087ac1..2a8937e 100644 --- a/tests/Bot/Tests/ClientListTest.php +++ b/tests/Bot/Tests/ClientListTest.php @@ -135,6 +135,7 @@ class ClientListTest extends TestCase $request = new Request\MessagesRequest(); $request->setChannelType(Constants::CHANNEL_TYPE_INSTAGRAM); $request->setType(Constants::MESSAGE_TYPE_TEXT); + $request->setLimit(1000); $response = $client->messages($request);