Completed
Push — master ( d47f9a...e8ab44 )
by Oleksandr
15s queued 12s
created

getApiLogByOrderReferenceAndType()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 9
rs 10
c 1
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\ArvatoRss\Business\Reader;
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 SprykerEco\Zed\ArvatoRss\Persistence\ArvatoRssRepositoryInterface;
12
13
class ArvatoRssReader implements ArvatoRssReaderInterface
14
{
15
    /**
16
     * @var \SprykerEco\Zed\ArvatoRss\Persistence\ArvatoRssRepositoryInterface
17
     */
18
    protected $repository;
19
20
    /**
21
     * @param \SprykerEco\Zed\ArvatoRss\Persistence\ArvatoRssRepositoryInterface $repository
22
     */
23
    public function __construct(ArvatoRssRepositoryInterface $repository)
24
    {
25
        $this->repository = $repository;
26
    }
27
28
    /**
29
     * @param string $reference
30
     * @param string $callType
31
     *
32
     * @return \Generated\Shared\Transfer\ArvatoRssApiCallLogTransfer
33
     */
34
    public function getApiLogByOrderReferenceAndType(string $reference, string $callType): ArvatoRssApiCallLogTransfer
35
    {
36
        $apiLog = $this->repository->findApiLogByOrderReferenceAndType($reference, $callType);
37
38
        if ($apiLog === null) {
39
            return new ArvatoRssApiCallLogTransfer();
40
        }
41
42
        return $apiLog;
43
    }
44
}
45