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 |
||
| 14 | View Code Duplication | class ChannelHold extends Event implements IdentifiableEventInterface |
|
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var Channel |
||
| 18 | */ |
||
| 19 | private $channel; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @return Channel |
||
| 23 | */ |
||
| 24 | public function getChannel() |
||
| 28 | |||
| 29 | public function getEventId() |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param AriClient $client |
||
| 36 | * @param string $response |
||
| 37 | */ |
||
| 38 | public function __construct(AriClient $client, $response) |
||
| 44 | } |