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::pre()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 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