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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 11 2
A supports() 0 3 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