ShipmentRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 12 2
A getEndpoint() 0 4 1
A createResponse() 0 4 1
1
<?php
2
namespace Omnipay\Heidelpay\Message;
3
4
/**
5
 * Charge Request
6
 *
7
 * @method Response send()
8
 */
9
class ShipmentRequest extends AbstractRequest
10
{
11
    public function getData()
12
    {
13
        $this->validate('transactionId');
14
15
        $data = [];
16
17
        if ($this->getTransactionReference()) {
18
            $data['invoiceId'] = $this->getTransactionReference();
19
        }
20
21
        return $data;
22
    }
23
24
    public function getEndpoint()
25
    {
26
        return parent::getEndpoint() . 'payments/' . $this->getTransactionId() . '/shipments';
27
    }
28
29
30
    protected function createResponse($data)
31
    {
32
        return $this->response = new ShipmentResponse($this, $data);
33
    }
34
}
35