GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Response   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isSuccessful() 0 8 2
A getTransactionReference() 0 6 2
A getMessage() 0 6 2
1
<?php
2
3
namespace Omnipay\Tithely\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
use Omnipay\Common\Message\RequestInterface;
7
8
/**
9
 * Response
10
 */
11
class Response 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
        if (isset($this->data['status'])) {
22
            return $this->data['status'] === 'success';
23
        }
24
25
        return false;
26
    }
27
28
    public function getTransactionReference()
29
    {
30
        if (isset($this->data['charge_id'])) {
31
            return $this->data['charge_id'];
32
        }
33
    }
34
35
    public function getMessage()
36
    {
37
        if (isset($this->data['reason'])) {
38
            return $this->data['reason'];
39
        }
40
    }
41
}
42