Completed
Push — bugfix/ECO-1031-recent-review ( 87bde1...8236c4 )
by Andrey
04:14
created

AbstractRefundOrderConverter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 3
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 3
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\Api\Converter;
9
10
use Generated\Shared\Transfer\AmazonpayResponseTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfe...azonpayResponseTransfer 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 View Code Duplication
abstract class AbstractRefundOrderConverter extends AbstractResponseParserConverter
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    const REFUND_DETAILS = 'RefundDetails';
15
16
    /**
17
     * @var \SprykerEco\Zed\AmazonPay\Business\Api\Converter\ArrayConverterInterface $refundDetailsConverter
18
     */
19
    protected $refundDetailsConverter;
20
21
    /**
22
     * @param \SprykerEco\Zed\AmazonPay\Business\Api\Converter\ArrayConverterInterface $refundDetailsConverter
23
     */
24
    public function __construct(ArrayConverterInterface $refundDetailsConverter)
25
    {
26
        $this->refundDetailsConverter = $refundDetailsConverter;
27
    }
28
29
    /**
30
     * @param \Generated\Shared\Transfer\AmazonpayResponseTransfer $responseTransfer
31
     * @param array $response
32
     *
33
     * @return \Generated\Shared\Transfer\AmazonpayResponseTransfer
34
     */
35
    protected function setBody(AmazonpayResponseTransfer $responseTransfer, array $response)
36
    {
37
        $responseTransfer->setRefundDetails(
38
            $this->refundDetailsConverter->convert($this->extractResult($response)[static::REFUND_DETAILS])
39
        );
40
41
        return parent::setBody($responseTransfer, $response);
42
    }
43
}
44