| Conditions | 2 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | public function paraphrase(string $text): string |
||
| 50 | { |
||
| 51 | try { |
||
| 52 | $response = $this->client->request( |
||
| 53 | 'POST', |
||
| 54 | self::API_URL, |
||
| 55 | [ |
||
| 56 | 'form_params' => [ |
||
| 57 | 'lang' => 'en', |
||
| 58 | 'data' => $text, |
||
| 59 | ], |
||
| 60 | ] |
||
| 61 | ); |
||
| 62 | |||
| 63 | return $response->getBody()->getContents(); |
||
| 64 | } catch (Throwable $exception) { |
||
| 65 | Log::error($exception->getMessage()); |
||
| 66 | } |
||
| 67 | |||
| 68 | return $text; |
||
| 69 | } |
||
| 71 |