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 ( 17a79c...946c47 )
by Cees-Jan
11s
created

Middleware::priority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 2
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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  array                       $options
22
     * @return CancellablePromiseInterface
23
     */
24 2
    public function pre(
25
        RequestInterface $request,
26
        string $transactionId,
27
        array $options = []
28
    ): CancellablePromiseInterface {
29
        // TODO: Implement pre() method or add PreTrait and remove this method
30 2
        return resolve($request);
31
    }
32
33
    /**
34
     * Return the processed $response via a promise.
35
     *
36
     * @param  ResponseInterface           $response
37
     * @param  array                       $options
38
     * @return CancellablePromiseInterface
39
     */
40 1
    public function post(
41
        ResponseInterface $response,
42
        string $transactionId,
43
        array $options = []
44
    ): CancellablePromiseInterface {
45
        // TODO: Implement post() method. Or add PostTrait and remove this method
46 1
        return resolve($response);
47
    }
48
49
    /**
50
     * Deal with possible errors that occurred during request/response events.
51
     *
52
     * @param  Throwable                   $throwable
53
     * @param  array                       $options
54
     * @return CancellablePromiseInterface
55
     */
56 1
    public function error(
57
        Throwable $throwable,
58
        string $transactionId,
59
        array $options = []
60
    ): CancellablePromiseInterface {
61
        // TODO: Implement error() method. Or add ErrorTrait and remove this method
62 1
        return reject($throwable);
63
    }
64
}
65