Issues (456)

Form/DataProvider/PrepaymentDataProvider.php (2 issues)

calls to non-existent methods.

Bug Major
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\Yves\Ratepay\Form\DataProvider;
9
10
use Generated\Shared\Transfer\PaymentTransfer;
11
use Generated\Shared\Transfer\RatepayPaymentPrepaymentTransfer;
12
use Spryker\Shared\Kernel\Transfer\AbstractTransfer;
13
14
class PrepaymentDataProvider extends DataProviderAbstract
15
{
16
    /**
17
     * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer|\Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
18
     *
19
     * @return \Spryker\Shared\Kernel\Transfer\AbstractTransfer|\Generated\Shared\Transfer\QuoteTransfer
20
     */
21
    public function getData(AbstractTransfer $quoteTransfer)
22
    {
23
        if ($quoteTransfer->getPayment() === null) {
0 ignored issues
show
The method getPayment() does not exist on Spryker\Shared\Kernel\Transfer\AbstractTransfer. ( Ignorable by Annotation )

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

23
        if ($quoteTransfer->/** @scrutinizer ignore-call */ getPayment() === null) {

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...
24
            $paymentTransfer = new PaymentTransfer();
25
            $paymentMethodTransfer = new RatepayPaymentPrepaymentTransfer();
26
            $paymentMethodTransfer->setPhone($this->getPhoneNumber($quoteTransfer));
27
            $paymentTransfer->setRatepayPrepayment($paymentMethodTransfer);
28
29
            $quoteTransfer->setPayment($paymentTransfer);
0 ignored issues
show
The method setPayment() does not exist on Spryker\Shared\Kernel\Transfer\AbstractTransfer. ( Ignorable by Annotation )

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

29
            $quoteTransfer->/** @scrutinizer ignore-call */ 
30
                            setPayment($paymentTransfer);

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...
30
        }
31
32
        return $quoteTransfer;
33
    }
34
}
35