IssuedInvoiceApiModel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 184
Duplicated Lines 11.96 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 22
loc 184
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getModelMap() 0 6 1
A getEnumMap() 9 9 1
A getDateMap() 13 13 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 Fousky\Component\iDoklad\Model\IssuedInvoices;
4
5
use Fousky\Component\iDoklad\LOV\EetResponsibilityEnum;
6
use Fousky\Component\iDoklad\LOV\ExportedStateEnum;
7
use Fousky\Component\iDoklad\LOV\PaymentStatusEnum;
8
use Fousky\Component\iDoklad\LOV\VatOnPayStatusEnum;
9
use Fousky\Component\iDoklad\Model\iDokladAbstractModel;
10
11
/**
12
 * @method null|string getAttachmentFileName()
13
 * @method null|float getBaseTaxBasicRate()
14
 * @method null|float getBaseTaxBasicRateHc()
15
 * @method null|float getBaseTaxReducedRate1()
16
 * @method null|float getBaseTaxReducedRate1Hc()
17
 * @method null|float getBaseTaxReducedRate2()
18
 * @method null|float getBaseTaxReducedRate2Hc()
19
 * @method null|float getBaseTaxZeroRate()
20
 * @method null|float getBaseTaxZeroRateHc()
21
 * @method null|int getConstantSymbolId()
22
 * @method null|int getCurrencyId()
23
 * @method null|\DateTime getDateLastChange()
24
 * @method null|\DateTime getDateOfAccountingEvent()
25
 * @method null|\DateTime getDateOfIssue()
26
 * @method null|\DateTime getDateOfLastReminder()
27
 * @method null|\DateTime getDateOfMaturity()
28
 * @method null|\DateTime getDateOfPayment()
29
 * @method null|\DateTime getDateOfTaxing()
30
 * @method null|\DateTime getDateOfVatApplication()
31
 * @method null|string getDescription()
32
 * @method null|float getDiscount()
33
 * @method null|string getDocumentNumber()
34
 * @method null|int getDocumentSerialNumber()
35
 * @method null|EetResponsibilityEnum getEetResponsibility()
36
 * @method null|float getExchangeRate()
37
 * @method null|float getExchangeRateAmount()
38
 * @method null|ExportedStateEnum getExported()
39
 * @method null|int getId()
40
 * @method null|bool getIsEet()
41
 * @method null|bool getIsSentToAccountant()
42
 * @method null|bool getIsSentToPurchaser()
43
 * @method null|IssuedInvoiceItemApiModel[] getIssuedInvoiceItems()
44
 * @method null|string getItemsTextPrefix()
45
 * @method null|string getItemsTextSuffix()
46
 * @method null|int getLanguageId()
47
 * @method null|int getMaturity()
48
 * @method null|int getMyCompanyDocumentAdrressId()
49
 * @method null|string getNote()
50
 * @method null|int getNumericSequenceId()
51
 * @method null|string getOrderNumber()
52
 * @method null|int getPaymentOptionId()
53
 * @method null|PaymentStatusEnum getPaymentStatus()
54
 * @method null|int getPurchaserDocumentAddressId()
55
 * @method null|int getPurchaserId()
56
 * @method null|int getRemindersCount()
57
 * @method null|string getReportColorValue()
58
 * @method null|int getReportId()
59
 * @method null|float getRoundingDifference()
60
 * @method null|float getTaxBasicRate()
61
 * @method null|float getTaxBasicRateHc()
62
 * @method null|float getTaxReducedRate1()
63
 * @method null|float getTaxReducedRate1Hc()
64
 * @method null|float getTaxReducedRate2()
65
 * @method null|float getTaxReducedRate2Hc()
66
 * @method null|float getTotalBasicRate()
67
 * @method null|float getTotalBasicRateHc()
68
 * @method null|float getTotalReducedRate1()
69
 * @method null|float getTotalReducedRate1Hc()
70
 * @method null|float getTotalReducedRate2()
71
 * @method null|float getTotalReducedRate2Hc()
72
 * @method null|float getTotalVat()
73
 * @method null|float getTotalVatHc()
74
 * @method null|float getTotalWithoutVat()
75
 * @method null|float getTotalWithoutVatHc()
76
 * @method null|float getTotalWithVat()
77
 * @method null|float getTotalWithVatHc()
78
 * @method null|string getVariableSymbol()
79
 * @method null|VatOnPayStatusEnum getVatOnPayStatus()
80
 * @method null|float getVatRateBasic()
81
 * @method null|float getVatRateReduced1()
82
 * @method null|float getVatRateReduced2()
83
 *
84
 * @author Lukáš Brzák <[email protected]>
85
 */
