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 |
||
| 29 | View Code Duplication | class BridgeDestroyed extends Event implements IdentifiableEventInterface |
|
| 30 | { |
||
| 31 | /** |
||
| 32 | * @var Bridge |
||
| 33 | */ |
||
| 34 | private $bridge; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return Bridge |
||
| 38 | */ |
||
| 39 | public function getBridge() |
||
| 43 | |||
| 44 | public function getEventId() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param AriClient $client |
||
| 51 | * @param string $response |
||
| 52 | */ |
||
| 53 | public function __construct(AriClient $client, $response) |
||
| 59 | } |
||
| 60 |