Passed
Pull Request — feature/eco-3656/dev-paypal-ex... (#40)
by Andrey
10:25 queued 05:21
created

PaymentStep   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isBreadcrumbItemHidden() 0 5 2
A requireInput() 0 8 3
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 Spryker\Shared\Kernel\Transfer\AbstractTransfer;
11
use SprykerShop\Yves\CheckoutPage\Process\Steps\PaymentStep as SprykerShopPaymentStep;
12
13
class PaymentStep extends SprykerShopPaymentStep
14
{
15
    /**
16
     * @param \Generated\Shared\Transfer\QuoteTransfer $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...
17
     *
18
     * @return bool
19
     */
20
    public function isBreadcrumbItemHidden(AbstractTransfer $quoteTransfer): bool
21
    {
22
        /** @var \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer */
23
        return $quoteTransfer->getPayment() !== null
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

23
        return $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
            && $quoteTransfer->getPaymentOrFail()->getComputopPayPalExpress() !== null;
0 ignored issues
show
Bug introduced by
The method getPaymentOrFail() 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
            && $quoteTransfer->/** @scrutinizer ignore-call */ getPaymentOrFail()->getComputopPayPalExpress() !== 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...
25
    }
26
27
    /**
28
     * @param AbstractTransfer $quoteTransfer
29
     *
30
     * @return bool
31
     */
32
    public function requireInput(AbstractTransfer $quoteTransfer)
33
    {
34
        if ($quoteTransfer->getPayment() !== null
35
            && $quoteTransfer->getPaymentOrFail()->getComputopPayPalExpress() !== null) {
36
            return false;
37
        }
38
39
        return parent::requireInput($quoteTransfer);
40
    }
41
}
42