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 ( 1c7f7f...f34d69 )
by Sebastian
04:18
created

LocalClient::sendAsync()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Spatie\Export\Crawler;
4
5
use GuzzleHttp\Client;
6
use Nyholm\Psr7\Factory\Psr17Factory;
7
use Psr\Http\Message\RequestInterface;
8
use GuzzleHttp\Promise\FulfilledPromise;
9
use Illuminate\Http\Request as LaravelRequest;
10
use Illuminate\Contracts\Http\Kernel as HttpKernel;
11
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
12
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
13
14
class LocalClient extends Client
15
{
16
    /** @var \Illuminate\Contracts\Http\Kernel */
17
    protected $kernel;
18
19
    /** @var \Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory */
20
    protected $psrHttpFactory;
21
22
    public function __construct()
23
    {
24
        parent::__construct();
25
26
        $this->kernel = app(HttpKernel::class);
27
28
        $psr17Factory = new Psr17Factory();
29
30
        $this->psrHttpFactory = new PsrHttpFactory($psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory);
31
    }
32
    public function sendAsync(RequestInterface $request, array $options = [])
33
    {
34
        $symfonyRequest = SymfonyRequest::create(
35
            (string) $request->getUri(),
36
            $request->getMethod()
37
        );
38
39
        $response = $this->kernel->handle(
40
            LaravelRequest::createFromBase($symfonyRequest)
41
        );
42
43
        $psrResponse = $this->psrHttpFactory->createResponse($response);
44
45
        return new FulfilledPromise($psrResponse);
46
    }
47
}
48