GetRegionByPhoneRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 44
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getUri() 0 3 1
A __construct() 0 3 1
A setPhone() 0 5 1
A getAvailableParams() 0 3 1
1
<?php
2
3
namespace Phrlog\Zvonok\Phone\Request;
4
5
/**
6
 * Class GetRegionByPhoneRequest
7
 */
8
class GetRegionByPhoneRequest extends BaseRequest
9
{
10
    protected const URI = '/lk/cabapi_external/api/v1/def_codes/by_phone/';
11
12
    /**
13
     * @var string
14
     */
15
    protected $phone;
16
17
    /**
18
     * GetRegionByPhoneRequest constructor.
19
     * @param string $phone
20
     */
21
    public function __construct(string $phone)
22
    {
23
        $this->phone = $phone;
24
    }
25
26
    /**
27
     * @param string $phone
28
     *
29
     * @return $this
30
     */
31
    public function setPhone(string $phone): self
32
    {
33
        $this->phone = $phone;
34
35
        return $this;
36
    }
37
38
    /**
39
     * @return array
40
     */
41
    protected function getAvailableParams(): array
42
    {
43
        return ['phone'];
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    protected function getUri(): string
50
    {
51
        return static::URI;
52
    }
53
}
54