Guzzle   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A request() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Conia\Chuck\Psr;
6
7
use Conia\Chuck\Exception\RuntimeException;
8
use GuzzleHttp\Psr7\HttpFactory;
9
use GuzzleHttp\Psr7\ServerRequest;
10
use Psr\Http\Message\ServerRequestInterface as PsrServerRequest;
11
use Throwable;
12
13
/** @psalm-api */
14
class Guzzle extends AbstractFactory
15
{
16 3
    public function __construct()
17
    {
18
        try {
19 3
            $this->streamFactory = $this->responseFactory = new HttpFactory();
20
            // @codeCoverageIgnoreStart
21
        } catch (Throwable) {
22
            throw new RuntimeException('Install guzzlehttp/psr7');
23
            // @codeCoverageIgnoreEnd
24
        }
25
    }
26
27 2
    public function request(): PsrServerRequest
28
    {
29 2
        return ServerRequest::fromGlobals();
30
    }
31
}
32