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 |
||
| 34 | class RaCandidate implements JsonSerializable |
||
|
|
|||
| 35 | { |
||
| 36 | /** |
||
| 37 | * @ORM\Id |
||
| 38 | * @ORM\Column(length=36) |
||
| 39 | * |
||
| 40 | * @var string |
||
| 41 | */ |
||
| 42 | public $identityId; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @ORM\Id |
||
| 46 | * @ORM\Column(type="institution") |
||
| 47 | * |
||
| 48 | * @var Institution |
||
| 49 | */ |
||
| 50 | public $raInstitution; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @ORM\Column(type="institution") |
||
| 54 | * |
||
| 55 | * @var \Surfnet\Stepup\Identity\Value\Institution |
||
| 56 | */ |
||
| 57 | public $institution; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @ORM\Column(type="stepup_name_id") |
||
| 61 | * |
||
| 62 | * @var \Surfnet\Stepup\Identity\Value\NameId |
||
| 63 | */ |
||
| 64 | public $nameId; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @ORM\Column(type="stepup_common_name") |
||
| 68 | * |
||
| 69 | * @var \Surfnet\Stepup\Identity\Value\CommonName |
||
| 70 | */ |
||
| 71 | public $commonName; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @ORM\Column(type="stepup_email") |
||
| 75 | * |
||
| 76 | * @var \Surfnet\Stepup\Identity\Value\Email |
||
| 77 | */ |
||
| 78 | public $email; |
||
| 79 | |||
| 80 | private function __construct() |
||
| 83 | |||
| 84 | public static function nominate( |
||
| 102 | |||
| 103 | View Code Duplication | public function jsonSerialize() |
|
| 114 | } |
||
| 115 |