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