Passed
Pull Request — master (#13)
by Dmitri
07:50
created

getPartialOrderItems()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 1
b 0
f 0
cc 2
nc 2
nop 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\Payolution\Communication\Plugin\Oms\Command;
9
10
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...
11
use Spryker\Zed\Kernel\Communication\AbstractPlugin;
12
13
abstract class AbstractPayolutionCommandPlugin extends AbstractPlugin
14
{
15
    /**
16
     * @param array $orderItems
17
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
18
     *
19
     * @return array
20
     */
21
    protected function getPartialOrderItems(array $orderItems, SpySalesOrder $orderEntity): array
22
    {
23
        if (count($orderItems) < count($orderEntity->getItems())) {
24
            return $orderItems;
25
        }
26
27
        return [];
28
    }
29
30
    /**
31
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
32
     *
33
     * @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...
34
     */
35
    protected function getOrderTransfer(SpySalesOrder $orderEntity)
36
    {
37
        return $this
38
            ->getFactory()
39
            ->getSalesFacade()
0 ignored issues
show
Bug introduced by
The method getSalesFacade() does not exist on Spryker\Zed\Kernel\Commu...actCommunicationFactory. It seems like you code against a sub-type of Spryker\Zed\Kernel\Commu...actCommunicationFactory such as SprykerEco\Zed\Payolutio...ionCommunicationFactory. ( Ignorable by Annotation )

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

39
            ->/** @scrutinizer ignore-call */ getSalesFacade()
Loading history...
40
            ->getOrderByIdSalesOrder($orderEntity->getIdSalesOrder());
41
    }
42
43
    /**
44
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
45
     *
46
     * @return \Orm\Zed\Payolution\Persistence\SpyPaymentPayolution
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Payolution\Persi...ce\SpyPaymentPayolution 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...
47
     */
48
    protected function getPaymentEntity(SpySalesOrder $orderEntity)
49
    {
50
        $paymentEntity = $orderEntity->getSpyPaymentPayolutions()->getFirst();
51
52
        return $paymentEntity;
53
    }
54
}
55