Conditions | 4 |
Paths | 4 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | public function recaptcha($response, $ipClient = null) |
||
35 | { |
||
36 | if ($this->getOptions()->getGRecaptchaKey()) { |
||
37 | $client = new \Zend\Http\Client($this->getOptions()->getGRecaptchaUrl()); |
||
38 | $client->setParameterPost(array( |
||
39 | 'secret' => $this->getOptions()->getGRecaptchaKey(), |
||
40 | 'response' => $response, |
||
41 | 'remoteip' => $ipClient, |
||
42 | )); |
||
43 | $client->setMethod(\Zend\Http\Request::METHOD_POST); |
||
44 | |||
45 | $result = $client->send(); |
||
46 | if ($result) { |
||
47 | $jsonResult = \Zend\Json\Json::decode($result->getBody()); |
||
48 | if ($jsonResult->success) { |
||
49 | return true; |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 | |||
54 | return false; |
||
55 | } |
||
56 | |||
73 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.