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 |
||
| 7 | View Code Duplication | class MysqlSeriesRepository implements IntroductionRepository |
|
| 8 | { |
||
| 9 | |||
| 10 | /** @var Aura\Sql\ConnectionLocator */ |
||
| 11 | protected $connections; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @param Aura\Sql\ConnectionLocator |
||
| 15 | */ |
||
| 16 | public function __construct(ConnectionLocator $connections) |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param integer $post |
||
| 23 | * |
||
| 24 | * @return array|false |
||
| 25 | */ |
||
| 26 | public function getSeriesForPost($post) |
||
| 51 | } |
||
| 52 |