Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
17 | class CompletePurchaseRequestTest extends TestCase |
||
18 | { |
||
19 | private $request; |
||
20 | |||
21 | private $purse = 'ec12345'; |
||
22 | private $secret = '22SAD#-78G8sdf$88'; |
||
23 | private $hash = '1d4d18e1eea386654e1af89e89f1a104'; // d41d8cd98f00b204e9800998ecf8427e 954f1176a05a5921118f49285beea2bb |
||
24 | private $description = 'Test Transaction long description'; |
||
25 | private $transactionId = '1SD672345A890sd'; |
||
26 | private $transactionReference = 'sdfa1SD672345A8'; |
||
27 | private $timestamp = '1454331086'; |
||
|
|||
28 | private $amount = '1465.01'; |
||
29 | private $currency = 'USD'; |
||
30 | private $testMode = true; |
||
31 | |||
32 | public function setUp() |
||
53 | |||
54 | View Code Duplication | public function testGetData() |
|
64 | |||
65 | public function testSendData() |
||
71 | } |
||
72 |
This check marks private properties in classes that are never used. Those properties can be removed.