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 |
||
18 | View Code Duplication | final class RegisterMigrationsEventSubscriber implements EventSubscriberInterface |
|
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var Configuration |
||
23 | */ |
||
24 | private $configuration; |
||
25 | |||
26 | |||
27 | 6 | public function __construct(Configuration $configuration) |
|
31 | |||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | 6 | public static function getSubscribedEvents() |
|
40 | |||
41 | |||
42 | 6 | public function registerMigrations(ConsoleCommandEvent $event) |
|
53 | |||
54 | |||
55 | /** |
||
56 | * @return bool |
||
57 | */ |
||
58 | 6 | private function isMigrationCommand(Command $command) |
|
62 | |||
63 | } |
||
1 ignored issue
–
show
|
|||
64 |