EditMaterialRequest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 80
wmc 6
lcom 0
cbo 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getMaterialId() 0 4 1
A getNewName() 0 4 1
A getNewCode() 0 4 1
A getCategory() 0 4 1
A getUnit() 0 4 1
1
<?php
2
/**
3
 * (c) Tomasz Kunicki <[email protected]>
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
namespace Domain\Material\UseCase\EditMaterial;
9
10
use Domain\Category\Entity\CategoryInterface;
11
use Domain\Unit\Enitity\UnitInterface;
12
13
/**
14
 * Class EditMaterialRequest
15
 *
16
 * @package Domain\Material\UseCase\EditMaterial
17
 */
18
class EditMaterialRequest
19
{
20
    /** @var  int */
21
    private $materialId;
22
23
    /** @var  string */
24
    private $newName;
25
26
    /** @var  string */
27
    private $newCode;
28
29
    /** @var  CategoryInterface */
30
    private $category;
31
32
    /** @var  UnitInterface */
33
    private $unit;
34
35
    /**
36
     * EditMaterialRequest constructor.
37
     *
38
     * @param int $materialId
39
     * @param string $newName
40
     * @param string $newCode
41
     * @param CategoryInterface $category
42
     * @param UnitInterface $unit
43
     */
44
    public function __construct(
45
        $materialId,
46
        $newName,
47
        $newCode,
48
        CategoryInterface $category,
49
        UnitInterface $unit = null
50
    ) {
51
        $this->materialId = $materialId;
52
        $this->newName = $newName;
53
        $this->newCode = $newCode;
54
        $this->category = $category;
55
        $this->unit = $unit;
56
    }
57
58
    /**
59
     * @return int
60
     */
61
    public function getMaterialId()
62
    {
63
        return $this->materialId;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getNewName()
70
    {
71
        return $this->newName;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getNewCode()
78
    {
79
        return $this->newCode;
80
    }
81
82
    /**
83
     * @return CategoryInterface
84
     */
85
    public function getCategory()
86
    {
87
        return $this->category;
88
    }
89
90
    /**
91
     * @return UnitInterface|null
92
     */
93
    public function getUnit()
94
    {
95
        return $this->unit;
96
    }
97
}