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 |
||
| 16 | final class ChainSiteAccessProvider implements SiteAccessProviderInterface |
||
| 17 | { |
||
| 18 | /** @var \eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessProviderInterface[] */ |
||
| 19 | private $providers; |
||
| 20 | |||
| 21 | public function __construct(iterable $providers) |
||
| 25 | |||
| 26 | public function getSiteAccesses(): \Iterator |
||
| 34 | |||
| 35 | public function isDefined(string $name): bool |
||
| 45 | |||
| 46 | View Code Duplication | public function getSiteAccess(string $name): SiteAccess |
|
| 56 | } |
||
| 57 |