VoidRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 40
ccs 0
cts 22
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getEndpoint() 0 6 1
A getHttpMethod() 0 4 1
A sendData() 0 10 1
A getData() 0 4 1
1
<?php
2
3
namespace Omnipay\PaypalRest\Message;
4
5
/**
6
 * @author    Ivan Kerin <[email protected]>
7
 * @copyright 2014, Clippings Ltd.
8
 * @license   http://spdx.org/licenses/BSD-3-Clause
9
 */
10
class VoidRequest extends AbstractPaypalRequest
11
{
12
    /**
13
     * @return string
14
     */
15
    public function getEndpoint()
16
    {
17
        $this->validate('transactionReference');
18
19
        return '/payments/authorization/'.$this->getTransactionReference().'/void';
20
    }
21
22
    public function getHttpMethod()
23
    {
24
        return 'POST';
25
    }
26
27
    /**
28
     * @param  mixed        $data
29
     * @return VoidResponse
30
     */
31
    public function sendData($data)
32
    {
33
        $httpResponse = $this->sendHttpRequest($data);
34
35
        return $this->response = new VoidResponse(
36
            $this,
37
            $httpResponse->json(),
38
            $httpResponse->getStatusCode()
39
        );
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function getData()
46
    {
47
        return array();
48
    }
49
}
50