Total Complexity | 5 |
Total Lines | 65 |
Duplicated Lines | 100 % |
Changes | 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 |
||
17 | View Code Duplication | class GenerateAdditionalImageDocumentResponse implements PaazlResultInterface |
|
1 ignored issue
–
show
|
|||
18 | { |
||
19 | /** |
||
20 | * @var errorType |
||
21 | */ |
||
22 | protected $error = null; |
||
23 | |||
24 | /** |
||
25 | * @var additionalDocumentContainerType |
||
26 | */ |
||
27 | protected $document = null; |
||
28 | |||
29 | /** |
||
30 | * Constructor. |
||
31 | * |
||
32 | * @var errorType |
||
33 | * @var additionalDocumentContainerType $document |
||
34 | * |
||
35 | * @param mixed $error |
||
36 | * @param mixed $document |
||
37 | */ |
||
38 | public function __construct($error, $document) |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return errorType |
||
46 | */ |
||
47 | public function getError() |
||
48 | { |
||
49 | return $this->error; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param errorType $error |
||
54 | * |
||
55 | * @return $this |
||
56 | */ |
||
57 | public function setError($error) |
||
58 | { |
||
59 | $this->error = $error; |
||
60 | |||
61 | return $this; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return additionalDocumentContainerType |
||
66 | */ |
||
67 | public function getDocument() |
||
68 | { |
||
69 | return $this->document; |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @param additionalDocumentContainerType $document |
||
74 | * |
||
75 | * @return $this |
||
76 | */ |
||
77 | public function setDocument($document) |
||
82 | } |
||
83 | } |
||
84 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.