PunchoutCatalogsConnectionSetupMapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A mapPunchoutCatalogConnectionSetupTransferToEntity() 0 8 1
A mapPunchoutCatalogConnectionSetupEntityToTransfer() 0 8 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\PunchoutCatalogs\Persistence\Propel\Mapper;
9
10
use Generated\Shared\Transfer\PunchoutCatalogConnectionSetupTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ConnectionSetupTransfer 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\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionSetup;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\PunchoutCatalog\...tCatalogConnectionSetup 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
13
class PunchoutCatalogsConnectionSetupMapper
14
{
15
    /**
16
     * @param \Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionSetup $punchoutCatalogConnectionSetupEntity
17
     * @param \Generated\Shared\Transfer\PunchoutCatalogConnectionSetupTransfer $punchoutCatalogConnectionSetupTransfer
18
     *
19
     * @return \Generated\Shared\Transfer\PunchoutCatalogConnectionSetupTransfer
20
     */
21
    public function mapPunchoutCatalogConnectionSetupEntityToTransfer(
22
        PgwPunchoutCatalogConnectionSetup $punchoutCatalogConnectionSetupEntity,
23
        PunchoutCatalogConnectionSetupTransfer $punchoutCatalogConnectionSetupTransfer
24
    ): PunchoutCatalogConnectionSetupTransfer {
25
        $punchoutCatalogConnectionSetupTransfer->fromArray($punchoutCatalogConnectionSetupEntity->toArray(), true);
26
        $punchoutCatalogConnectionSetupTransfer->setIdPunchoutCatalogSetup($punchoutCatalogConnectionSetupEntity->getIdPunchoutCatalogConnectionSetup());
27
28
        return $punchoutCatalogConnectionSetupTransfer;
29
    }
30
31
    /**
32
     * @param \Generated\Shared\Transfer\PunchoutCatalogConnectionSetupTransfer $punchoutCatalogConnectionSetupTransfer
33
     * @param \Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionSetup $punchoutCatalogConnectionSetupEntity
34
     *
35
     * @return \Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionSetup
36
     */
37
    public function mapPunchoutCatalogConnectionSetupTransferToEntity(
38
        PunchoutCatalogConnectionSetupTransfer $punchoutCatalogConnectionSetupTransfer,
39
        PgwPunchoutCatalogConnectionSetup $punchoutCatalogConnectionSetupEntity
40
    ): PgwPunchoutCatalogConnectionSetup {
41
        $punchoutCatalogConnectionSetupEntity->fromArray($punchoutCatalogConnectionSetupTransfer->toArray());
42
        $punchoutCatalogConnectionSetupEntity->setIdPunchoutCatalogConnectionSetup($punchoutCatalogConnectionSetupTransfer->getIdPunchoutCatalogSetup());
43
44
        return $punchoutCatalogConnectionSetupEntity;
45
    }
46
}
47