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 |
||
| 20 | class TenantRepository extends DocumentRepository implements TenantRepositoryInterface |
||
|
|
|||
| 21 | { |
||
| 22 | /** |
||
| 23 | * {@inheritdoc} |
||
| 24 | */ |
||
| 25 | View Code Duplication | public function findOneBySubdomainAndDomain($subdomain, $domain) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | */ |
||
| 37 | View Code Duplication | public function findOneByDomain($domain) |
|
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | public function findOneByCode($code) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | public function findAvailableTenants() |
||
| 65 | } |
||
| 66 |