Passed
Pull Request — master (#19)
by Volodymyr
07:19
created

ArvatoRssRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A findApiLogByOrderReferenceAndType() 0 14 2
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\ArvatoRss\Persistence;
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
12
/**
13
 * @method \SprykerEco\Zed\ArvatoRss\Persistence\ArvatoRssPersistenceFactory getFactory()
14
 */
15
class ArvatoRssRepository implements ArvatoRssRepositoryInterface
16
{
17
    /**
18
     * @param string $orderReference
19
     * @param string $type
20
     *
21
     * @return \Generated\Shared\Transfer\ArvatoRssApiCallLogTransfer|null
22
     */
23
    public function findApiLogByOrderReferenceAndType(string $orderReference, string $type): ?ArvatoRssApiCallLogTransfer
24
    {
25
        $arvatoRssApiCallLog = $this->getFactory()->createArvatoRssApiCallLogQuery()
26
            ->filterByCallType($type)
27
            ->filterByOrderReference($orderReference)
28
            ->findOne();
29
30
        if ($arvatoRssApiCallLog === null) {
31
            return null;
32
        }
33
34
        return $this->getFactory()
35
            ->createArvatoRssPersistenceMapper()
36
            ->mapEntityToArvatoRssApiCallLogTransfer($arvatoRssApiCallLog, new ArvatoRssApiCallLogTransfer());
37
    }
38
}
39