Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
11 | 4 | public function create($request): RequestAdapterInterface |
|
12 | { |
||
13 | 4 | if ($request instanceof Psr7Request) { |
|
14 | 1 | return new Psr7RequestAdapter($request); |
|
15 | 3 | } elseif ($request instanceof SymfonyRequest) { |
|
16 | 1 | return new SymfonyRequestAdapter($request); |
|
17 | 2 | } elseif ($request instanceof Guzzle5Request) { |
|
18 | 1 | return new Guzzle5RequestAdapter($request); |
|
19 | } else { |
||
20 | 1 | throw new \InvalidArgumentException( |
|
21 | 1 | 'Request type not supported. Only PSR-7, Symfony or Guzzle5 requests are supported.' |
|
22 | ); |
||
23 | } |
||
24 | } |
||
25 | } |
||
26 |