Passed
Pull Request — master (#19)
by Volodymyr
05:11
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
namespace SprykerEco\Zed\ArvatoRss\Persistence;
4
5
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...
6
7
/**
8
 * @method \SprykerEco\Zed\ArvatoRss\Persistence\ArvatoRssPersistenceFactory getFactory()
9
 */
10
class ArvatoRssRepository implements ArvatoRssRepositoryInterface
11
{
12
    /**
13
     * @param string $orderReference
14
     * @param string $type
15
     *
16
     * @return ArvatoRssApiCallLogTransfer|null
17
     */
18
    public function findApiLogByOrderReferenceAndType(string $orderReference, string $type): ?ArvatoRssApiCallLogTransfer
19
    {
20
        $arvatoRssApiCallLog = $this->getFactory()->createArvatoRssApiCallLogQuery()
21
            ->filterByCallType($type)
22
            ->filterByOrderReference($orderReference)
23
            ->findOne();
24
25
        if ($arvatoRssApiCallLog === null) {
26
            return null;
27
        }
28
29
        return $this->getFactory()
30
            ->createArvatoRssPersistenceMapper()
31
            ->mapEntityToArvatoRssApiCallLogTransfer($arvatoRssApiCallLog, new ArvatoRssApiCallLogTransfer());
32
    }
33
}