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 | class m6_hide_for_group extends \phpbb\db\migration\container_aware_migration |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * {@inheritDoc} |
||
| 17 | */ |
||
| 18 | public function effectively_installed() |
||
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritDoc} |
||
| 27 | */ |
||
| 28 | static public function depends_on() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Add the ACP settings module |
||
| 35 | * |
||
| 36 | * @return array Array of data update instructions |
||
| 37 | */ |
||
| 38 | View Code Duplication | public function update_data() |
|
| 53 | } |
||
| 54 |