CompletePurchaseRequest::getData()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 9
ccs 0
cts 5
cp 0
crap 12
rs 10
1
<?php
2
3
namespace ByTIC\Payments\Mobilpay\Message;
4
5
use ByTIC\Omnipay\Mobilpay\Message\CompletePurchaseRequest as AbstractCompletePurchaseRequest;
6
7
/**
8
 * Class PurchaseResponse
9
 * @package ByTIC\Payments\Mobilpay\Message
10
 *
11
 * @method CompletePurchaseResponse send
12
 */
13
class CompletePurchaseRequest extends AbstractCompletePurchaseRequest
14
{
15
    use Traits\CompletePurchaseRequestTrait;
0 ignored issues
show
introduced by
The trait ByTIC\Payments\Mobilpay\...etePurchaseRequestTrait requires some properties which are not provided by ByTIC\Payments\Mobilpay\...CompletePurchaseRequest: $query, $id
Loading history...
16
17
    /**
18
     * @inheritdoc
19
     */
20
    public function getData()
21
    {
22
        $return = parent::getData();
23
        // Add model only if has data
24
        if (count($return) && $this->validateModel()) {
25
            $return['model'] = $this->getModel();
26
        }
27
28
        return $return;
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function getModelIdFromRequest()
35
    {
36
        $modelId = $this->httpRequest->query->get('orderId');
37
38
        return $modelId;
39
    }
40
}
41