DataAssignObserver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 11 2
1
<?php
2
3
namespace Pagantis\Pagantis\Observer;
4
5
use Magento\Framework\Event\Observer;
6
use Magento\Payment\Observer\AbstractDataAssignObserver;
7
8
/**
9
 * Class DataAssignObserver
10
 * @package Pagantis\Pagantis\Observer
11
 */
12
class DataAssignObserver extends AbstractDataAssignObserver
13
{
14
    /**
15
     * @param Observer $observer
16
     *
17
     * @throws \Magento\Framework\Exception\LocalizedException
18
     */
19
    public function execute(Observer $observer)
20
    {
21
        $method = $this->readMethodArgument($observer);
22
        $data = $this->readDataArgument($observer);
23
24
        $paymentInfo = $method->getInfoInstance();
0 ignored issues
show
Deprecated Code introduced by
The function Magento\Payment\Model\Me...face::getInfoInstance() has been deprecated: 100.0.2 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

24
        $paymentInfo = /** @scrutinizer ignore-deprecated */ $method->getInfoInstance();

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
25
26
        if ($data->getDataByKey('transaction_result') !== null) {
27
            $paymentInfo->setAdditionalInformation(
28
                'transaction_result',
29
                $data->getDataByKey('transaction_result')
30
            );
31
        }
32
    }
33
}
34