@@ -211,8 +211,10 @@ public function getLastDetectedSource(): ?string
211
211
* @param array $options
212
212
* @param TokenProviderInterface|null $tokenProvider
213
213
* @return null|string
214
- * @throws ErrorException If the HTTP request fails
215
- * @throws UnexpectedValueException If received data cannot be decoded
214
+ * @throws LargeTextException If translation text is too large
215
+ * @throws RateLimitException If Google has blocked you for excessive requests
216
+ * @throws TranslationRequestException If any other HTTP related error occurs
217
+ * @throws TranslationDecodingException If response JSON cannot be decoded
216
218
*/
217
219
public static function trans (string $ string , string $ target = 'en ' , string $ source = null , array $ options = [], TokenProviderInterface $ tokenProvider = null ): ?string
218
220
{
@@ -232,8 +234,10 @@ public static function trans(string $string, string $target = 'en', string $sour
232
234
*
233
235
* @param string $string String to translate
234
236
* @return string|null
235
- * @throws ErrorException If the HTTP request fails
236
- * @throws UnexpectedValueException If received data cannot be decoded
237
+ * @throws LargeTextException If translation text is too large
238
+ * @throws RateLimitException If Google has blocked you for excessive requests
239
+ * @throws TranslationRequestException If any other HTTP related error occurs
240
+ * @throws TranslationDecodingException If response JSON cannot be decoded
237
241
*/
238
242
public function translate (string $ string ): ?string
239
243
{
@@ -294,9 +298,11 @@ public function translate(string $string): ?string
294
298
* Get response array.
295
299
*
296
300
* @param string $string String to translate
297
- * @throws ErrorException If the HTTP request fails
298
- * @throws UnexpectedValueException If received data cannot be decoded
299
301
* @return array Response
302
+ * @throws LargeTextException If translation text is too large
303
+ * @throws RateLimitException If Google has blocked you for excessive requests
304
+ * @throws TranslationRequestException If any other HTTP related error occurs
305
+ * @throws TranslationDecodingException If response JSON cannot be decoded
300
306
*/
301
307
public function getResponse (string $ string ): array
302
308
{
0 commit comments