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 |
||
9 | class MigrateRollbackCommand extends Command |
||
10 | { |
||
11 | use DatabaseAwareCommandTrait; |
||
12 | use MigrationAwareCommandTrait; |
||
13 | |||
14 | public static $name = 'migrate:rollback'; |
||
15 | protected $args; |
||
16 | protected $migrator; |
||
17 | protected $migrationsPath; |
||
18 | |||
19 | View Code Duplication | public function __construct(callable $outputFormatter, Args $args, Migrator $migrator, $migrationsPath) |
|
26 | |||
27 | public function run() |
||
43 | |||
44 | public static function register(Cli $cli) |
||
54 | } |
||
55 |