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