Test Failed
Push — splits-transaction-status-to-c... ( 9fccda...66d580 )
by Kiet
01:36
created

getHttpRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Omnipay\IcepayPayments\Message;
4
5
use Omnipay\Common\Message\ResponseInterface;
6
use Symfony\Component\HttpFoundation\Request;
7
8
/**
9
 * The request for completing the authorise and capture at Icepay.
10
 */
11
class CompleteAuthoriseAndCaptureRequest extends AbstractRequest
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 1
    public function getData(): array
17
    {
18 1
        $data = parent::getData();
19
20 1
        $data['ContractProfileId'] = $this->getContractProfileId();
21
22 1
        return $data;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function sendData($data): ResponseInterface
29
    {
30 1
        $this->sendRequest(
31 1
            Request::METHOD_POST,
32 1
            sprintf(
33 1
                '/transaction/%s',
34 1
                $this->getTransactionReference()
35
            ),
36 1
            $data
37
        );
38
39 1
        $response = array_merge(
40 1
            $this->getResponseBody(),
41
            [
42 1
                'statusCode' => $this->getResponse()->getStatusCode(),
0 ignored issues
show
Bug introduced by
The method getStatusCode() does not exist on Omnipay\Common\Message\ResponseInterface. ( Ignorable by Annotation )

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

42
                'statusCode' => $this->getResponse()->/** @scrutinizer ignore-call */ getStatusCode(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
43
            ]
44
        );
45
46 1
        return new CompleteAuthoriseAndCaptureResponse(
47 1
            $this,
48 1
            $response
49
        );
50
    }
51
52
    /**
53
     * Get the HttpRequest.
54
     *
55
     * @return Request
56
     */
57
    public function getHttpRequest(): Request
58
    {
59
        return $this->httpRequest;
60
    }
61
}
62