CommonFilter   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
c 0
b 0
f 0
dl 0
loc 88
rs 10
wmc 12

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setLength() 0 5 1
A setHeight() 0 5 1
A setVolumetricWeight() 0 5 1
A setWidth() 0 5 1
A getWidth() 0 4 2
A getVolumetricWeight() 0 4 2
A getHeight() 0 4 2
A getLength() 0 4 2
1
<?php
2
3
namespace Daaner\NovaPoshta\Traits;
4
5
trait CommonFilter
6
{
7
    protected $length;
8
    protected $width;
9
    protected $height;
10
    protected $volumetricWeight;
11
12
    /**
13
     * @param  int|string  $length  Длина
14
     * @return $this
15
     */
16
    public function setLength($length): self
17
    {
18
        $this->length = $length;
19
20
        return $this;
21
    }
22
23
    /**
24
     * @param  int|string  $width  Ширина
25
     * @return $this
26
     */
27
    public function setWidth($width): self
28
    {
29
        $this->width = $width;
30
31
        return $this;
32
    }
33
34
    /**
35
     * @param  int|string  $height  Высота
36
     * @return $this
37
     */
38
    public function setHeight($height): self
39
    {
40
        $this->height = $height;
41
42
        return $this;
43
    }
44
45
    /**
46
     * @param  int|string  $volumetricWeight  Объемный вес
47
     * @return $this
48
     */
49
    public function setVolumetricWeight($volumetricWeight): self
50
    {
51
        $this->volumetricWeight = $volumetricWeight;
52
53
        return $this;
54
    }
55
56
    /**
57
     * @return void
58
     */
59
    public function getLength(): void
60
    {
61
        if ($this->length) {
62
            $this->methodProperties['Length'] = $this->length;
63
        }
64
    }
65
66
    /**
67
     * @return void
68
     */
69
    public function getWidth(): void
70
    {
71
        if ($this->width) {
72
            $this->methodProperties['Width'] = $this->width;
73
        }
74
    }
75
76
    /**
77
     * @return void
78
     */
79
    public function getHeight(): void
80
    {
81
        if ($this->height) {
82
            $this->methodProperties['Height'] = $this->height;
83
        }
84
    }
85
86
    /**
87
     * @return void
88
     */
89
    public function getVolumetricWeight(): void
90
    {
91
        if ($this->volumetricWeight) {
92
            $this->methodProperties['VolumetricWeight'] = $this->volumetricWeight;
93
        }
94
    }
95
}
96