Test Failed
Push — splits-transaction-status-to-c... ( 6a53f6 )
by Kiet
02:00
created

CompleteAuthoriseAndCaptureRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 38
ccs 17
cts 17
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 7 1
A sendData() 0 21 1
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