AbstractComputopPlugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 13
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getOrderTransfer() 0 19 2
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Computop\Communication\Plugin\Oms\Command;
9
10
use Generated\Shared\Transfer\CustomerTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\CustomerTransfer 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 Orm\Zed\Sales\Persistence\SpySalesOrder;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Sales\Persistence\SpySalesOrder 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...
12
use Spryker\Zed\Kernel\Communication\AbstractPlugin;
13
14
/**
15
 * @method \SprykerEco\Zed\Computop\Business\ComputopFacadeInterface getFacade()
16
 * @method \SprykerEco\Zed\Computop\ComputopConfig getConfig()
17
 * @method \SprykerEco\Zed\Computop\Communication\ComputopCommunicationFactory getFactory()
18
 */
19
abstract class AbstractComputopPlugin extends AbstractPlugin
20
{
21
    /**
22
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
23
     * @param array $salesOrderItems
24
     *
25
     * @return \Generated\Shared\Transfer\OrderTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\OrderTransfer 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...
26
     */
27
    protected function getOrderTransfer(SpySalesOrder $orderEntity, array $salesOrderItems = [])
0 ignored issues
show
Unused Code introduced by
The parameter $salesOrderItems 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

27
    protected function getOrderTransfer(SpySalesOrder $orderEntity, /** @scrutinizer ignore-unused */ array $salesOrderItems = [])

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...
28
    {
29
        $orderTransfer = $this
30
            ->getFactory()
31
            ->getSalesFacade()
32
            ->getOrderByIdSalesOrder(
33
                $orderEntity->getIdSalesOrder()
34
            );
35
36
        $orderTransfer = $this
37
            ->getFactory()
38
            ->getCalculationFacade()
39
            ->recalculateOrder($orderTransfer);
40
41
        if ($orderTransfer->getCustomer() === null) {
42
            $orderTransfer->setCustomer(new CustomerTransfer());
43
        }
44
45
        return $orderTransfer;
46
    }
47
}
48