From 7573fc220569b8ee36aebbbc3283a10523ccd0a0 Mon Sep 17 00:00:00 2001 From: Netkas Date: Wed, 9 Aug 2023 15:45:59 -0400 Subject: [PATCH] Code fixes in \TgBotLib\Objects\Telegram\InlineQueryResult > InlineQueryResultContact --- .../InlineQueryResult/InlineQueryResultContact.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TgBotLib/Objects/Telegram/InlineQueryResult/InlineQueryResultContact.php b/src/TgBotLib/Objects/Telegram/InlineQueryResult/InlineQueryResultContact.php index 2511c48..84740ca 100644 --- a/src/TgBotLib/Objects/Telegram/InlineQueryResult/InlineQueryResultContact.php +++ b/src/TgBotLib/Objects/Telegram/InlineQueryResult/InlineQueryResultContact.php @@ -82,7 +82,7 @@ } /** - * Type of the result, must be contact + * Type of the result must be contact * * @return string */ @@ -111,7 +111,9 @@ public function setId(string $id): self { if(!Validate::length($id, 1, 64)) + { throw new InvalidArgumentException('id should be between 1-64 characters'); + } $this->id = $id; return $this; @@ -206,7 +208,9 @@ public function setVcard(?string $vcard): self { if(!Validate::length($vcard, 0, 2048)) + { throw new InvalidArgumentException('vcard should be between 0-2048 characters'); + } $this->vcard = $vcard; return $this; @@ -350,7 +354,7 @@ } /** - * Constructs object from an array representation + * Constructs an object from an array representation * * @param array $data * @return ObjectTypeInterface