Request   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 122
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 11
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 122
ccs 25
cts 25
cp 1
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A getPreApproval() 0 4 1
A getReference() 0 4 1
A setReference() 0 4 1
A getCustomer() 0 4 1
A setCustomer() 0 4 1
A getRedirectTo() 0 4 1
A setRedirectTo() 0 4 1
A getReviewOn() 0 4 1
A setReviewOn() 0 4 1
1
<?php
2
namespace PHPSC\PagSeguro\Requests\PreApprovals;
3
4
use JMS\Serializer\Annotation as Serializer;
5
use PHPSC\PagSeguro\Customer\Customer;
6
use PHPSC\PagSeguro\SerializerTrait;
7
8
/**
9
 * @Serializer\AccessType("public_method")
10
 * @Serializer\ReadOnly
11
 * @Serializer\XmlRoot("preApprovalRequest")
12
 *
13
 * @author Luís Otávio Cobucci Oblonczyk <[email protected]>
14
 */
15
class Request
16
{
17
    use SerializerTrait;
18
19
    /**
20
     * @Serializer\Type("PHPSC\PagSeguro\Requests\PreApprovals\PreApproval")
21
     *
22
     * @var PreApproval
23
     */
24
    private $preApproval;
25
26
    /**
27
     * @Serializer\XmlElement(cdata=false)
28
     *
29
     * @var string
30
     */
31
    private $reference;
32
33
    /**
34
     * @Serializer\Type("PHPSC\PagSeguro\Customer\Customer")
35
     * @Serializer\SerializedName("sender")
36
     *
37
     * @var Customer
38
     */
39
    private $customer;
40
41
    /**
42
     * @Serializer\XmlElement(cdata=false)
43
     * @Serializer\SerializedName("redirectURL")
44
     *
45
     * @var string
46
     */
47
    private $redirectTo;
48
49
    /**
50
     * @Serializer\XmlElement(cdata=false)
51
     * @Serializer\SerializedName("reviewURL")
52
     *
53
     * @var string
54
     */
55
    private $reviewOn;
56
57
    /**
58
     * @param PreApproval $preApproval
59
     */
60 12
    public function __construct(PreApproval $preApproval = null)
61
    {
62 12
        $this->preApproval = $preApproval ?: new PreApproval();
63 12
    }
64
65
    /**
66
     * @return PreApproval
67
     */
68 3
    public function getPreApproval()
69
    {
70 3
        return $this->preApproval;
71
    }
72
73
    /**
74
     * @return string
75
     */
76 2
    public function getReference()
77
    {
78 2
        return $this->reference;
79
    }
80
81
    /**
82
     * @param string $reference
83
     */
84 3
    public function setReference($reference)
85
    {
86 3
        $this->reference = $reference;
87 3
    }
88
89
    /**
90
     * @return Customer
91
     */
92 2
    public function getCustomer()
93
    {
94 2
        return $this->customer;
95
    }
96
97
    /**
98
     * @param Customer $customer
99
     */
100 3
    public function setCustomer(Customer $customer)
101
    {
102 3
        $this->customer = $customer;
103 3
    }
104
105
    /**
106
     * @return string
107
     */
108 2
    public function getRedirectTo()
109
    {
110 2
        return $this->redirectTo;
111
    }
112
113
    /**
114
     * @param string $redirectTo
115
     */
116 3
    public function setRedirectTo($redirectTo)
117
    {
118 3
        $this->redirectTo = $redirectTo;
119 3
    }
120
121
    /**
122
     * @return string
123
     */
124 2
    public function getReviewOn()
125
    {
126 2
        return $this->reviewOn;
127
    }
128
129
    /**
130
     * @param string $reviewOn
131
     */
132 3
    public function setReviewOn($reviewOn)
133
    {
134 3
        $this->reviewOn = $reviewOn;
135 3
    }
136
}
137