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 |
||
24 | abstract class Filler extends Plugin implements FillerInterface |
||
|
|||
25 | { |
||
26 | /** |
||
27 | * @var Router |
||
28 | */ |
||
29 | protected $router; |
||
30 | |||
31 | /** |
||
32 | * @param ItemInterface $item |
||
33 | * |
||
34 | * @return ItemInterface |
||
35 | */ |
||
36 | 1 | View Code Duplication | public function buildMenu(ItemInterface $item) |
43 | |||
44 | /** |
||
45 | * @return Filler |
||
46 | */ |
||
47 | 6 | public function getForm() |
|
51 | |||
52 | /** |
||
53 | * @param Router $router |
||
54 | */ |
||
55 | 1 | public function setRouter(Router $router) |
|
59 | |||
60 | /** |
||
61 | * @throws \LogicException |
||
62 | * |
||
63 | * @param mixed $data |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | 2 | public function getLinkForFill($data) |
|
81 | |||
82 | /** |
||
83 | * Fill from search result. |
||
84 | * |
||
85 | * @param ItemSearch $item |
||
86 | * |
||
87 | * @return Item|null |
||
88 | */ |
||
89 | 4 | public function fillFromSearchResult(ItemSearch $item) |
|
99 | |||
100 | /** |
||
101 | * @param string $url |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | public function isSupportedUrl($url) |
||
109 | } |
||
110 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.