GetRegionByPhoneRequest::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
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