Passed
Push — feature/eco-3656/eco-3658-enab... ( bbb925...115355 )
by
unknown
05:52
created

PaymentStep   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 5
eloc 6
dl 0
loc 36
rs 10
c 1
b 1
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A requireInput() 0 8 2
A isBreadcrumbItemHidden() 0 4 1
A isQuoteContainsPayPalExpressPayment() 0 3 2
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\Computop\CheckoutPage\Process\Steps;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer 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 Spryker\Shared\Kernel\Transfer\AbstractTransfer;
12
use SprykerShop\Yves\CheckoutPage\Process\Steps\PaymentStep as SprykerShopPaymentStep;
13
14
class PaymentStep extends SprykerShopPaymentStep
15
{
16
    /**
17
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
18
     *
19
     * @return bool
20
     */
21
    public function isBreadcrumbItemHidden(AbstractTransfer $quoteTransfer): bool
22
    {
23
        /** @var \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer */
24
        return $this->quoteContainsPayPalExpressPayment($quoteTransfer);
0 ignored issues
show
Bug introduced by
The method quoteContainsPayPalExpressPayment() does not exist on SprykerEco\Yves\Computop...ocess\Steps\PaymentStep. ( Ignorable by Annotation )

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

24
        return $this->/** @scrutinizer ignore-call */ quoteContainsPayPalExpressPayment($quoteTransfer);

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
    }
26
27
    /**
28
     * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer $quoteTransfer
29
     *
30
     * @return bool
31
     */
32
    public function requireInput(AbstractTransfer $quoteTransfer)
33
    {
34
        /** @var \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer */
35
        if ($this->quoteContainsPayPalExpressPayment($quoteTransfer)) {
36
            return false;
37
        }
38
39
        return parent::requireInput($quoteTransfer);
40
    }
41
42
    /**
43
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
44
     *
45
     * @return bool
46
     */
47
    public function isQuoteContainsPayPalExpressPayment(QuoteTransfer $quoteTransfer): bool
48
    {
49
        return $quoteTransfer->getPayment() !== null && $quoteTransfer->getPaymentOrFail()->getComputopPayPalExpress() !== null;
50
    }
51
}
52