AddressSettlementProperty   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 95
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 21
c 2
b 1
f 1
dl 0
loc 95
rs 10
wmc 12

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getAreaRef() 0 4 2
A filterRegionRef() 0 5 1
A getWarehouse() 0 4 2
A filterAreaRef() 0 5 1
A filterRef() 0 5 1
A filterWarehouse() 0 5 1
A getRegionRef() 0 4 2
A getRef() 0 4 2
1
<?php
2
3
namespace Daaner\NovaPoshta\Traits;
4
5
trait AddressSettlementProperty
6
{
7
    protected $AreaRef;
8
    protected $RegionRef;
9
    protected $Ref;
10
    protected $Warehouse = false;
11
12
    /**
13
     * Фильтровать по области.
14
     *
15
     * @param  string  $AreaRef  Ref области
16
     * @return $this
17
     */
18
    public function filterAreaRef(string $AreaRef): self
19
    {
20
        $this->AreaRef = $AreaRef;
21
22
        return $this;
23
    }
24
25
    /**
26
     * @return void
27
     */
28
    public function getAreaRef(): void
29
    {
30
        if ($this->AreaRef) {
31
            $this->methodProperties['AreaRef'] = $this->AreaRef;
32
        }
33
    }
34
35
    /**
36
     * Фильтровать по региону.
37
     *
38
     * @param  string  $RegionRef  Ref региона
39
     * @return $this
40
     */
41
    public function filterRegionRef(string $RegionRef): self
42
    {
43
        $this->RegionRef = $RegionRef;
44
45
        return $this;
46
    }
47
48
    /**
49
     * @return void
50
     */
51
    public function getRegionRef(): void
52
    {
53
        if ($this->RegionRef) {
54
            $this->methodProperties['RegionRef'] = $this->RegionRef;
55
        }
56
    }
57
58
    /**
59
     * Фильтровать по наличию отделений.
60
     *
61
     * @return $this
62
     */
63
    public function filterWarehouse(): self
64
    {
65
        $this->Warehouse = true;
66
67
        return $this;
68
    }
69
70
    /**
71
     * @return void
72
     */
73
    public function getWarehouse(): void
74
    {
75
        if ($this->Warehouse) {
76
            $this->methodProperties['Warehouse'] = 1;
77
        }
78
    }
79
80
    /**
81
     * Фильтровать по Ref.
82
     *
83
     * @param  string  $ref  Ref фильтра
84
     * @return $this
85
     */
86
    public function filterRef(string $ref): self
87
    {
88
        $this->Ref = $ref;
89
90
        return $this;
91
    }
92
93
    /**
94
     * @return void
95
     */
96
    public function getRef(): void
97
    {
98
        if ($this->Ref) {
99
            $this->methodProperties['Ref'] = $this->Ref;
100
        }
101
    }
102
}
103