86
class IssuedInvoiceApiModel extends iDokladAbstractModel
87
{
88
    public $AttachmentFileName;
89
90
    public $BaseTaxBasicRate;
91
92
    public $BaseTaxBasicRateHc;
93
94
    public $BaseTaxReducedRate1;
95
96
    public $BaseTaxReducedRate1Hc;
97
98
    public $BaseTaxReducedRate2;
99
100
    public $BaseTaxReducedRate2Hc;
101
102
    public $BaseTaxZeroRate;
103
104
    public $BaseTaxZeroRateHc;
105
106
    public $ConstantSymbolId;
107
108
    public $CurrencyId;
109
110
    public $DateLastChange;
111
112
    public $DateOfAccountingEvent;
113
114
    public $DateOfIssue;
115
116
    public $DateOfLastReminder;
117
118
    public $DateOfMaturity;
119
120
    public $DateOfPayment;
121
122
    public $DateOfTaxing;
123
124
    public $DateOfVatApplication;
125
126
    public $Description;
127
128
    public $Discount;
129
130
    public $DocumentNumber;
131
132
    public $DocumentSerialNumber;
133
134
    public $EetResponsibility;
135
136
    public $ExchangeRate;
137
138
    public $ExchangeRateAmount;
139
140
    public $Exported;
141
142
    public $Id;
143
144
    public $IsEet;
145
146
    public $IsSentToAccountant;
147
148
    public $IsSentToPurchaser;
149
150
    public $IssuedInvoiceItems;
151
152
    public $ItemsTextPrefix;
153
154
    public $ItemsTextSuffix;
155
156
    public $LanguageId;
157
158
    public $Maturity;
159
160
    public $MyCompanyDocumentAdrressId;
161
162
    public $Note;
163
164
    public $NumericSequenceId;
165
166
    public $OrderNumber;
167
168
    public $PaymentOptionId;
169
170
    public $PaymentStatus;
171
172
    public $PurchaserDocumentAddressId;
173
174
    public $PurchaserId;
175
176
    public $RemindersCount;
177
178
    public $ReportColorValue;
179
180
    public $ReportId;
181
182
    public $RoundingDifference;
183
184
    public $TaxBasicRate;
185
186
    public $TaxBasicRateHc;
187
188
    public $TaxReducedRate1;
189
190
    public $TaxReducedRate1Hc;
191
192
    public $TaxReducedRate2;
193
194
    public $TaxReducedRate2Hc;
195
196
    public $TotalBasicRate;
197
198
    public $TotalBasicRateHc;
199
200
    public $TotalReducedRate1;
201
202
    public $TotalReducedRate1Hc;
203
204
    public $TotalReducedRate2;
205
206
    public $TotalReducedRate2Hc;
207
208
    public $TotalVat;
209
210
    public $TotalVatHc;
211
212
    public $TotalWithoutVat;
213
214
    public $TotalWithoutVatHc;
215
216
    public $TotalWithVat;
217
218
    public $TotalWithVatHc;
219
220
    public $VariableSymbol;
221
222
    public $VatOnPayStatus;
223
224
    public $VatRateBasic;
225
226
    public $VatRateReduced1;
227
228
    public $VatRateReduced2;
229
230
    /**
231
     * @return array
232
     */
233
    public static function getModelMap(): array
234
    {
235
        return [
236
            'IssuedInvoiceItems' => IssuedInvoiceItemApiModel::class,
237
        ];
238
    }
239
240
    /**
241
     * @return array
242
     */
243 View Code Duplication
    public static function getEnumMap(): array
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...
244
    {
245
        return [
246
            'EetResponsibility' => EetResponsibilityEnum::class,
247
            'Exported' => ExportedStateEnum::class,
248
            'PaymentStatus' => PaymentStatusEnum::class,
249
            'VatOnPayStatus' => VatOnPayStatusEnum::class,
250
        ];
251
    }
252
253
    /**
254
     * @return array
255
     */
256 View Code Duplication
    public static function getDateMap(): array
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...
257
    {
258
        return [
259
            'DateLastChange',
260
            'DateOfAccountingEvent',
261
            'DateOfIssue',
262
            'DateOfLastReminder',
263
            'DateOfMaturity',
264
            'DateOfPayment',
265
            'DateOfTaxing',
266
            'DateOfVatApplication',
267
        ];
268
    }
269
}
270