Passed
Pull Request — dev (#9)
by Andrey
08:25 queued 04:31
created

createStatusTransfer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\AmazonPay\Business\Quote;
9
10
use Generated\Shared\Transfer\AmazonpayAuthorizationDetailsTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfe...rizationDetailsTransfer 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\AmazonpayCaptureDetailsTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfe...yCaptureDetailsTransfer 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 Generated\Shared\Transfer\AmazonpayRefundDetailsTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfe...ayRefundDetailsTransfer 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 Generated\Shared\Transfer\AmazonpayStatusTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfer\AmazonpayStatusTransfer 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...
14
use Generated\Shared\Transfer\QuoteTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer 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...
15
16
class AmazonpayDataQuoteInitializer implements QuoteUpdaterInterface
17
{
18
    /**
19
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
20
     *
21
     * @return \Generated\Shared\Transfer\QuoteTransfer
22
     */
23
    public function update(QuoteTransfer $quoteTransfer)
24
    {
25
        $quoteTransfer->getAmazonpayPayment()->setAuthorizationDetails(
26
            $this->createAmazonpayAuthorizationDetailsTransfer()
27
        );
28
29
        $quoteTransfer->getAmazonpayPayment()->setCaptureDetails(
30
            $this->createAmazonpayCaptureDetailsTransfer()
31
        );
32
33
        $quoteTransfer->getAmazonpayPayment()->setRefundDetails(
34
            $this->createAmazonpayRefundDetailsTransfer()
35
        );
36
37
        return $quoteTransfer;
38
    }
39
40
    /**
41
     * @return \Generated\Shared\Transfer\AmazonpayAuthorizationDetailsTransfer
42
     */
43
    protected function createAmazonpayAuthorizationDetailsTransfer()
44
    {
45
        $amazonpayAuthorizationDetails = new AmazonpayAuthorizationDetailsTransfer();
46
        $amazonpayAuthorizationDetails->setAuthorizationStatus($this->createStatusTransfer());
47
48
        return $amazonpayAuthorizationDetails;
49
    }
50
51
    /**
52
     * @return \Generated\Shared\Transfer\AmazonpayCaptureDetailsTransfer
53
     */
54
    protected function createAmazonpayCaptureDetailsTransfer()
55
    {
56
        $amazonpayCaptureDetails = new AmazonpayCaptureDetailsTransfer();
57
        $amazonpayCaptureDetails->setCaptureStatus($this->createStatusTransfer());
58
59
        return $amazonpayCaptureDetails;
60
    }
61
62
    /**
63
     * @return \Generated\Shared\Transfer\AmazonpayRefundDetailsTransfer
64
     */
65
    protected function createAmazonpayRefundDetailsTransfer()
66
    {
67
        $amazonpayRefundDetails = new AmazonpayRefundDetailsTransfer();
68
        $amazonpayRefundDetails->setRefundStatus($this->createStatusTransfer());
69
70
        return $amazonpayRefundDetails;
71
    }
72
73
    /**
74
     * @return \Generated\Shared\Transfer\AmazonpayStatusTransfer
75
     */
76
    protected function createStatusTransfer()
77
    {
78
        return new AmazonpayStatusTransfer();
79
    }
80
}
81