AbstractResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
ccs 10
cts 10
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isSuccessful() 0 4 1
A getCode() 0 4 1
A getMessage() 0 4 1
A getLongMessage() 0 4 1
A getToken() 0 4 1
1
<?php
2
3
/*
4
 * WebMoney driver for the Omnipay PHP payment processing library
5
 *
6
 * @link      https://github.com/ck-developer/omnipay-payline
7
 * @package   omnipay-payline
8
 * @license   MIT
9
 * @copyright Copyright (c) 2016 Claude Khedhiri <[email protected]>
10
 */
11
12
namespace Omnipay\Payline\Message;
13
14
/**
15
 * AbstractResponse.
16
 */
17
abstract class AbstractResponse extends \Omnipay\Common\Message\AbstractResponse
18
{
19 9
    public function isSuccessful()
20
    {
21 9
        return $this->getCode() === '00000';
22
    }
23
24 9
    public function getCode()
25
    {
26 9
        return $this->data->result->code;
27
    }
28
29 6
    public function getMessage()
30
    {
31 6
        return $this->data->result->shortMessage;
32
    }
33
34 6
    public function getLongMessage()
35
    {
36 6
        return $this->data->result->longMessage;
37
    }
38
39 6
    public function getToken()
40
    {
41 6
        return $this->data->token;
42
    }
43
}
44