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 |
||
| 7 | class PayloadTest extends \PHPUnit_Framework_TestCase |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var \PHPUnit_Framework_MockObject_MockObject |
||
| 11 | */ |
||
| 12 | private $claims; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var PayloadStub |
||
| 16 | */ |
||
| 17 | private $payload; |
||
| 18 | |||
| 19 | public function setUp() |
||
| 24 | |||
| 25 | public function testSetClaim() |
||
| 35 | |||
| 36 | View Code Duplication | public function testFindClaimByName() |
|
| 47 | |||
| 48 | public function testGetClaims() |
||
| 52 | |||
| 53 | public function testJsonSerialize() |
||
| 63 | } |
||
| 64 |