ArvatoRssPersistenceMapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A mapArvatoRssApiCallLogTransferToEntity() 0 6 1
A mapEntityToArvatoRssApiCallLogTransfer() 0 3 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\ArvatoRss\Persistence\Mapper;
9
10
use Generated\Shared\Transfer\ArvatoRssApiCallLogTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...toRssApiCallLogTransfer 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\ArvatoRss\Persistence\SpyArvatoRssApiCallLog;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\ArvatoRss\Persis...\SpyArvatoRssApiCallLog 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 ArvatoRssPersistenceMapper
14
{
15
    /**
16
     * @param \Generated\Shared\Transfer\ArvatoRssApiCallLogTransfer $arvatoRssApiCallLogTransfer
17
     * @param \Orm\Zed\ArvatoRss\Persistence\SpyArvatoRssApiCallLog $spyArvatoRssApiCallLog
18
     *
19
     * @return \Orm\Zed\ArvatoRss\Persistence\SpyArvatoRssApiCallLog
20
     */
21
    public function mapArvatoRssApiCallLogTransferToEntity(ArvatoRssApiCallLogTransfer $arvatoRssApiCallLogTransfer, SpyArvatoRssApiCallLog $spyArvatoRssApiCallLog): SpyArvatoRssApiCallLog
22
    {
23
        $spyArvatoRssApiCallLog->fromArray($arvatoRssApiCallLogTransfer->modifiedToArray());
24
        $spyArvatoRssApiCallLog->setNew($arvatoRssApiCallLogTransfer->getIdPaymentArvatoRssApiCallLog() === null);
25
26
        return $spyArvatoRssApiCallLog;
27
    }
28
29
    /**
30
     * @param \Orm\Zed\ArvatoRss\Persistence\SpyArvatoRssApiCallLog $spyArvatoRssApiCallLog
31
     * @param \Generated\Shared\Transfer\ArvatoRssApiCallLogTransfer $arvatoRssApiCallLogTransfer
32
     *
33
     * @return \Generated\Shared\Transfer\ArvatoRssApiCallLogTransfer
34
     */
35
    public function mapEntityToArvatoRssApiCallLogTransfer(SpyArvatoRssApiCallLog $spyArvatoRssApiCallLog, ArvatoRssApiCallLogTransfer $arvatoRssApiCallLogTransfer): ArvatoRssApiCallLogTransfer
36
    {
37
        return $arvatoRssApiCallLogTransfer->fromArray($spyArvatoRssApiCallLog->toArray(), true);
38
    }
39
}
40