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.

AcceptJsonMiddleware   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 18
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A pre() 0 7 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Middleware\Json;
4
5
use ApiClients\Foundation\Middleware\ErrorTrait;
6
use ApiClients\Foundation\Middleware\MiddlewareInterface;
7
use ApiClients\Foundation\Middleware\PostTrait;
8
use Psr\Http\Message\RequestInterface;
9
use React\Promise\CancellablePromiseInterface;
10
use function React\Promise\resolve;
11
12
class AcceptJsonMiddleware implements MiddlewareInterface
13
{
14
    use PostTrait;
15
    use ErrorTrait;
16
17
    /**
18
     * @param  RequestInterface            $request
19
     * @param  array                       $options
20
     * @return CancellablePromiseInterface
21
     */
22 1
    public function pre(
23
        RequestInterface $request,
24
        string $transactionId,
25
        array $options = []
26
    ): CancellablePromiseInterface {
27 1
        return resolve($request->withAddedHeader('Accept', 'application/json'));
28
    }
29
}
30