CashVoucherItemApiModelInsert   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 48
loc 48
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A getEnumMap() 7 7 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\CashVoucher;
4
5
use Fousky\Component\iDoklad\LOV\PriceTypeWithoutOnlyBaseEnum;
6
use Fousky\Component\iDoklad\LOV\VatRateTypeEnum;
7
use Fousky\Component\iDoklad\Model\iDokladAbstractModel;
8
use Symfony\Component\Validator\Constraints as Assert;
9
10
/**
11
 * @method null|float getAmount()
12
 * @method null|string getName()
13
 * @method null|float getPrice()
14
 * @method null|PriceTypeWithoutOnlyBaseEnum getPriceType()
15
 * @method null|bool getStatus()
16
 * @method null|string getVariableSymbol()
17
 * @method null|float getVatRate()
18
 * @method null|VatRateTypeEnum getVatRateType()
19
 *
20
 * @author Lukáš Brzák <[email protected]>
21
 */
22 View Code Duplication
class CashVoucherItemApiModelInsert 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...
23
{
24
    /**
25
     * @Assert\NotBlank()
26
     */
27
    public $Amount;
28
29
    /**
30
     * @Assert\NotBlank()
31
     */
32
    public $Name;
33
34
    /**
35
     * @Assert\NotBlank()
36
     */
37
    public $Price;
38
39
    public $PriceType;
40
41
    public $Status;
42
43
    public $VariableSymbol;
44
45
    public $VatRate;
46
47
    public $VatRateType;
48
49
    /**
50
     * @param array $properties
51
     *
52
     * @throws \InvalidArgumentException
53
     */
54
    public function __construct(array $properties = [])
55
    {
56
        $this->processProperties($properties);
57
    }
58
59
    /**
60
     * @return array
61
     */
62
    public static function getEnumMap(): array
63
    {
64
        return [
65
            'PriceType' => PriceTypeWithoutOnlyBaseEnum::class,
66
            'VatRateType' => VatRateTypeEnum::class,
67
        ];
68
    }
69
}
70