Completed
Pull Request — dev (#9)
by Andrey
07:05 queued 03:19
created

IpnArrayConverter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A convert() 0 5 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\Ipn;
9
10
class IpnArrayConverter implements IpnConverterInterface
11
{
12
    /**
13
     * @var \SprykerEco\Zed\AmazonPay\Business\Api\Converter\Ipn\IpnConverterFactoryInterface
14
     */
15
    protected $ipnConverterFactory;
16
17
    /**
18
     * @param \SprykerEco\Zed\AmazonPay\Business\Api\Converter\Ipn\IpnConverterFactoryInterface $ipnConverterFactory
19
     */
20
    public function __construct(IpnConverterFactoryInterface $ipnConverterFactory)
21
    {
22
        $this->ipnConverterFactory = $ipnConverterFactory;
23
    }
24
25
    /**
26
     * @param array $request
27
     * @param string $body
28
     *
29
     * @return \Spryker\Shared\Kernel\Transfer\AbstractTransfer
30
     */
31
    public function convert(array $request, $body)
32
    {
33
        return $this->ipnConverterFactory
34
            ->getIpnRequestConverter($request)
35
            ->convert($request, $body);
36
    }
37
}
38