Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class DemoModeController extends \Illuminate\Routing\Controller |
||
9 | { |
||
10 | public function grantAccess(): RedirectResponse |
||
11 | { |
||
12 | session()->put('demo_access_route_visited', true); |
||
13 | |||
14 | return new RedirectResponse( |
||
15 | config('demo-mode.redirect_authorized_users_to_url') |
||
16 | ); |
||
17 | } |
||
18 | |||
19 | public function catchFallback(Request $request): RedirectResponse |
||
32 | } |
||
33 | } |
||
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: