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.

CaptureAction   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 5
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A supports() 0 3 2
A execute() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitBag\SyliusBraintreePlugin\Action;
6
7
use BitBag\SyliusBraintreePlugin\Request\Purchase;
8
use Payum\Core\Action\ActionInterface;
9
use Payum\Core\Exception\RequestNotSupportedException;
10
use Payum\Core\GatewayAwareInterface;
11
use Payum\Core\GatewayAwareTrait;
12
use Payum\Core\Request\Capture;
13
14
final class CaptureAction implements ActionInterface, GatewayAwareInterface
15
{
16
    use GatewayAwareTrait;
17
18
    public function execute($request): void
19
    {
20
        RequestNotSupportedException::assertSupports($this, $request);
21
22
        $this->gateway->execute(new Purchase($request->getModel()));
23
    }
24
25
    public function supports($request): bool
26
    {
27
        return $request instanceof Capture && $request->getModel() instanceof \ArrayAccess;
28
    }
29
}
30