| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 11 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | View Code Duplication | protected function getTransaction() |
|
| 36 | { |
||
| 37 | return [ |
||
| 38 | 'txnid' => strtoupper(str_random(8)), |
||
| 39 | 'amount' => rand(100, 999), |
||
| 40 | 'productinfo' => 'Product Information', |
||
| 41 | 'firstname' => 'John', |
||
| 42 | 'email' => '[email protected]', |
||
| 43 | 'phone' => '9876543210', |
||
| 44 | ]; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
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.