Total Complexity | 7 |
Total Lines | 77 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class SimpleObjectTransfer extends \Micro\Library\DTO\Object\AbstractDto |
||
15 | { |
||
16 | #[\Symfony\Component\Validator\Constraints\LessThan(groups: ['Default'], value: 10)] |
||
17 | protected int|null $weight = null; |
||
18 | |||
19 | #[\Symfony\Component\Validator\Constraints\LessThan(groups: ['Default'], propertyPath: 'weight')] |
||
20 | protected int|null $height = null; |
||
21 | protected SimpleObjectTransfer|null $parent = null; |
||
22 | |||
23 | public function getWeight(): int|null |
||
24 | { |
||
25 | return $this->weight; |
||
26 | } |
||
27 | |||
28 | public function getHeight(): int|null |
||
29 | { |
||
30 | return $this->height; |
||
31 | } |
||
32 | |||
33 | public function getParent(): SimpleObjectTransfer|null |
||
34 | { |
||
35 | return $this->parent; |
||
36 | } |
||
37 | |||
38 | public function setWeight(int|null $weight): self |
||
39 | { |
||
40 | $this->weight = $weight; |
||
41 | |||
42 | return $this; |
||
43 | } |
||
44 | |||
45 | public function setHeight(int|null $height): self |
||
46 | { |
||
47 | $this->height = $height; |
||
48 | |||
49 | return $this; |
||
50 | } |
||
51 | |||
52 | public function setParent(SimpleObjectTransfer|null $parent): self |
||
53 | { |
||
54 | $this->parent = $parent; |
||
55 | |||
56 | return $this; |
||
57 | } |
||
58 | |||
59 | protected static function attributesMetadata(): array |
||
60 | { |
||
61 | return array ( |
||
62 | 'weight' => |
||
63 | array ( |
||
64 | 'type' => |
||
65 | array ( |
||
66 | 0 => 'int', |
||
67 | 1 => 'null', |
||
68 | ), |
||
69 | 'required' => false, |
||
70 | 'actionName' => 'weight', |
||
71 | ), |
||
72 | 'height' => |
||
73 | array ( |
||
74 | 'type' => |
||
75 | array ( |
||
76 | 0 => 'int', |
||
77 | 1 => 'null', |
||
78 | ), |
||
79 | 'required' => false, |
||
80 | 'actionName' => 'height', |
||
81 | ), |
||
82 | 'parent' => |
||
83 | array ( |
||
84 | 'type' => |
||
85 | array ( |
||
86 | 0 => 'Transfer\\Simple\\SimpleObjectTransfer', |
||
87 | 1 => 'null', |
||
88 | ), |
||
89 | 'required' => false, |
||
90 | 'actionName' => 'parent', |
||
91 | ), |
||
95 |