Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function catchFallback(Request $request): RedirectResponse |
||
20 | { |
||
21 | if (!config('demo-mode.enabled')) { |
||
22 | abort(404); |
||
23 | } |
||
24 | |||
25 | if (!app(DemoGuard::class)->hasDemoAccess($request)) { |
||
26 | return new RedirectResponse( |
||
27 | config('demo-mode.redirect_unauthorized_users_to_url') |
||
28 | ); |
||
29 | } |
||
30 | |||
31 | abort(404); |
||
|
|||
32 | } |
||
34 |
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: