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