| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 63 | public function confirm() |
||
| 64 | { |
||
| 65 | $error = null; |
||
|
|
|||
| 66 | if (!$this->validate()) { |
||
| 67 | return implode("\n", $this->getFirstErrors()); |
||
| 68 | } |
||
| 69 | $client = new Client(['baseUrl' => Yii::$app->params['hiapi.url']]); |
||
| 70 | $response = $client->createRequest() |
||
| 71 | ->setUrl($this->what) |
||
| 72 | ->setData(['confirm_data' => $this->attributes]) |
||
| 73 | ->send(); |
||
| 74 | $responseData = $response->getData(); |
||
| 75 | if (array_key_exists('_error', $responseData)) { |
||
| 76 | return $responseData['_error']; |
||
| 77 | } |
||
| 78 | |||
| 79 | return true; |
||
| 80 | } |
||
| 81 | } |
||
| 83 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.