AbstractResponseSaver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 55
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPaymentEntity() 0 3 1
A __construct() 0 8 1
A setPaymentEntity() 0 3 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Computop\Business\Payment\Handler\Saver\Init;
9
10
use Spryker\Zed\Kernel\Persistence\EntityManager\TransactionTrait;
11
use SprykerEco\Zed\Computop\ComputopConfig;
12
use SprykerEco\Zed\Computop\Dependency\Facade\ComputopToOmsFacadeInterface;
13
use SprykerEco\Zed\Computop\Persistence\ComputopQueryContainerInterface;
14
15
abstract class AbstractResponseSaver implements InitResponseSaverInterface
16
{
17
    use TransactionTrait;
18
19
    /**
20
     * @var \SprykerEco\Zed\Computop\Persistence\ComputopQueryContainerInterface $queryContainer
21
     */
22
    protected $queryContainer;
23
24
    /**
25
     * @var \SprykerEco\Zed\Computop\Dependency\Facade\ComputopToOmsFacadeInterface
26
     */
27
    protected $omsFacade;
28
29
    /**
30
     * @var \Orm\Zed\Computop\Persistence\SpyPaymentComputop
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Computop\Persistence\SpyPaymentComputop 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...
31
     */
32
    protected $paymentEntity;
33
34
    /**
35
     * @var \SprykerEco\Zed\Computop\ComputopConfig
36
     */
37
    protected $config;
38
39
    /**
40
     * @param \SprykerEco\Zed\Computop\Persistence\ComputopQueryContainerInterface $queryContainer
41
     * @param \SprykerEco\Zed\Computop\Dependency\Facade\ComputopToOmsFacadeInterface $omsFacade
42
     * @param \SprykerEco\Zed\Computop\ComputopConfig $config
43
     */
44
    public function __construct(
45
        ComputopQueryContainerInterface $queryContainer,
46
        ComputopToOmsFacadeInterface $omsFacade,
47
        ComputopConfig $config
48
    ) {
49
        $this->queryContainer = $queryContainer;
50
        $this->omsFacade = $omsFacade;
51
        $this->config = $config;
52
    }
53
54
    /**
55
     * @param string $transactionId
56
     *
57
     * @return void
58
     */
59
    protected function setPaymentEntity($transactionId)
60
    {
61
        $this->paymentEntity = $this->queryContainer->queryPaymentByTransactionId($transactionId)->findOne();
62
    }
63
64
    /**
65
     * @return \Orm\Zed\Computop\Persistence\SpyPaymentComputop
66
     */
67
    protected function getPaymentEntity()
68
    {
69
        return $this->paymentEntity;
70
    }
71
}
72