Conditions | 5 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 11.1035 |
Changes | 0 |
1 | <?php |
||
22 | 9 | public function fetchRequest(): ?ServerRequestInterface |
|
23 | { |
||
24 | 9 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { |
|
25 | 9 | return null; |
|
26 | } |
||
27 | |||
28 | if ($this->container->has(ServerRequestInterface::class)) { |
||
29 | /** @psalm-suppress MixedAssignment */ |
||
30 | $result = $this->container->get(ServerRequestInterface::class); |
||
31 | |||
32 | if ($result instanceof ServerRequestInterface) { |
||
33 | return $result; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | return (new RequestFetcher())->fetchRequest(); |
||
38 | } |
||
40 |