Passed
Pull Request — feature/eco-2295/dev (#1)
by Aleksey
02:10 queued 01:12
created

savePaymentCrefoPayApiLog()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nc 1
nop 1
dl 0
loc 19
rs 9.9332
c 0
b 0
f 0
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\CrefoPayApi\Persistence;
9
10
use Generated\Shared\Transfer\PaymentCrefoPayApiLogTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...tCrefoPayApiLogTransfer 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 Generated\Shared\Transfer\SpyPaymentCrefoPayApiLogEntityTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...PayApiLogEntityTransfer 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\Persistence\AbstractEntityManager;
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\Kernel\Persi...e\AbstractEntityManager 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...
13
use SprykerEco\Zed\CrefoPayApi\Persistence\Mapper\CrefoPayApiPersistenceMapperInterface;
14
15
/**
16
 * @method \SprykerEco\Zed\CrefoPayApi\Persistence\CrefoPayApiPersistenceFactory getFactory()
17
 */
18
class CrefoPayApiEntityManager extends AbstractEntityManager implements CrefoPayApiEntityManagerInterface
19
{
20
    /**
21
     * @param \Generated\Shared\Transfer\PaymentCrefoPayApiLogTransfer $paymentCrefoPayApiLogTransfer
22
     *
23
     * @return \Generated\Shared\Transfer\PaymentCrefoPayApiLogTransfer
24
     */
25
    public function savePaymentCrefoPayApiLog(
26
        PaymentCrefoPayApiLogTransfer $paymentCrefoPayApiLogTransfer
27
    ): PaymentCrefoPayApiLogTransfer {
28
        $entityTransfer = $this->getMapper()
29
            ->mapPaymentCrefoPayApiLogTransferToEntityTransfer(
30
                $paymentCrefoPayApiLogTransfer,
31
                new SpyPaymentCrefoPayApiLogEntityTransfer()
32
            );
33
34
        /** @var \Generated\Shared\Transfer\SpyPaymentCrefoPayApiLogEntityTransfer $entityTransfer */
35
        $entityTransfer = $this->save($entityTransfer);
36
37
        $paymentCrefoPayApiLogTransfer = $this->getMapper()
38
            ->mapEntityTransferToPaymentCrefoPayApiLogTransfer(
39
                $entityTransfer,
40
                $paymentCrefoPayApiLogTransfer
41
            );
42
43
        return $paymentCrefoPayApiLogTransfer;
44
    }
45
46
    /**
47
     * @return \SprykerEco\Zed\CrefoPayApi\Persistence\Mapper\CrefoPayApiPersistenceMapperInterface
48
     */
49
    protected function getMapper(): CrefoPayApiPersistenceMapperInterface
50
    {
51
        return $this->getFactory()->createCrefoPayApiPersistenceMapper();
52
    }
53
}
54