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 |
||
14 | class Directive implements DirectiveInterface |
||
15 | { |
||
16 | |||
17 | use ArgumentsAwareObjectTrait; |
||
|
|||
18 | use AutoNameTrait; |
||
19 | |||
20 | protected $isFinal = false; |
||
21 | |||
22 | 3 | View Code Duplication | public function __construct(array $config = []) |
31 | |||
32 | 3 | public function build(DirectiveConfig $config) |
|
36 | |||
37 | public function addArguments($argumentsList) |
||
41 | |||
42 | } |
||
43 |
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.