RestCancelRequest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 34
c 0
b 0
f 0
wmc 6
lcom 1
cbo 2
ccs 13
cts 13
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getEndpoint() 0 4 1
A getHttpMethod() 0 4 1
A getChargeId() 0 4 1
A setChargeId() 0 4 1
A getData() 0 6 1
A createResponse() 0 4 1
1
<?php
2
namespace Omnipay\ZipPay\Message;
3
4
class RestCancelRequest extends AbstractRequest
5
{
6 6
    protected function getEndpoint()
7
    {
8 6
        return parent::getEndpoint() . '/charges/' . $this->getChargeId() . '/cancel';
9
    }
10
11 6
    public function getHttpMethod()
12
    {
13 6
        return 'POST';
14
    }
15
16 6
    public function getChargeId()
17
    {
18 6
        return $this->getParameter('chargeId');
19
    }
20
21 6
    public function setChargeId($value)
22
    {
23 6
        return $this->setParameter('chargeId', $value);
24
    }
25
26 6
    public function getData()
27
    {
28 6
        $this->validate('chargeId');
29
30 6
        return $this->getBaseData();
31
    }
32
33 6
    protected function createResponse($data, $headers = [], $status = 404)
34
    {
35 6
        return $this->response = new RestCancelResponse($this, $data, $headers, $status);
36
    }
37
}
38