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 |
||
| 23 | class DeleteQuery extends AbstractQuery |
||
| 24 | { |
||
| 25 | use Executable, From, Limit, OrderBy, Where; |
||
| 26 | |||
| 27 | View Code Duplication | public function __construct() |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Generates the raw SQL string for the query. |
||
| 37 | * |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | public function build() |
||
| 53 | |||
| 54 | public function __clone() |
||
| 61 | } |
||
| 62 |