Completed
Push — master ( 527d7b...b463b0 )
by Giancarlos
07:13
created

Summary   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 100
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 100
loc 100
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getCorrelativo() 4 4 1
A setCorrelativo() 5 5 1
A getFecGeneracion() 4 4 1
A setFecGeneracion() 5 5 1
A getFecResumen() 4 4 1
A setFecResumen() 5 5 1
A getDetails() 4 4 1
A setDetails() 5 5 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
 * Created by PhpStorm.
4
 * User: Giansalex
5
 * Date: 15/07/2017
6
 * Time: 21:59
7
 */
8
9
namespace Greenter\Xml\Model\Summary;
10
11
use Greenter\Xml\Validator\SummaryValidator;
12
use Symfony\Component\Validator\Constraints as Assert;
13
14
/**
15
 * Class Summary
16
 * @package Greenter\Xml\Model\Summary
17
 */
18 View Code Duplication
class Summary
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...
19
{
20
    use SummaryValidator;
21
22
    /**
23
     * @Assert\Length(max="3")
24
     * @var string
25
     */
26
    private $correlativo;
27
    /**
28
     * @Assert\Date()
29
     * @var \DateTime
30
     */
31
    private $fecGeneracion;
32
33
    /**
34
     * @Assert\NotBlank()
35
     * @Assert\Date()
36
     * @var \DateTime
37
     */
38
    private $fecResumen;
39
40
    /**
41
     * @Assert\Valid()
42
     * @var SummaryDetail[]
43
     */
44
    private $details;
45
46
    /**
47
     * @return string
48
     */
49 2
    public function getCorrelativo()
50
    {
51 2
        return $this->correlativo;
52
    }
53
54
    /**
55
     * @param string $correlativo
56
     * @return Summary
57
     */
58 4
    public function setCorrelativo($correlativo)
59
    {
60 4
        $this->correlativo = $correlativo;
61 4
        return $this;
62
    }
63
64
    /**
65
     * @return \DateTime
66
     */
67 2
    public function getFecGeneracion()
68
    {
69 2
        return $this->fecGeneracion;
70
    }
71
72
    /**
73
     * @param \DateTime $fecGeneracion
74
     * @return Summary
75
     */
76 4
    public function setFecGeneracion($fecGeneracion)
77
    {
78 4
        $this->fecGeneracion = $fecGeneracion;
79 4
        return $this;
80
    }
81
82
    /**
83
     * @return \DateTime
84
     */
85 2
    public function getFecResumen()
86
    {
87 2
        return $this->fecResumen;
88
    }
89
90
    /**
91
     * @param \DateTime $fecResumen
92
     * @return Summary
93
     */
94 4
    public function setFecResumen($fecResumen)
95
    {
96 4
        $this->fecResumen = $fecResumen;
97 4
        return $this;
98
    }
99
100
    /**
101
     * @return SummaryDetail[]
102
     */
103 2
    public function getDetails()
104
    {
105 2
        return $this->details;
106
    }
107
108
    /**
109
     * @param SummaryDetail[] $details
110
     * @return Summary
111
     */
112 4
    public function setDetails($details)
113
    {
114 4
        $this->details = $details;
115 4
        return $this;
116
    }
117
}