WSPurchaseRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 8 2
A sendData() 0 5 1
1
<?php
2
3
namespace Omnipay\Komerci\Message;
4
5
/**
6
 * Komerci Authorize Request
7
 */
8
class WSPurchaseRequest extends WSAuthorizeRequest
9
{
10
11 2
    public function getData()
12
    {
13 2
        $data = parent::getData();
14 2
        $data['Transacao'] = $this->getInstallments() > 1 ? '08' : '04'; // Note: 04 - à vista; 08 - parcelado estabelecimento; 06 - Parcelado emissor
15 2
        $data['Parcelas'] = $this->getFormattedInstallments();
16
17 2
        return $data;
18
    }
19
20 2
    public function sendData($data)
21
    {
22 2
        $httpResponse = $this->prepareSendData($data, 'GetAuthorized');
23 2
        return $this->response = new WSAuthorizeResponse($this, $httpResponse->xml());
0 ignored issues
show
Bug introduced by
The method xml() does not seem to exist on object<Omnipay\Common\Message\RequestInterface>.

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...
24
    }
25
}
26