Customer   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 82
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getEmail() 0 4 1
A getName() 0 4 1
A getPhone() 0 4 1
A getAddress() 0 4 1
1
<?php
2
namespace PHPSC\PagSeguro\Customer;
3
4
use JMS\Serializer\Annotation as Serializer;
5
use PHPSC\PagSeguro\SerializerTrait;
6
7
/**
8
 * @Serializer\AccessType("public_method")
9
 * @Serializer\ReadOnly
10
 * @Serializer\XmlRoot("sender")
11
 *
12
 * @author Luís Otávio Cobucci Oblonczyk <[email protected]>
13
 */
14
class Customer
15
{
16
    use SerializerTrait;
17
18
    /**
19
     * @Serializer\XmlElement(cdata=false)
20
     *
21
     * @var string
22
     */
23
    private $email;
24
25
    /**
26
     * @Serializer\XmlElement(cdata=false)
27
     *
28
     * @var string
29
     */
30
    private $name;
31
32
    /**
33
     * @Serializer\Type("PHPSC\PagSeguro\Customer\Phone")
34
     *
35
     * @var Phone
36
     */
37
    private $phone;
38
39
    /**
40
     * @Serializer\Type("PHPSC\PagSeguro\Customer\Address")
41
     *
42
     * @var Address
43
     */
44
    private $address;
45
46
    /**
47
     * @param string $email
48
     * @param string $name
49
     * @param Phone $phone
50
     * @param Address $address
51
     */
52 22
    public function __construct(
53
        $email,
54
        $name = null,
55
        Phone $phone = null,
56
        Address $address = null
57
    ) {
58 22
        $this->email = $email;
59 22
        $this->name = $name;
60 22
        $this->phone = $phone;
61 22
        $this->address = $address;
62 22
    }
63
64
    /**
65
     * @return string
66
     */
67 7
    public function getEmail()
68
    {
69 7
        return $this->email;
70
    }
71
72
    /**
73
     * @return string
74
     */
75 7
    public function getName()
76
    {
77 7
        return $this->name;
78
    }
79
80
    /**
81
     * @return Phone
82
     */
83 7
    public function getPhone()
84
    {
85 7
        return $this->phone;
86
    }
87
88
    /**
89
     * @return Address
90
     */
91 7
    public function getAddress()
92
    {
93 7
        return $this->address;
94
    }
95
}
96