InvoiceFormDataProvider::getOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace Spryker\Yves\DummyMarketplacePayment\Form\DataProvider;
9
10
use Generated\Shared\Transfer\DummyMarketplacePaymentTransfer;
11
use Generated\Shared\Transfer\PaymentTransfer;
12
use Spryker\Shared\Kernel\Transfer\AbstractTransfer;
13
use Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface;
14
15
class InvoiceFormDataProvider implements StepEngineFormDataProviderInterface
16
{
17
    /**
18
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
19
     *
20
     * @return \Generated\Shared\Transfer\QuoteTransfer
21
     */
22
    public function getData(AbstractTransfer $quoteTransfer)
23
    {
24
        if (!$quoteTransfer->getPayment()) {
0 ignored issues
show
Bug introduced by
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

24
        if (!$quoteTransfer->/** @scrutinizer ignore-call */ getPayment()) {

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...
25
            $quoteTransfer->setPayment(new PaymentTransfer());
0 ignored issues
show
Bug introduced by
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

25
            $quoteTransfer->/** @scrutinizer ignore-call */ 
26
                            setPayment(new 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...
26
        }
27
28
        if ($quoteTransfer->getPayment()->getDummyMarketplacePaymentInvoice()) {
29
            return $quoteTransfer;
30
        }
31
32
        $quoteTransfer->getPayment()->setDummyMarketplacePaymentInvoice(new DummyMarketplacePaymentTransfer());
33
34
        return $quoteTransfer;
35
    }
36
37
    /**
38
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
39
     *
40
     * @return array<string, mixed>
41
     */
42
    public function getOptions(AbstractTransfer $quoteTransfer)
43
    {
44
        return [];
45
    }
46
}
47