Passed
Pull Request — master (#13)
by Dmitri
04:52
created

getPaymentEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
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 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...
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
abstract class AbstractPayolutionCommandPlugin extends AbstractPlugin
15
{
16
    /**
17
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $orderItems
18
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
19
     *
20
     * @return \Orm\Zed\Sales\Persistence\SpySalesOrderItem[]
21
     */
22
    protected function getPartialOrderItems(array $orderItems, SpySalesOrder $orderEntity): array
23
    {
24
        if (count($orderItems) < count($orderEntity->getItems())) {
25
            return $orderItems;
26
        }
27
28
        return [];
29
    }
30
31
    /**
32
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
33
     *
34
     * @return \Generated\Shared\Transfer\OrderTransfer
35
     */
36
    protected function getOrderTransfer(SpySalesOrder $orderEntity): OrderTransfer
37
    {
38
        return $this->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
        return $orderEntity->getSpyPaymentPayolutions()->getFirst();
51
    }
52
}
53