Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
35 | private static function createHttpClient(string $accessToken): ClientInterface |
||
36 | { |
||
37 | $handler = new HandlerStack(); |
||
38 | $handler->setHandler(new CurlHandler()); |
||
39 | |||
40 | $handler->push(Middleware::mapRequest(function (RequestInterface $request) use ($accessToken) { |
||
41 | return $request->withHeader('Authorization', 'Bearer ' . $accessToken); |
||
42 | })); |
||
43 | |||
44 | return new GuzzleClient( |
||
45 | new \GuzzleHttp\Client(['handler' => $handler]), |
||
46 | new Production() |
||
47 | ); |
||
50 |