DataAssignObserver::execute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 1
dl 0
loc 11
rs 10
c 0
b 0
f 0
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