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 |
||
17 | class Refunded extends Handler |
||
18 | { |
||
19 | protected $check = false; |
||
20 | |||
21 | /** |
||
22 | * @param \Closure $closure |
||
23 | * |
||
24 | * @return \Symfony\Component\HttpFoundation\Response |
||
25 | */ |
||
26 | View Code Duplication | public function handle(Closure $closure) |
|
34 | |||
35 | /** |
||
36 | * Decrypt the `req_info` from request message. |
||
37 | * |
||
38 | * @return array |
||
39 | */ |
||
40 | public function reqInfo() |
||
44 | } |
||
45 |