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.
Completed
Push — master ( ad528d...98e8f7 )
by Cees-Jan
10s
created

AcceptJsonMiddleware   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

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

1 Method

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