Completed
Push — master ( 7ff989...da7649 )
by
unknown
27s queued 12s
created

ErrorStep   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A postCondition() 0 3 1
A requireInput() 0 3 1
A execute() 0 3 1
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 SprykerShop\Yves\CheckoutPage\Process\Steps;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
11
use Spryker\Shared\Kernel\Transfer\AbstractTransfer;
12
use Symfony\Component\HttpFoundation\Request;
13
14
class ErrorStep extends AbstractBaseStep
15
{
16
    /**
17
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
18
     *
19
     * @return bool
20
     */
21
    public function requireInput(AbstractTransfer $quoteTransfer): bool
22
    {
23
        return true;
24
    }
25
26
    /**
27
     * @param \Symfony\Component\HttpFoundation\Request $request
28
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
29
     *
30
     * @return \Generated\Shared\Transfer\QuoteTransfer
31
     */
32
    public function execute(Request $request, AbstractTransfer $quoteTransfer): QuoteTransfer
33
    {
34
        return $quoteTransfer->setOrderReference(null);
0 ignored issues
show
Bug introduced by
The method setOrderReference() 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

34
        return $quoteTransfer->/** @scrutinizer ignore-call */ setOrderReference(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...
35
    }
36
37
    /**
38
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
39
     *
40
     * @return bool
41
     */
42
    public function postCondition(AbstractTransfer $quoteTransfer): bool
43
    {
44
        return $quoteTransfer->getOrderReference() === null;
0 ignored issues
show
Bug introduced by
The method getOrderReference() 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

44
        return $quoteTransfer->/** @scrutinizer ignore-call */ getOrderReference() === 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...
45
    }
46
}
47