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.

GenerateClientTokenAction   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 19 3
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\GenerateClientToken;
8
use Payum\Core\Exception\RequestNotSupportedException;
9
10
final class GenerateClientTokenAction extends BaseApiAwareAction
11
{
12
    public function execute($request): void
13
    {
14
        /** @var $request GenerateClientToken */
15
        RequestNotSupportedException::assertSupports($this, $request);
16
17
        $requestParams = [];
18
19
        $requestCustomerId = $request->getCustomerId();
20
        $requestMerchantAccountId = $request->getMerchantAccountId();
21
22
        if (null != $requestCustomerId) {
23
            $requestParams['customerId'] = $requestCustomerId;
24
        }
25
26
        if (null != $requestMerchantAccountId) {
27
            $requestParams['merchantAccountId'] = $requestMerchantAccountId;
28
        }
29
30
        $request->setResponse($this->api->generateClientToken($requestParams));
31
    }
32
33
    public function supports($request): bool
34
    {
35
        return $request instanceof GenerateClientToken;
36
    }
37
}
38