| Conditions | 4 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | public function getToken(): ?string |
||
| 48 | { |
||
| 49 | $token = null; |
||
| 50 | $content = $this->request->getContent(); |
||
|
|
|||
| 51 | |||
| 52 | if ($content) { |
||
| 53 | try { |
||
| 54 | $params = Json::decode($content); |
||
| 55 | |||
| 56 | if (isset($params['hryvinskyi_invisible_token'])) { |
||
| 57 | $token = $params['hryvinskyi_invisible_token']; |
||
| 58 | } |
||
| 59 | } catch (Exception $e) { |
||
| 60 | $this->messageManager->addErrorMessage(__('Not found invisible captcha token')); |
||
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 64 | return $token; |
||
| 65 | } |
||
| 67 |