Passed
Push — feature/eco-3656/eco-3658-enab... ( 202423...b8179e )
by
unknown
06:13
created

mapSalesOrderItemToComputopSalesOrderItemTransfer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace SprykerEco\Zed\Computop\Persistence\Propel\Mapper;
4
5
use Generated\Shared\Transfer\ComputopPaymentComputopTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...PaymentComputopTransfer 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...
6
use Generated\Shared\Transfer\ComputopSalesOrderItemCollectionTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...rItemCollectionTransfer 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...
7
use Generated\Shared\Transfer\ComputopSalesOrderItemTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...pSalesOrderItemTransfer 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...
8
use Orm\Zed\Computop\Persistence\SpyPaymentComputop;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Computop\Persistence\SpyPaymentComputop 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...
9
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...
10
use Propel\Runtime\Collection\Collection;
11
12
class ComputopMapper
13
{
14
    /**
15
     * @param SpyPaymentComputop $computopPaymentEntity
16
     * @param ComputopPaymentComputopTransfer $computopPaymentTransfer
17
     * @return ComputopPaymentComputopTransfer
18
     */
19
    public function mapComputopPaymentEntityToComputopPaymentTransfer(
20
        SpyPaymentComputop $computopPaymentEntity,
21
        ComputopPaymentComputopTransfer $computopPaymentTransfer
22
    ): ComputopPaymentComputopTransfer
23
    {
24
        $computopPaymentTransfer->fromArray($computopPaymentEntity->toArray(), true);
25
26
        return $computopPaymentTransfer;
27
    }
28
29
    /**
30
     * @param Collection $salesOrderItemsCollection
31
     * @param ComputopSalesOrderItemCollectionTransfer $computopSalesOrderItemCollectionTransfer
32
     *
33
     * @return ComputopSalesOrderItemCollectionTransfer[]
34
     */
35
    public function mapSalesOrderItemsCollectionToComputopSalesOrderItemCollectionTransfer(
36
        Collection $salesOrderItemsCollection,
37
        ComputopSalesOrderItemCollectionTransfer $computopSalesOrderItemCollectionTransfer
0 ignored issues
show
Unused Code introduced by
The parameter $computopSalesOrderItemCollectionTransfer 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

37
        /** @scrutinizer ignore-unused */ ComputopSalesOrderItemCollectionTransfer $computopSalesOrderItemCollectionTransfer

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...
38
    ): array
39
    {
40
        $computopSalesOrderItemCollectionTransfers = [];
41
        foreach ($salesOrderItemsCollection as $salesOrderItem) {
42
            $computopSalesOrderItemTransfer = $this->
43
            mapSalesOrderItemToComputopSalesOrderItemTransfer($salesOrderItem, new ComputopSalesOrderItemTransfer());
44
            $computopSalesOrderItemCollectionTransfers[] = $computopSalesOrderItemTransfer;
45
        }
46
47
        return $computopSalesOrderItemCollectionTransfers;
48
    }
49
50
    /**
51
     * @param SpySalesOrderItem $salesOrderItem
52
     * @param ComputopSalesOrderItemTransfer $computopSalesOrderItemTransfer
53
     *
54
     * @return ComputopSalesOrderItemTransfer
55
     */
56
    public function mapSalesOrderItemToComputopSalesOrderItemTransfer(
57
        SpySalesOrderItem $salesOrderItem,
58
        ComputopSalesOrderItemTransfer $computopSalesOrderItemTransfer
59
    ): ComputopSalesOrderItemTransfer
60
    {
61
        $computopSalesOrderItemTransfer->fromArray($salesOrderItem->toArray(), true);
62
63
        return $computopSalesOrderItemTransfer;
64
    }
65
66
    public function map()
67
    {
68
69
    }
70
}
71