Address::setCity()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Cubiche\Core\Serializer\Tests\Fixtures;
11
12
/**
13
 * Address class.
14
 *
15
 * @author Ivannis Suárez Jerez <[email protected]>
16
 */
17
class Address
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $street;
23
24
    /**
25
     * @var string
26
     */
27
    protected $zipcode;
28
29
    /**
30
     * @var string
31
     */
32
    protected $city;
33
34
    /**
35
     * Address constructor.
36
     *
37
     * @param string $street
38
     * @param string $zipcode
39
     * @param string $city
40
     */
41
    public function __construct($street, $zipcode, $city)
42
    {
43
        $this->setStreet($street);
44
        $this->setZipcode($zipcode);
45
        $this->setCity($city);
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function zipcode()
52
    {
53
        return $this->zipcode;
54
    }
55
56
    /**
57
     * @param string $zipcode
58
     */
59
    public function setZipcode($zipcode)
60
    {
61
        $this->zipcode = $zipcode;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function city()
68
    {
69
        return $this->city;
70
    }
71
72
    /**
73
     * @param string $city
74
     */
75
    public function setCity($city)
76
    {
77
        $this->city = $city;
78
    }
79
80
    /**
81
     * @return string
82
     */
83
    public function street()
84
    {
85
        return $this->street;
86
    }
87
88
    /**
89
     * @param string $street
90
     */
91
    public function setStreet($street)
92
    {
93
        $this->street = $street;
94
    }
95
96
    /**
97
     * @param Address $other
98
     *
99
     * @return bool
100
     */
101
    public function equals(Address $other)
102
    {
103
        return $this->street() == $other->street() &&
104
            $this->zipcode() == $other->zipcode() &&
105
            $this->city() == $other->city()
106
        ;
107
    }
108
}
109