PurchaseResponse::isSuccessful()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
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