| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 55 | public function verify($value) |
||
| 56 | { |
||
| 57 | $response = (new Client( |
||
| 58 | [ |
||
| 59 | 'baseUrl' => 'https://www.google.com/recaptcha/api', |
||
| 60 | 'responseConfig' => [ |
||
| 61 | 'format' => Client::FORMAT_JSON |
||
| 62 | ] |
||
| 63 | ] |
||
| 64 | )) |
||
| 65 | ->get( |
||
| 66 | 'siteverify', |
||
| 67 | [ |
||
| 68 | 'secret' => $this->secret, |
||
| 69 | 'response' => $value, |
||
| 70 | 'remoteip' => Yii::$app->request->getUserIP() |
||
| 71 | ] |
||
| 72 | ) |
||
| 73 | ->send(); |
||
| 74 | |||
| 75 | return $response->getData()['success'] ? : false; |
||
| 76 | } |
||
| 77 | } |
||
| 78 |