GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

FindPaymentMethodNonceAction::execute()   A
last analyzed

Complexity

Conditions 2
Paths 3

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 2
nc 3
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitBag\SyliusBraintreePlugin\Action\Api;
6
7
use BitBag\SyliusBraintreePlugin\Request\Api\FindPaymentMethodNonce;
8
use BitBag\SyliusBraintreePlugin\Request\Api\GenerateClientToken;
9
use Braintree\Exception\NotFound;
10
use Payum\Core\Exception\RequestNotSupportedException;
11
12
final class FindPaymentMethodNonceAction extends BaseApiAwareAction
13
{
14
    public function execute($request): void
15
    {
16
        /** @var $request GenerateClientToken */
17
        RequestNotSupportedException::assertSupports($this, $request);
18
19
        try {
20
            $paymentMethodNonce = $this->api->findPaymentMethodNonce($request->getNonceString());
0 ignored issues
show
Bug introduced by
The method getNonceString() does not exist on BitBag\SyliusBraintreePl...Api\GenerateClientToken. ( Ignorable by Annotation )

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

20
            $paymentMethodNonce = $this->api->findPaymentMethodNonce($request->/** @scrutinizer ignore-call */ getNonceString());

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...
21
22
            $request->setResponse($paymentMethodNonce);
23
        } catch (NotFound $exception) {
24
            return;
25
        }
26
    }
27
28
    public function supports($request): bool
29
    {
30
        return $request instanceof FindPaymentMethodNonce;
31
    }
32
}
33