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 |
||
20 | final class PHPCRPagerProvider implements PagerProviderInterface |
||
21 | { |
||
22 | const ENTITY_ALIAS = 'a'; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $objectClass; |
||
28 | |||
29 | /** |
||
30 | * @var ManagerRegistry |
||
31 | */ |
||
32 | private $doctrine; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $baseOptions; |
||
38 | |||
39 | /** |
||
40 | * @var RegisterListenersService |
||
41 | */ |
||
42 | private $registerListenersService; |
||
43 | |||
44 | /** |
||
45 | * @param ManagerRegistry $doctrine |
||
46 | * @param RegisterListenersService $registerListenersService |
||
47 | * @param string $objectClass |
||
48 | * @param array $baseOptions |
||
49 | */ |
||
50 | View Code Duplication | public function __construct(ManagerRegistry $doctrine, RegisterListenersService $registerListenersService, $objectClass, array $baseOptions) |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | View Code Duplication | public function provide(array $options = array()) |
|
78 | } |
||
79 |
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.