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

CompletePurchaseResponse::getSessionDebug()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 5
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 8
ccs 0
cts 6
cp 0
crap 6
rs 10
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