1 | <?php |
||
26 | class GetTranslations implements \badams\MicrosoftTranslator\ApiMethodInterface |
||
27 | { |
||
28 | /** |
||
29 | * @const Maximum allowable length of text |
||
30 | */ |
||
31 | const TEXT_MAX_LENGTH = 10000; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $text; |
||
37 | |||
38 | /** |
||
39 | * @var Language |
||
40 | */ |
||
41 | protected $to; |
||
42 | |||
43 | /** |
||
44 | * @var Language|null |
||
45 | */ |
||
46 | protected $from; |
||
47 | |||
48 | /** |
||
49 | * @var int |
||
50 | */ |
||
51 | protected $maxTranslations; |
||
52 | |||
53 | /** |
||
54 | * @var TranslateOptions |
||
55 | */ |
||
56 | protected $options; |
||
57 | |||
58 | /** |
||
59 | * GetTranslations constructor. |
||
60 | * @param $text |
||
61 | * @param $to |
||
62 | * @param $from |
||
63 | * @param int $maxTranslations |
||
64 | * @param TranslateOptions|null $options |
||
65 | * @throws ArgumentException |
||
66 | * @throws UnsupportedLanguageException |
||
67 | */ |
||
68 | 12 | public function __construct($text, $to, $from, $maxTranslations = 5, TranslateOptions $options = null) |
|
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | 6 | public function getRequestMethod() |
|
90 | |||
91 | /** |
||
92 | * @return array |
||
93 | */ |
||
94 | 6 | public function getRequestOptions() |
|
106 | |||
107 | /** |
||
108 | * @param \GuzzleHttp\Message\ResponseInterface $response |
||
109 | * @return GetTranslationsResponse |
||
110 | */ |
||
111 | 6 | public function processResponse(\GuzzleHttp\Message\ResponseInterface $response) |
|
117 | } |
||
118 |