__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 10
rs 10
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;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...urationResponseTransfer 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
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
Documentation Bug introduced by
It seems like $request of type SprykerEco\Zed\Ratepay\B...l\Payment\Configuration is incompatible with the declared type SprykerEco\Zed\Ratepay\B...del\Payment\Calculation of property $request.

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..

Loading history...
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())
0 ignored issues
show
Bug introduced by
The method getInterestrateMin() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

60
                ->setInterestrateMin($this->response->/** @scrutinizer ignore-call */ getInterestrateMin())
Loading history...
61
                ->setInterestrateDefault($this->response->getInterestrateDefault())
0 ignored issues
show
Bug introduced by
The method getInterestrateDefault() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

61
                ->setInterestrateDefault($this->response->/** @scrutinizer ignore-call */ getInterestrateDefault())
Loading history...
62
                ->setInterestrateMax($this->response->getInterestrateMax())
0 ignored issues
show
Bug introduced by
The method getInterestrateMax() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

62
                ->setInterestrateMax($this->response->/** @scrutinizer ignore-call */ getInterestrateMax())
Loading history...
63
                ->setInterestRateMerchantTowardsBank($this->response->getInterestRateMerchantTowardsBank())
0 ignored issues
show
Bug introduced by
The method getInterestRateMerchantTowardsBank() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

63
                ->setInterestRateMerchantTowardsBank($this->response->/** @scrutinizer ignore-call */ getInterestRateMerchantTowardsBank())
Loading history...
64
                ->setMonthNumberMin($this->response->getMonthNumberMin())
0 ignored issues
show
Bug introduced by
The method getMonthNumberMin() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

64
                ->setMonthNumberMin($this->response->/** @scrutinizer ignore-call */ getMonthNumberMin())
Loading history...
65
                ->setMonthNumberMax($this->response->getMonthNumberMax())
0 ignored issues
show
Bug introduced by
The method getMonthNumberMax() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

65
                ->setMonthNumberMax($this->response->/** @scrutinizer ignore-call */ getMonthNumberMax())
Loading history...
66
                ->setMonthLongrun($this->response->getMonthLongrun())
0 ignored issues
show
Bug introduced by
The method getMonthLongrun() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

66
                ->setMonthLongrun($this->response->/** @scrutinizer ignore-call */ getMonthLongrun())
Loading history...
67
                ->setAmountMinLongrun($this->response->getAmountMinLongrun())
0 ignored issues
show
Bug introduced by
The method getAmountMinLongrun() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

67
                ->setAmountMinLongrun($this->response->/** @scrutinizer ignore-call */ getAmountMinLongrun())
Loading history...
68
                ->setMonthAllowed($this->response->getMonthAllowed())
0 ignored issues
show
Bug introduced by
The method getMonthAllowed() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

68
                ->setMonthAllowed($this->response->/** @scrutinizer ignore-call */ getMonthAllowed())
Loading history...
69
                ->setValidPaymentFirstdays($this->response->getValidPaymentFirstdays())
0 ignored issues
show
Bug introduced by
The method getValidPaymentFirstdays() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

69
                ->setValidPaymentFirstdays($this->response->/** @scrutinizer ignore-call */ getValidPaymentFirstdays())
Loading history...
70
                ->setPaymentFirstday($this->response->getPaymentFirstday())
0 ignored issues
show
Bug introduced by
The method getPaymentFirstday() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. Did you maybe mean getPaymentMethod()? ( Ignorable by Annotation )

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

70
                ->setPaymentFirstday($this->response->/** @scrutinizer ignore-call */ getPaymentFirstday())

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
71
                ->setPaymentAmount($this->response->getPaymentAmount())
0 ignored issues
show
Bug introduced by
The method getPaymentAmount() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. Did you maybe mean getPaymentMethod()? ( Ignorable by Annotation )

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

71
                ->setPaymentAmount($this->response->/** @scrutinizer ignore-call */ getPaymentAmount())

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
72
                ->setPaymentLastrate($this->response->getPaymentLastrate())
0 ignored issues
show
Bug introduced by
The method getPaymentLastrate() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. Did you maybe mean getPaymentMethod()? ( Ignorable by Annotation )

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

72
                ->setPaymentLastrate($this->response->/** @scrutinizer ignore-call */ getPaymentLastrate())

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
73
                ->setRateMinNormal($this->response->getRateMinNormal())
0 ignored issues
show
Bug introduced by
The method getRateMinNormal() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

73
                ->setRateMinNormal($this->response->/** @scrutinizer ignore-call */ getRateMinNormal())
Loading history...
74
                ->setRateMinLongrun($this->response->getRateMinLongrun())
0 ignored issues
show
Bug introduced by
The method getRateMinLongrun() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

74
                ->setRateMinLongrun($this->response->/** @scrutinizer ignore-call */ getRateMinLongrun())
Loading history...
75
                ->setServiceCharge($this->response->getServiceCharge())
0 ignored issues
show
Bug introduced by
The method getServiceCharge() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...nse\CalculationResponse or SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

75
                ->setServiceCharge($this->response->/** @scrutinizer ignore-call */ getServiceCharge())
Loading history...
76
                ->setMinDifferenceDueday($this->response->getMinDifferenceDueday());
0 ignored issues
show
Bug introduced by
The method getMinDifferenceDueday() does not exist on SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface. It seems like you code against a sub-type of SprykerEco\Zed\Ratepay\B...ponse\ResponseInterface such as SprykerEco\Zed\Ratepay\B...e\ConfigurationResponse. ( Ignorable by Annotation )

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

76
                ->setMinDifferenceDueday($this->response->/** @scrutinizer ignore-call */ getMinDifferenceDueday());
Loading history...
77
        }
78
79
        return $responseTransfer;
80
    }
81
}
82