WarehousesFilter   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 11
Bugs 2 Features 0
Metric Value
eloc 10
c 11
b 2
f 0
dl 0
loc 48
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getTypeOfWarehouseRef() 0 4 2
A filterBicycleParking() 0 5 1
A filterPostFinance() 0 5 1
A setTypeOfWarehouseRef() 0 5 1
1
<?php
2
3
namespace Daaner\NovaPoshta\Traits;
4
5
trait WarehousesFilter
6
{
7
    protected $typeOfWarehouseRef;
8
9
    /**
10
     * Наличие парковки для велосипедов.
11
     *
12
     * @return $this
13
     */
14
    public function filterBicycleParking(): self
15
    {
16
        $this->methodProperties['BicycleParking'] = 1;
17
18
        return $this;
19
    }
20
21
    /**
22
     * Наличие PostFinance.
23
     *
24
     * @return $this
25
     */
26
    public function filterPostFinance(): self
27
    {
28
        $this->methodProperties['PostFinance'] = 1;
29
30
        return $this;
31
    }
32
33
    /**
34
     * Фильтр по типу отделения.
35
     *
36
     * @param  string  $typeOfWarehouseRef  Ref типа отделения
37
     * @return $this
38
     */
39
    public function setTypeOfWarehouseRef(string $typeOfWarehouseRef): self
40
    {
41
        $this->typeOfWarehouseRef = $typeOfWarehouseRef;
42
43
        return $this;
44
    }
45
46
    /**
47
     * @return void
48
     */
49
    public function getTypeOfWarehouseRef(): void
50
    {
51
        if ($this->typeOfWarehouseRef) {
52
            $this->methodProperties['TypeOfWarehouseRef'] = $this->typeOfWarehouseRef;
53
        }
54
    }
55
}
56