Issues (20)

Business/Api/Adapter/IpnRequestAdapter.php (1 issue)

Labels
Severity
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\Adapter;
9
10
use AmazonPay\IpnHandlerInterface;
11
use SprykerEco\Zed\AmazonPay\Business\Api\Converter\Ipn\IpnConverterInterface;
12
13
class IpnRequestAdapter implements IpnRequestAdapterInterface
14
{
15
    /**
16
     * @var \AmazonPay\IpnHandlerInterface
17
     */
18
    protected $ipnHandler;
19
20
    /**
21
     * @var \SprykerEco\Zed\AmazonPay\Business\Api\Converter\Ipn\IpnConverterInterface
22
     */
23
    protected $ipnArrayConverter;
24
25
    /**
26
     * @param \AmazonPay\IpnHandlerInterface $ipnHandler
27
     * @param \SprykerEco\Zed\AmazonPay\Business\Api\Converter\Ipn\IpnConverterInterface $ipnArrayConverter
28
     */
29
    public function __construct(
30
        IpnHandlerInterface $ipnHandler,
31
        IpnConverterInterface $ipnArrayConverter
32
    ) {
33
        $this->ipnHandler = $ipnHandler;
34
        $this->ipnArrayConverter = $ipnArrayConverter;
35
    }
36
37
    /**
38
     * @param string $body
39
     *
40
     * @return \Generated\Shared\Transfer\AmazonpayIpnPaymentRequestTransfer
41
     */
42
    public function getIpnRequest($body)
43
    {
44
        return $this->ipnArrayConverter->convert(
45
            $this->ipnHandler->toArray(),
0 ignored issues
show
$this->ipnHandler->toArray() of type AmazonPay\response is incompatible with the type array expected by parameter $request of SprykerEco\Zed\AmazonPay...terInterface::convert(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

45
            /** @scrutinizer ignore-type */ $this->ipnHandler->toArray(),
Loading history...
46
            $body
47
        );
48
    }
49
}
50