Passed
Pull Request — feature/eco-3656/dev-paypal-ex... (#40)
by
unknown
17:08 queued 08:59
created

PaymentStep::requireInput()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
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->isQuoteContainsPayPalExpressPayment($quoteTransfer);
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->isQuoteContainsPayPalExpressPayment($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
    protected function isQuoteContainsPayPalExpressPayment(QuoteTransfer $quoteTransfer): bool
48
    {
49
        return $quoteTransfer->getPayment() !== null && $quoteTransfer->getPaymentOrFail()->getComputopPayPalExpress() !== null;
50
    }
51
}
52