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.

Middleware   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A pre() 0 8 1
A post() 0 8 1
A error() 0 8 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Middleware\Skeleton;
4
5
use ApiClients\Foundation\Middleware\MiddlewareInterface;
6
use Psr\Http\Message\RequestInterface;
7
use Psr\Http\Message\ResponseInterface;
8
use React\Promise\CancellablePromiseInterface;
9
use Throwable;
10
use function React\Promise\reject;
11
use function React\Promise\resolve;
12
13
final class Middleware implements MiddlewareInterface
14
{
15
    /**
16
     * Return the processed $request via a fulfilled promise.
17
     * When implementing cache or other feature that returns a response, do it with a rejected promise.
18
     * If neither is possible, e.g. on some kind of failure, resolve the unaltered request.
19
     *
20
     * @param  RequestInterface            $request
21
     * @param  string                      $transactionId
22
     * @param  array                       $options
23
     * @return CancellablePromiseInterface
24
     */
25 2
    public function pre(
26
        RequestInterface $request,
27
        string $transactionId,
28
        array $options = []
29
    ): CancellablePromiseInterface {
30
        // TODO: Implement pre() method or add PreTrait and remove this method
31 2
        return resolve($request);
32
    }
33
34
    /**
35
     * Return the processed $response via a promise.
36
     *
37
     * @param  ResponseInterface           $response
38
     * @param  string                      $transactionId
39
     * @param  array                       $options
40
     * @return CancellablePromiseInterface
41
     */
42 1
    public function post(
43
        ResponseInterface $response,
44
        string $transactionId,
45
        array $options = []
46
    ): CancellablePromiseInterface {
47
        // TODO: Implement post() method. Or add PostTrait and remove this method
48 1
        return resolve($response);
49
    }
50
51
    /**
52
     * Deal with possible errors that occurred during request/response events.
53
     *
54
     * @param  Throwable                   $throwable
55
     * @param  string                      $transactionId
56
     * @param  array                       $options
57
     * @return CancellablePromiseInterface
58
     */
59 1
    public function error(
60
        Throwable $throwable,
61
        string $transactionId,
62
        array $options = []
63
    ): CancellablePromiseInterface {
64
        // TODO: Implement error() method. Or add ErrorTrait and remove this method
65 1
        return reject($throwable);
66
    }
67
}
68