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 |
||
19 | View Code Duplication | class MaximumConstraint extends AbstractRangeConstraint |
|
20 | { |
||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 395 | public function keywords() |
|
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | 33 | public function apply($instance, stdClass $schema, Context $context, Walker $walker) |
|
42 | } |
||
43 |