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 |
||
19 | class ErrorUrl extends ActiveRecord |
||
20 | { |
||
21 | public $date; |
||
22 | |||
23 | public static function tableName() |
||
27 | |||
28 | public function rules() |
||
35 | |||
36 | public function attributeLabels() |
||
44 | |||
45 | public function getErrorLog() |
||
49 | |||
50 | /** |
||
51 | * Search tasks |
||
52 | * @param $params |
||
53 | * @return ActiveDataProvider |
||
54 | */ |
||
55 | View Code Duplication | public function search($params) |
|
74 | } |
||
75 |
This method 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 method will be removed from the class and what other method or class to use instead.