Conditions | 3 |
Paths | 3 |
Total Lines | 24 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | #[Route('/finish', name: 'finish', defaults: ['step' => 3])] |
||
19 | public function default(Request $request): Response |
||
20 | { |
||
21 | // @codeCoverageIgnoreStart |
||
22 | if ($request->getMethod() === Request::METHOD_POST) { |
||
23 | $self = $_SERVER['SCRIPT_FILENAME']; |
||
24 | \assert(\is_string($self)); |
||
25 | |||
26 | $redirectUrl = $request->getBasePath() . '/admin'; |
||
27 | |||
28 | // Below this line call only php native functions as we deleted our own files already |
||
29 | unlink($self); |
||
30 | |||
31 | if (\function_exists('opcache_reset')) { |
||
32 | opcache_reset(); |
||
33 | } |
||
34 | |||
35 | header('Content-Type: text/html; charset=utf-8'); |
||
36 | echo '<script>window.location.href = "' . $redirectUrl . '" </script>'; |
||
37 | exit; |
||
38 | } |
||
39 | // @codeCoverageIgnoreEnd |
||
40 | |||
41 | return $this->render('finish.html.twig'); |
||
42 | } |
||
44 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: