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 TenantRepository extends EntityRepository implements TenantRepositoryInterface |
||
|
|
|||
| 24 | { |
||
| 25 | /** |
||
| 26 | * {@inheritdoc} |
||
| 27 | */ |
||
| 28 | View Code Duplication | public function findOneBySubdomainAndDomain($subdomain, $domain) |
|
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritdoc} |
||
| 46 | */ |
||
| 47 | View Code Duplication | public function findOneByDomain($domain) |
|
| 59 | |||
| 60 | /** |
||
| 61 | * {@inheritdoc} |
||
| 62 | */ |
||
| 63 | public function findOneByCode($code) |
||
| 74 | |||
| 75 | /** |
||
| 76 | * {@inheritdoc} |
||
| 77 | */ |
||
| 78 | public function findAvailableTenants() |
||
| 87 | } |
||
| 88 |