@@ -17,16 +17,15 @@ class Telegram
1717 /** @var HttpClient HTTP Client */
1818 protected $ http ;
1919
20- /** @var string| null Telegram Bot API Token. */
20+ /** @var null|string Telegram Bot API Token. */
2121 protected $ token ;
2222
2323 /** @var string Telegram Bot API Base URI */
2424 protected $ apiBaseUri ;
2525
2626 /**
27- * @param string|null $token
28- * @param HttpClient|null $httpClient
29- * @param string|null $apiBaseUri
27+ * @param null|string $token
28+ * @param null|string $apiBaseUri
3029 */
3130 public function __construct ($ token = null , HttpClient $ httpClient = null , $ apiBaseUri = null )
3231 {
@@ -37,8 +36,6 @@ public function __construct($token = null, HttpClient $httpClient = null, $apiBa
3736
3837 /**
3938 * Token getter.
40- *
41- * @return string
4239 */
4340 public function getToken (): string
4441 {
@@ -48,8 +45,6 @@ public function getToken(): string
4845 /**
4946 * Token setter.
5047 *
51- * @param string $token
52- *
5348 * @return $this
5449 */
5550 public function setToken (string $ token ): self
@@ -61,8 +56,6 @@ public function setToken(string $token): self
6156
6257 /**
6358 * API Base URI getter.
64- *
65- * @return string
6659 */
6760 public function getApiBaseUri (): string
6861 {
@@ -72,8 +65,6 @@ public function getApiBaseUri(): string
7265 /**
7366 * API Base URI setter.
7467 *
75- * @param string $apiBaseUri
76- *
7768 * @return $this
7869 */
7970 public function setApiBaseUri (string $ apiBaseUri ): self
@@ -83,21 +74,9 @@ public function setApiBaseUri(string $apiBaseUri): self
8374 return $ this ;
8475 }
8576
86- /**
87- * Get HttpClient.
88- *
89- * @return HttpClient
90- */
91- protected function httpClient (): HttpClient
92- {
93- return $ this ->http ;
94- }
95-
9677 /**
9778 * Set HTTP Client.
9879 *
99- * @param HttpClient $http
100- *
10180 * @return $this
10281 */
10382 public function setHttpClient (HttpClient $ http ): self
@@ -122,13 +101,9 @@ public function setHttpClient(HttpClient $http): self
122101 * ];
123102 * </code>
124103 *
125- * @link https://core.telegram.org/bots/api#sendmessage
126- *
127- * @param array $params
104+ * @see https://core.telegram.org/bots/api#sendmessage
128105 *
129106 * @throws CouldNotSendNotification
130- *
131- * @return ResponseInterface|null
132107 */
133108 public function sendMessage (array $ params ): ?ResponseInterface
134109 {
@@ -138,13 +113,7 @@ public function sendMessage(array $params): ?ResponseInterface
138113 /**
139114 * Send File as Image or Document.
140115 *
141- * @param array $params
142- * @param string $type
143- * @param bool $multipart
144- *
145116 * @throws CouldNotSendNotification
146- *
147- * @return ResponseInterface|null
148117 */
149118 public function sendFile (array $ params , string $ type , bool $ multipart = false ): ?ResponseInterface
150119 {
@@ -154,11 +123,7 @@ public function sendFile(array $params, string $type, bool $multipart = false):
154123 /**
155124 * Send a Poll.
156125 *
157- * @param array $params
158- *
159126 * @throws CouldNotSendNotification
160- *
161- * @return ResponseInterface|null
162127 */
163128 public function sendPoll (array $ params ): ?ResponseInterface
164129 {
@@ -168,27 +133,25 @@ public function sendPoll(array $params): ?ResponseInterface
168133 /**
169134 * Send a Location.
170135 *
171- * @param array $params
172- *
173136 * @throws CouldNotSendNotification
174- *
175- * @return ResponseInterface|null
176137 */
177138 public function sendLocation (array $ params ): ?ResponseInterface
178139 {
179140 return $ this ->sendRequest ('sendLocation ' , $ params );
180141 }
181142
143+ /**
144+ * Get HttpClient.
145+ */
146+ protected function httpClient (): HttpClient
147+ {
148+ return $ this ->http ;
149+ }
150+
182151 /**
183152 * Send an API request and return response.
184153 *
185- * @param string $endpoint
186- * @param array $params
187- * @param bool $multipart
188- *
189154 * @throws CouldNotSendNotification
190- *
191- * @return ResponseInterface|null
192155 */
193156 protected function sendRequest (string $ endpoint , array $ params , bool $ multipart = false ): ?ResponseInterface
194157 {
0 commit comments