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 |
||
21 | class UtilCommand extends AbstractCommand |
||
22 | { |
||
23 | /** |
||
24 | * AbstractCommand constructor. |
||
25 | * |
||
26 | * @param Payload $payload |
||
27 | * @param RealTimeClient $client |
||
28 | * @param array|null $configuration |
||
29 | */ |
||
30 | 6 | View Code Duplication | public function __construct(Payload $payload, RealTimeClient $client, array $configuration = null) |
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | 5 | protected function processCoin() : string |
|
60 | } |
||
61 |