Total Complexity | 3 |
Total Lines | 42 |
Duplicated Lines | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
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 |
||
23 | View Code Duplication | class GetTag implements ServiceInterface |
|
24 | { |
||
25 | /** |
||
26 | * @var TagRepository |
||
27 | */ |
||
28 | private $tagRepository; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private $uuid; |
||
34 | |||
35 | /** |
||
36 | * @var LoggerInterface |
||
37 | */ |
||
38 | private $logger; |
||
39 | |||
40 | /** |
||
41 | * GetTag constructor. |
||
42 | * @param TagRepository $tagRepository |
||
43 | * @param UuidInterface $uuid |
||
44 | * @param LoggerInterface $logger |
||
45 | */ |
||
46 | public function __construct(TagRepository $tagRepository, UuidInterface $uuid, LoggerInterface $logger) |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return stdClass|boolean |
||
55 | */ |
||
56 | public function run() |
||
67 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..