| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function analyze($text, array $params = []) |
||
| 19 | { |
||
| 20 | $headers = ['Content-Type' => 'application/json']; |
||
| 21 | |||
| 22 | if (!isset($params['version'])) { |
||
| 23 | $params['version'] = \date('Y-m-d'); |
||
| 24 | } |
||
| 25 | |||
| 26 | $response = $this->postRaw('/api/v3/tone_chat' . '?' . http_build_query($params), $text, $headers); |
||
| 27 | |||
| 28 | if ($response->getStatusCode() !== 200) { |
||
| 29 | $this->handleErrors($response); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $this->hydrator->hydrate($response, UtteranceAnalyses::class); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |