ProformaInvoicePatchModel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 119
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDateMap() 8 8 1
A getModelMap() 6 6 1
A getEnumMap() 6 6 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\ProformaInvoices;
4
5
use Fousky\Component\iDoklad\LOV\VatOnPayStatusEnum;
6
use Fousky\Component\iDoklad\Model\iDokladAbstractModel;
7
use Fousky\Component\iDoklad\Model\IssuedInvoices\IssuedInvoiceItemApiModelUpdate;
8
use Symfony\Component\Validator\Constraints as Assert;
9
10
/**
11
 * @method null|string getAccountNumber()
12
 * @method null|int getBankId()
13
 * @method null|string getBankName()
14
 * @method null|string getBankNumberCode()
15
 * @method null|int getConstantSymbolId()
16
 * @method null|int getCurrencyId()
17
 * @method null|\DateTime getDateOfIssue()
18
 * @method null|\DateTime getDateOfMaturity()
19
 * @method null|\DateTime getDateOfPayment()
20
 * @method null|string getDescription()
21
 * @method null|float getExchangeRate()
22
 * @method null|float getExchangeRateAmount()
23
 * @method null|string getIban()
24
 * @method null|bool getIsProformaTaxed()
25
 * @method null|string getItemsTextPrefix()
26
 * @method null|string getItemsTextSuffix()
27
 * @method null|string getLanguageCode()
28
 * @method null|string getNote()
29
 * @method null|string getOrderNumber()
30
 * @method null|int getPaymentOptionId()
31
 * @method null|IssuedInvoiceItemApiModelUpdate[] getProformaInvoiceItems()
32
 * @method null|int getPurchaserId()
33
 * @method null|string getReportColorValue()
34
 * @method null|string getSwift()
35
 * @method null|string getVariableSymbol()
36
 * @method null|VatOnPayStatusEnum getVatOnPayStatus()
37
 *
38
 * @author Lukáš Brzák <[email protected]>
39
 */
40 View Code Duplication
class ProformaInvoicePatchModel extends iDokladAbstractModel
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...
41
{
42
    /** @Assert\Type(type="string") */
43
    public $AccountNumber;
44
45
    /** @Assert\Type(type="int") */
46
    public $BankId;
47
48
    /** @Assert\Type(type="string") */
49
    public $BankName;
50
51
    /** @Assert\Type(type="string") */
52
    public $BankNumberCode;
53
54
    /** @Assert\Type(type="int") */
55
    public $ConstantSymbolId;
56
57
    /** @Assert\Type(type="int") */
58
    public $CurrencyId;
59
60
    /** @Assert\DateTime() */
61
    public $DateOfIssue;
62
63
    /** @Assert\DateTime() */
64
    public $DateOfMaturity;
65
66
    /** @Assert\DateTime() */
67
    public $DateOfPayment;
68
69
    /** @Assert\Type(type="string") */
70
    public $Description;
71
72
    /** @Assert\Type(type="float") */
73
    public $ExchangeRate;
74
75
    /** @Assert\Type(type="float") */
76
    public $ExchangeRateAmount;
77
78
    /** @Assert\Type(type="string") */
79
    public $Iban;
80
81
    /** @Assert\Type(type="bool") */
82
    public $IsProformaTaxed;
83
84
    /** @Assert\Type(type="string") */
85
    public $ItemsTextPrefix;
86
87
    /** @Assert\Type(type="string") */
88
    public $ItemsTextSuffix;
89
90
    /** @Assert\Type(type="string") */
91
    public $LanguageCode;
92
93
    /** @Assert\Type(type="string") */
94
    public $Note;
95
96
    /** @Assert\Type(type="string") */
97
    public $OrderNumber;
98
99
    /** @Assert\Type(type="int") */
100
    public $PaymentOptionId;
101
102
    /**
103
     * @var IssuedInvoiceItemApiModelUpdate[]
104
     *
105
     * @Assert\All(constraints={
106
     *     @Assert\Type(type="Fousky\Component\iDoklad\Model\IssuedInvoices\IssuedInvoiceItemApiModelUpdate"),
107
     * })
108
     * @Assert\Valid(traverse=true)
109
     */
110
    public $ProformaInvoiceItems;
111
112
    /** @Assert\Type(type="int") */
113
    public $PurchaserId;
114
115
    /** @Assert\Type(type="string") */
116
    public $ReportColorValue;
117
118
    /** @Assert\Type(type="string") */
119
    public $Swift;
120
121
    /** @Assert\Type(type="string") */
122
    public $VariableSymbol;
123
124
    /** @Assert\Type(type="Fousky\Component\iDoklad\LOV\VatOnPayStatusEnum") */
125
    public $VatOnPayStatus;
126
127
    /**
128
     * @return array
129
     */
130
    public static function getDateMap(): array
131
    {
132
        return [
133
            'DateOfIssue',
134
            'DateOfMaturity',
135
            'DateOfPayment',
136
        ];
137
    }
138
139
    /**
140
     * @return array
141
     */
142
    public static function getModelMap(): array
143
    {
144
        return [
145
            'ProformaInvoiceItems' => IssuedInvoiceItemApiModelUpdate::class,
146
        ];
147
    }
148
149
    /**
150
     * @return array
151
     */
152
    public static function getEnumMap(): array
153
    {
154
        return [
155
            'VatOnPayStatus' => VatOnPayStatusEnum::class,
156
        ];
157
    }
158
}
159