Total Complexity | 4 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class CheckoutPaymentChecker implements CheckoutPaymentCheckerInterface |
||
16 | { |
||
17 | protected const ERROR_MESSAGE_INVALID_PARAMETER_NONCE = 'Parameter `NONCE` is invalid.'; |
||
18 | |||
19 | /** |
||
20 | * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
||
21 | * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer |
||
22 | * |
||
23 | * @return bool |
||
24 | */ |
||
25 | public function isQuotePaymentValid( |
||
26 | QuoteTransfer $quoteTransfer, |
||
27 | CheckoutResponseTransfer $checkoutResponseTransfer |
||
28 | ): bool { |
||
29 | $paymentTransfer = $quoteTransfer |
||
30 | ->requirePayment() |
||
31 | ->getPayment(); |
||
32 | if ($paymentTransfer->getPaymentProvider() !== BraintreeConfig::PROVIDER_NAME) { |
||
33 | return true; |
||
34 | } |
||
35 | |||
36 | $braintreePaymentTransfer = $paymentTransfer |
||
37 | ->requireBraintree() |
||
38 | ->getBraintree(); |
||
39 | if (!$braintreePaymentTransfer->getNonce()) { |
||
40 | $checkoutResponseTransfer |
||
41 | ->setIsSuccess(false) |
||
42 | ->addError($this->createCheckoutErrorTransfer()); |
||
43 | |||
44 | return false; |
||
45 | } |
||
46 | |||
47 | return true; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return \Generated\Shared\Transfer\CheckoutErrorTransfer |
||
52 | */ |
||
53 | protected function createCheckoutErrorTransfer(): CheckoutErrorTransfer |
||
57 | } |
||
58 | } |
||
59 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths