DeleteCardRequest::getHttpMethod()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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 DeleteCardRequest extends AbstractPaypalRequest
11
{
12
    /**
13
     * Requires "cardReference" parameter
14
     *
15
     * @return string
16
     */
17
    public function getEndpoint()
18
    {
19
        $this->validate('cardReference');
20
21
        return '/vault/credit-card/'.$this->getCardReference();
22
    }
23
24
    public function getHttpMethod()
25
    {
26
        return 'DELETE';
27
    }
28
29
    /**
30
     * @param  mixed                                          $data
31
     * @return \Omnipay\PaypalRest\Message\DeleteCardResponse
32
     */
33
    public function sendData($data)
34
    {
35
        $httpResponse = $this->sendHttpRequest($data);
36
37
        return $this->response = new DeleteCardResponse(
38
            $this,
39
            $httpResponse->getBody(true) ? $httpResponse->json() : array(),
40
            $httpResponse->getStatusCode()
41
        );
42
    }
43
44
    /**
45
     * @return array
46
     */
47
    public function getData()
48
    {
49
        return array();
50
    }
51
}
52