Completed
Pull Request — master (#5)
by Laurent
02:35 queued 42s
created

CreateReceiverMonthBillCommand   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 169
Duplicated Lines 12.43 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 21
loc 169
rs 10
c 0
b 0
f 0
wmc 12
lcom 1
cbo 1

12 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 21 21 1
A getReceiverId() 0 4 1
A getFlights() 0 4 1
A getMonthlyFlightBill() 0 4 1
A getBillingType() 0 4 1
A getBillType() 0 4 1
A getBillingCondition() 0 4 1
A getModelDocument() 0 4 1
A getPublicNote() 0 4 1
A getPrivateNote() 0 4 1
A getYear() 0 4 1
A getMonth() 0 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
require_once __DIR__ . '/../class/billing/monthly/MonthlyFlightBill.php';
4
require_once __DIR__.'/CommandInterface.php';
5
6
/**
7
 * @author Laurent De Coninck <[email protected]>
8
 */
9
class CreateReceiverMonthBillCommand implements CommandInterface
10
{
11
    /**
12
     * @var MonthlyFlightBill
13
     */
14
    private $monthlyFlightBill;
15
16
    /**
17
     * @var int
18
     */
19
    private $billingType;
20
21
    /**
22
     * @var int
23
     */
24
    private $billType;
25
26
    /**
27
     * @var int
28
     */
29
    private $billingCondition;
30
31
    /**
32
     * @var int
33
     */
34
    private $modelDocument;
35
36
    /**
37
     * @var string
38
     */
39
    private $publicNote;
40
41
    /**
42
     * @var string
43
     */
44
    private $privateNote;
45
46
    /**
47
     * @var int
48
     */
49
    private $year;
50
51
    /**
52
     * @var int
53
     */
54
    private $month;
55
56
    /**
57
     * @param MonthlyFlightBill $monthlyFlightBill
58
     * @param int               $billingType
59
     * @param int               $billType
60
     * @param int               $billingCondition
61
     * @param int               $modelDocument
62
     * @param string            $publicNote
63
     * @param string            $privateNote
64
     * @param int               $year
65
     * @param int               $month
66
     */
67 View Code Duplication
    public function __construct(
0 ignored issues
show
Duplication introduced by
This method 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...
68
        MonthlyFlightBill $monthlyFlightBill,
69
        $billingType,
70
        $billType,
71
        $billingCondition,
72
        $modelDocument,
73
        $publicNote,
74
        $privateNote,
75
        $year,
76
        $month
77
    ) {
78
        $this->monthlyFlightBill = $monthlyFlightBill;
79
        $this->billingType = $billingType;
80
        $this->billType = $billType;
81
        $this->billingCondition = $billingCondition;
82
        $this->modelDocument = $modelDocument;
83
        $this->publicNote = $publicNote;
84
        $this->privateNote = $privateNote;
85
        $this->year = $year;
86
        $this->month = $month;
87
    }
88
89
90
    /**
91
     * @return int
92
     */
93
    public function getReceiverId()
94
    {
95
        return $this->monthlyFlightBill->getReceiverId();
96
    }
97
98
    /**
99
     * @return array|Bbcvols[]
100
     */
101
    public function getFlights()
102
    {
103
        return $this->monthlyFlightBill->getFlights();
104
    }
105
106
    /**
107
     * @return MonthlyFlightBill
108
     */
109
    public function getMonthlyFlightBill()
110
    {
111
        return $this->monthlyFlightBill;
112
    }
113
114
    /**
115
     * @return int
116
     */
117
    public function getBillingType()
118
    {
119
        return $this->billingType;
120
    }
121
122
    /**
123
     * @return int
124
     */
125
    public function getBillType()
126
    {
127
        return $this->billType;
128
    }
129
130
    /**
131
     * @return int
132
     */
133
    public function getBillingCondition()
134
    {
135
        return $this->billingCondition;
136
    }
137
138
    /**
139
     * @return int
140
     */
141
    public function getModelDocument()
142
    {
143
        return $this->modelDocument;
144
    }
145
146
    /**
147
     * @return string
148
     */
149
    public function getPublicNote()
150
    {
151
        return $this->publicNote;
152
    }
153
154
    /**
155
     * @return string
156
     */
157
    public function getPrivateNote()
158
    {
159
        return $this->privateNote;
160
    }
161
162
    /**
163
     * @return int
164
     */
165
    public function getYear()
166
    {
167
        return $this->year;
168
    }
169
170
    /**
171
     * @return int
172
     */
173
    public function getMonth()
174
    {
175
        return $this->month;
176
    }
177
}