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 ApiController extends Controller |
||
10 | { |
||
11 | |||
12 | View Code Duplication | public function behaviors() |
|
26 | |||
27 | public function actions() |
||
37 | |||
38 | public function successCallback($client) |
||
42 | |||
43 | public function actionIndex() |
||
47 | } |
||
48 |
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.