1 | <?php |
||
2 | |||
3 | /** |
||
4 | * MIT License |
||
5 | * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
||
6 | */ |
||
7 | |||
8 | namespace SprykerEco\Zed\Ratepay\Business\Api\Converter; |
||
9 | |||
10 | use Generated\Shared\Transfer\RatepayInstallmentConfigurationResponseTransfer; |
||
11 | use SprykerEco\Zed\Ratepay\Business\Api\Constants; |
||
12 | use SprykerEco\Zed\Ratepay\Business\Api\Model\Payment\Configuration; |
||
13 | use SprykerEco\Zed\Ratepay\Business\Api\Model\Response\ResponseInterface; |
||
14 | use SprykerEco\Zed\Ratepay\Dependency\Facade\RatepayToMoneyInterface; |
||
15 | |||
16 | class InstallmentConfigurationResponseConverter extends BaseConverter |
||
17 | { |
||
18 | /** |
||
19 | * @var \SprykerEco\Zed\Ratepay\Business\Api\Model\Payment\Calculation |
||
20 | */ |
||
21 | protected $request; |
||
22 | |||
23 | /** |
||
24 | * @var \SprykerEco\Zed\Ratepay\Business\Api\Converter\TransferObjectConverter |
||
25 | */ |
||
26 | protected $responseTransfer; |
||
27 | |||
28 | /** |
||
29 | * @param \SprykerEco\Zed\Ratepay\Business\Api\Model\Response\ResponseInterface $response |
||
30 | * @param \SprykerEco\Zed\Ratepay\Dependency\Facade\RatepayToMoneyInterface $moneyFacade |
||
31 | * @param \SprykerEco\Zed\Ratepay\Business\Api\Converter\TransferObjectConverter $responseTransferConverter |
||
32 | * @param \SprykerEco\Zed\Ratepay\Business\Api\Model\Payment\Configuration $request |
||
33 | */ |
||
34 | public function __construct( |
||
35 | ResponseInterface $response, |
||
36 | RatepayToMoneyInterface $moneyFacade, |
||
37 | TransferObjectConverter $responseTransferConverter, |
||
38 | Configuration $request |
||
39 | ) { |
||
40 | parent::__construct($response, $moneyFacade); |
||
41 | |||
42 | $this->responseTransfer = $responseTransferConverter; |
||
43 | $this->request = $request; |
||
0 ignored issues
–
show
|
|||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return \Generated\Shared\Transfer\RatepayInstallmentConfigurationResponseTransfer |
||
48 | */ |
||
49 | public function convert() |
||
50 | { |
||
51 | $baseResponse = $this->responseTransfer->convert(); |
||
52 | |||
53 | $responseTransfer = new RatepayInstallmentConfigurationResponseTransfer(); |
||
54 | $responseTransfer |
||
55 | ->setBaseResponse($baseResponse); |
||
56 | |||
57 | $successCode = Constants::REQUEST_CODE_SUCCESS_MATRIX[Constants::REQUEST_MODEL_CONFIGURATION_REQUEST]; |
||
58 | if ($successCode == $baseResponse->getResultCode()) { |
||
59 | $responseTransfer |
||
60 | ->setInterestrateMin($this->response->getInterestrateMin()) |
||
61 | ->setInterestrateDefault($this->response->getInterestrateDefault()) |
||
62 | ->setInterestrateMax($this->response->getInterestrateMax()) |
||
63 | ->setInterestRateMerchantTowardsBank($this->response->getInterestRateMerchantTowardsBank()) |
||
64 | ->setMonthNumberMin($this->response->getMonthNumberMin()) |
||
65 | ->setMonthNumberMax($this->response->getMonthNumberMax()) |
||
66 | ->setMonthLongrun($this->response->getMonthLongrun()) |
||
67 | ->setAmountMinLongrun($this->response->getAmountMinLongrun()) |
||
68 | ->setMonthAllowed($this->response->getMonthAllowed()) |
||
69 | ->setValidPaymentFirstdays($this->response->getValidPaymentFirstdays()) |
||
70 | ->setPaymentFirstday($this->response->getPaymentFirstday()) |
||
71 | ->setPaymentAmount($this->response->getPaymentAmount()) |
||
72 | ->setPaymentLastrate($this->response->getPaymentLastrate()) |
||
73 | ->setRateMinNormal($this->response->getRateMinNormal()) |
||
74 | ->setRateMinLongrun($this->response->getRateMinLongrun()) |
||
75 | ->setServiceCharge($this->response->getServiceCharge()) |
||
76 | ->setMinDifferenceDueday($this->response->getMinDifferenceDueday()); |
||
77 | } |
||
78 | |||
79 | return $responseTransfer; |
||
80 | } |
||
81 | } |
||
82 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..