SubSellerIdToOrderItem   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A aroundConvert() 0 13 1
1
<?php
2
/**
3
 * Copyright © Getnet. All rights reserved.
4
 *
5
 * @author    Bruno Elisei <[email protected]>
6
 * See LICENSE for license details.
7
 */
8
9
namespace Getnet\SplitExampleMagento\Plugin\Magento\Quote\Model\Quote\Item;
10
11
use Magento\Quote\Model\Quote\Address\Item as AddressItem;
12
use Magento\Quote\Model\Quote\Item;
13
use Magento\Quote\Model\Quote\Item\ToOrderItem;
14
15
/**
16
 * Class Sub Seller Id To Order Item - Add Sub Seller Id in Item.
17
 */
18
class SubSellerIdToOrderItem
19
{
20
    /**
21
     * Around Convert.
22
     *
23
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
24
     *
25
     * @param ToOrderItem      $subject
26
     * @param \Closure         $proceed
27
     * @param Item|AddressItem $quoteItem
28
     * @param array            $data
29
     */
30
    public function aroundConvert(
31
        ToOrderItem $subject,
0 ignored issues
show
Unused Code introduced by
The parameter $subject is not used and could be removed. ( Ignorable by Annotation )

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

31
        /** @scrutinizer ignore-unused */ ToOrderItem $subject,

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
        \Closure $proceed,
33
        $quoteItem,
34
        array $data
35
    ) {
36
        $orderItem = $proceed($quoteItem, $data);
37
38
        $subSellerId = $quoteItem->getGetnetSubSellerId();
39
40
        $orderItem->setGetnetSubSellerId($subSellerId);
41
42
        return $orderItem;
43
    }
44
}
45