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 | class Updating extends Task |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param InputInterface $input |
||
| 19 | * @param OutputInterface $output |
||
| 20 | * @return int|null |
||
| 21 | */ |
||
| 22 | 3 | public function execute(InputInterface $input, OutputInterface $output) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param InputInterface $input |
||
| 32 | * @param OutputInterface $output |
||
| 33 | * @return int |
||
| 34 | */ |
||
| 35 | 3 | View Code Duplication | private function updateModule(InputInterface $input, OutputInterface $output) |
| 47 | |||
| 48 | /** |
||
| 49 | * @param OutputInterface $output |
||
| 50 | * @return int |
||
| 51 | */ |
||
| 52 | private function updateModules(OutputInterface $output) |
||
| 63 | } |
||
| 64 |