PurchaseResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 25
ccs 10
cts 10
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isRedirect() 0 3 1
A isSuccessful() 0 3 1
A getRedirectMethod() 0 3 1
A getRedirectUrl() 0 3 1
A getRedirectData() 0 3 1
1
<?php
2
3
namespace Omnipay\Redsys\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
use Omnipay\Common\Message\RedirectResponseInterface;
7
8
/**
9
 * Redsys Purchase Response
10
 */
11
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface
12 2
{
13
    public function isSuccessful()
14 2
    {
15
        return false;
16
    }
17 2
18
    public function isRedirect()
19 2
    {
20
        return true;
21
    }
22 2
23
    public function getRedirectUrl()
24 2
    {
25
        return $this->getRequest()->getEndpoint();
0 ignored issues
show
Bug introduced by
The method getEndpoint() does not exist on Omnipay\Common\Message\RequestInterface. It seems like you code against a sub-type of Omnipay\Common\Message\RequestInterface such as Omnipay\Redsys\Message\PurchaseRequest. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        return $this->getRequest()->/** @scrutinizer ignore-call */ getEndpoint();
Loading history...
26
    }
27 1
28
    public function getRedirectMethod()
29 1
    {
30
        return 'POST';
31
    }
32 1
33
    public function getRedirectData()
34 1
    {
35
        return $this->data;
36
    }
37
}
38