| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function fetchRequest(): ?ServerRequestInterface |
||
| 30 | { |
||
| 31 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { |
||
| 32 | 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 |