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 |
||
| 8 | class AppGateway extends Alipay |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * [getMethod description]. |
||
| 12 | * |
||
| 13 | * @author yansongda <[email protected]> |
||
| 14 | * |
||
| 15 | * @version 2017-08-10 |
||
| 16 | * |
||
| 17 | * @return [type] [description] |
||
|
|
|||
| 18 | */ |
||
| 19 | protected function getPayMethod() |
||
| 23 | |||
| 24 | /** |
||
| 25 | * [getProductCode description]. |
||
| 26 | * |
||
| 27 | * @author yansongda <[email protected]> |
||
| 28 | * |
||
| 29 | * @version 2017-08-10 |
||
| 30 | * |
||
| 31 | * @return [type] [description] |
||
| 32 | */ |
||
| 33 | protected function getPayProductCode() |
||
| 37 | |||
| 38 | /** |
||
| 39 | * [pay description]. |
||
| 40 | * |
||
| 41 | * @author yansongda <[email protected]> |
||
| 42 | * |
||
| 43 | * @version 2017-08-16 |
||
| 44 | * |
||
| 45 | * @param array $config_biz 业务参数 |
||
| 46 | * |
||
| 47 | * @return [type] [description] |
||
| 48 | */ |
||
| 49 | View Code Duplication | public function pay(array $config_biz = []) |
|
| 59 | } |
||
| 60 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.