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

AbstractAuthorizeOrderConverter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A setBody() 0 7 1
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
abstract class AbstractAuthorizeOrderConverter extends AbstractResponseParserConverter
13
{
14
    const AUTHORIZATION_DETAILS = 'AuthorizationDetails';
15
    /**
16
     * @var \SprykerEco\Zed\AmazonPay\Business\Api\Converter\ArrayConverterInterface $authDetailsConverter
17
     */
18
    protected $authDetailsConverter;
19
20
    /**
21
     * @param \SprykerEco\Zed\AmazonPay\Business\Api\Converter\ArrayConverterInterface $authDetailsConverter
22
     */
23
    public function __construct(ArrayConverterInterface $authDetailsConverter)
24
    {
25
        $this->authDetailsConverter = $authDetailsConverter;
26
    }
27
28
    /**
29
     * @param \Generated\Shared\Transfer\AmazonpayResponseTransfer $responseTransfer
30
     * @param array $response
31
     *
32
     * @return \Generated\Shared\Transfer\AmazonpayResponseTransfer
33
     */
34
    protected function setBody(AmazonpayResponseTransfer $responseTransfer, array $response)
35
    {
36
        $responseTransfer->setAuthorizationDetails(
37
            $this->authDetailsConverter->convert($this->extractResult($response)[static::AUTHORIZATION_DETAILS])
38
        );
39
40
        return parent::setBody($responseTransfer, $response);
41
    }
42
}
43