Address   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 91
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 91
rs 10
c 0
b 0
f 0
wmc 8

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getCity() 0 3 1
A getStreet() 0 3 1
A jsonSerialize() 0 9 2
A setStreet() 0 5 1
A setCity() 0 5 1
A setZipCode() 0 5 1
A getZipCode() 0 3 1
1
<?php
2
3
namespace ShopperLibrary\ObjectModule\Properties\Base;
4
5
/**
6
 * Class Address
7
 * @package ShopperLibrary\ObjectModule\Properties\Base
8
 */
9
class Address implements \JsonSerializable
10
{
11
    /**
12
     * @var string $street
13
     */
14
    protected $street;
15
16
    /**
17
     * @var string $city
18
     */
19
    protected $city;
20
21
    /**
22
     * @var string $zipCode
23
     */
24
    protected $zipCode;
25
26
    /**
27
     * @return string
28
     */
29
    public function getStreet()
30
    {
31
        return $this->street;
32
    }
33
34
    /**
35
     * @param string $street
36
     *
37
     * @return Address
38
     */
39
    public function setStreet($street)
40
    {
41
        $this->street = $street;
42
43
        return $this;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getCity()
50
    {
51
        return $this->city;
52
    }
53
54
    /**
55
     * @param string $city
56
     *
57
     * @return Address
58
     */
59
    public function setCity($city)
60
    {
61
        $this->city = $city;
62
63
        return $this;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getZipCode()
70
    {
71
        return $this->zipCode;
72
    }
73
74
    /**
75
     * @param string $zipCode
76
     *
77
     * @return Address
78
     */
79
    public function setZipCode($zipCode)
80
    {
81
        $this->zipCode = $zipCode;
82
83
        return $this;
84
    }
85
86
    /**
87
     * Encode protected properties
88
     *
89
     * @return array
90
     */
91
    public function jsonSerialize()
92
    {
93
        $object = array();
94
95
        foreach ($this as $key => $value) {
96
            $object[$key] = $value;
97
        }
98
99
        return $object;
100
    }
101
}
102