Completed
Push — master ( eaf845...272b76 )
by Oleksandr
13s queued 10s
created

CaptureSplitOmsCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 37
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 1
A __construct() 0 6 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\CrefoPay\Communication\Oms\Command;
9
10
use Orm\Zed\Sales\Persistence\SpySalesOrderItem;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Sales\Persistence\SpySalesOrderItem was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject;
12
use SprykerEco\Zed\CrefoPay\Business\CrefoPayFacadeInterface;
13
use SprykerEco\Zed\CrefoPay\Communication\Oms\CrefoPayOmsMapperInterface;
14
15
class CaptureSplitOmsCommand implements CrefoPayOmsCommandByItemInterface
16
{
17
    /**
18
     * @var \SprykerEco\Zed\CrefoPay\Communication\Oms\CrefoPayOmsMapperInterface
19
     */
20
    protected $mapper;
21
22
    /**
23
     * @var \SprykerEco\Zed\CrefoPay\Business\CrefoPayFacadeInterface
24
     */
25
    protected $facade;
26
27
    /**
28
     * @param \SprykerEco\Zed\CrefoPay\Communication\Oms\CrefoPayOmsMapperInterface $mapper
29
     * @param \SprykerEco\Zed\CrefoPay\Business\CrefoPayFacadeInterface $facade
30
     */
31
    public function __construct(
32
        CrefoPayOmsMapperInterface $mapper,
33
        CrefoPayFacadeInterface $facade
34
    ) {
35
        $this->mapper = $mapper;
36
        $this->facade = $facade;
37
    }
38
39
    /**
40
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $salesOrderItem
41
     * @param \Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject $data
42
     *
43
     * @return void
44
     */
45
    public function execute(SpySalesOrderItem $salesOrderItem, ReadOnlyArrayObject $data): void
46
    {
47
        $orderTransfer = $this->mapper
48
            ->mapSpySalesOrderToOrderTransfer($salesOrderItem->getOrder());
49
50
        $this->facade
51
            ->executeCaptureOmsCommand($orderTransfer, [$salesOrderItem->getIdSalesOrderItem()]);
52
    }
53
}
54