Completed
Push — master ( 480dec...35e829 )
by Marco
01:15
created

CreateCustomerResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isSuccessful() 0 4 1
A getTransactionReference() 0 6 2
1
<?php
2
3
namespace Omnipay\Heidelpay\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
use Omnipay\Common\Message\RequestInterface;
7
8
/**
9
 * Response
10
 */
11
class CreateCustomerResponse extends AbstractResponse
12
{
13
    public function __construct(RequestInterface $request, $data)
14
    {
15
        $this->request = $request;
16
        $this->data = $data;
17
    }
18
19
    public function isSuccessful()
20
    {
21
        return isset($this->data['id']);
22
    }
23
24
    public function getTransactionReference()
25
    {
26
        if (isset($this->data['id'])) {
27
            return $this->data['id'];
28
        }
29
    }
30
}
31