Completed
Push — master ( 5e354b...21c731 )
by Tobias
06:01
created

YandexAddress::withKind()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Geocoder package.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT License
11
 */
12
13
namespace Geocoder\Provider\Yandex\Model;
14
15
use Geocoder\Model\Address;
16
17
/**
18
 * @author Tobias Nyholm <[email protected]>
19
 */
20
final class YandexAddress extends Address
21
{
22
    /**
23
     * @var string|null
24
     */
25
    private $precision;
26
27
    /**
28
     * The name of this location.
29
     *
30
     * @var string|null
31
     */
32
    private $name;
33
34
    /**
35
     * The kind of this location.
36
     *
37
     * @var string|null
38
     */
39
    private $kind;
40
41
    /**
42
     * @return null|string
43
     */
44
    public function getPrecision()
45
    {
46
        return $this->precision;
47
    }
48
49
    /**
50
     * @param null|string $precision
51
     *
52
     * @return YandexAddress
53
     */
54 9
    public function withPrecision(string $precision = null): self
55
    {
56 9
        $new = clone $this;
57 9
        $new->precision = $precision;
58
59 9
        return $new;
60
    }
61
62
    /**
63
     * @return null|string
64
     */
65 1
    public function getName()
66
    {
67 1
        return $this->name;
68
    }
69
70
    /**
71
     * @param null|string $name
72
     *
73
     * @return YandexAddress
74
     */
75 9
    public function withName(string $name = null): self
76
    {
77 9
        $new = clone $this;
78 9
        $new->name = $name;
79
80 9
        return $new;
81
    }
82
83
    /**
84
     * @return string|null
85
     */
86 1
    public function getKind(): string
87
    {
88 1
        return $this->kind;
89
    }
90
91
    /**
92
     * @param string|null $kind
93
     *
94
     * @return YandexAddress
95
     */
96 9
    public function withKind(string $kind = null): self
97
    {
98 9
        $new = clone $this;
99 9
        $new->kind = $kind;
100
101 9
        return $new;
102
    }
103
}
104