UpdateViewModel   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 65
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 4
Bugs 0 Features 3
Metric Value
wmc 6
c 4
b 0
f 3
lcom 0
cbo 1
dl 65
loc 65
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntity() 4 4 1
A setEntity() 4 4 1
A getErrors() 4 4 1
A setErrors() 4 4 1
A getInputData() 4 4 1
A setInputData() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

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
2
3
namespace Sebaks\Crud\View\Model;
4
5
use Zend\View\Model\ViewModel;
6
use T4webDomainInterface\EntityInterface;
7
8 View Code Duplication
class UpdateViewModel extends ViewModel implements UpdateViewModelInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
9
{
10
    /**
11
     * @var EntityInterface
12
     */
13
    private $entity;
14
15
    /**
16
     * @var array
17
     */
18
    private $errors;
19
20
    /**
21
     * @var array
22
     */
23
    private $inputData;
24
25
    /**
26
     * @return EntityInterface
27
     */
28
    public function getEntity()
29
    {
30
        return $this->entity;
31
    }
32
33
    /**
34
     * @param EntityInterface $entity
35
     */
36
    public function setEntity(EntityInterface $entity)
37
    {
38
        $this->entity = $entity;
39
    }
40
41
    /**
42
     * @return array
43
     */
44
    public function getErrors()
45
    {
46
        return $this->errors;
47
    }
48
49
    /**
50
     * @param array $errors
51
     */
52
    public function setErrors(array $errors)
53
    {
54
        $this->errors = $errors;
55
    }
56
57
    /**
58
     * @return array
59
     */
60
    public function getInputData()
61
    {
62
        return $this->inputData;
63
    }
64
65
    /**
66
     * @param array $inputData
67
     */
68
    public function setInputData(array $inputData)
69
    {
70
        $this->inputData = $inputData;
71
    }
72
}
73