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 |
||
15 | class CustomerRemoveLostUserDataLaravel extends \Aimeos\MW\Setup\Task\Base |
||
16 | { |
||
17 | private $sql = [ |
||
18 | 'address' => 'DELETE FROM "users_address" WHERE NOT EXISTS ( SELECT "id" FROM "users" AS u WHERE "parentid"=u."id" )', |
||
19 | 'list' => 'DELETE FROM "users_list" WHERE NOT EXISTS ( SELECT "id" FROM "users" AS u WHERE "parentid"=u."id" )', |
||
20 | ]; |
||
21 | |||
22 | |||
23 | /** |
||
24 | * Returns the list of task names which this task depends on. |
||
25 | * |
||
26 | * @return array List of task names |
||
27 | */ |
||
28 | public function getPreDependencies() |
||
32 | |||
33 | |||
34 | /** |
||
35 | * Returns the list of task names which depends on this task. |
||
36 | * |
||
37 | * @return string[] List of task names |
||
38 | */ |
||
39 | public function getPostDependencies() |
||
43 | |||
44 | |||
45 | /** |
||
46 | * Migrate database schema |
||
47 | */ |
||
48 | public function migrate() |
||
75 | } |
||
76 |
This property has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.