Passed
Push — master ( ff7474...c002dd )
by Gabriel
05:50
created

CompletePurchaseResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 23
ccs 0
cts 8
cp 0
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A canProcessModel() 0 3 1
A getSessionDebug() 0 8 2
1
<?php
2
3
namespace ByTIC\Payments\Gateways\Providers\PlatiOnline\Message;
4
5
use ByTIC\Omnipay\PlatiOnline\Message\CompletePurchaseResponse as AbstractCompletePurchaseResponse;
6
use ByTIC\Payments\Gateways\Providers\AbstractGateway\Message\Traits\CompletePurchaseResponseTrait;
7
8
/**
9
 * Class CompletePurchaseResponse
10
 * @package ByTIC\Payments\Gateways\Providers\PlatiOnline\Message
11
 */
12
class CompletePurchaseResponse extends AbstractCompletePurchaseResponse
13
{
14
    use CompletePurchaseResponseTrait;
15
16
    /** @noinspection PhpMissingParentCallCommonInspection
17
     * @return bool
18
     */
19
    protected function canProcessModel()
20
    {
21
        return true;
22
    }
23
24
    /**
25
     * @return []
0 ignored issues
show
Documentation Bug introduced by
The doc comment [] at position 0 could not be parsed: Unknown type name '[' at position 0 in [].
Loading history...
26
     */
27
    public function getSessionDebug()
28
    {
29
        $notification = $this->getNotification();
30
        if ($notification instanceof \SimpleXMLElement) {
0 ignored issues
show
introduced by
$notification is always a sub-type of SimpleXMLElement.
Loading history...
31
            $objJsonDocument = json_encode($notification);
32
            return json_decode($objJsonDocument, TRUE);
33
        }
34
        return [];
35
    }
36
}
37