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 |
||
18 | View Code Duplication | final class LogThrowableFactory implements FactoryInterface |
|
19 | { |
||
20 | 5 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
27 | |||
28 | /** |
||
29 | * Create service |
||
30 | * |
||
31 | * @param ServiceLocatorInterface $serviceLocator |
||
32 | * @return mixed |
||
33 | */ |
||
34 | 2 | public function createService(ServiceLocatorInterface $serviceLocator) |
|
38 | } |
||
39 |
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.