| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 7 | public function getData() |
|
| 19 | { |
||
| 20 | 7 | $query = $this->httpRequest->query; |
|
| 21 | 7 | $ti = $query->get('ti'); //transaction reference |
|
| 22 | 7 | $ec = $query->get('ec'); //error code |
|
|
|
|||
| 23 | 7 | $em = $query->get('em'); //error message |
|
| 24 | 7 | $ms = $query->get('ms'); //merchant session |
|
| 25 | 7 | $am = $query->get('am'); //amount |
|
| 26 | 7 | $futurepaytoken = $query->get('futurepaytoken'); |
|
| 27 | 7 | if (!$ti) { |
|
| 28 | 1 | throw new InvalidRequestException('Transaction reference is missing'); |
|
| 29 | } |
||
| 30 | 6 | $data = array(); |
|
| 31 | 6 | $data['pi'] = $this->getPaystationId(); |
|
| 32 | 6 | $data['ti'] = $ti; |
|
| 33 | |||
| 34 | 6 | return $data; |
|
| 35 | } |
||
| 36 | |||
| 45 |
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.