1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of Laravel Sense. |
||
5 | * |
||
6 | * (c) Anton Komarev <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | declare(strict_types=1); |
||
13 | |||
14 | namespace Cog\Laravel\Sense\Http\Middleware; |
||
15 | |||
16 | use Cog\Laravel\Sense\Authentication\Services\Authenticator; |
||
17 | |||
18 | class Authenticate |
||
19 | { |
||
20 | /** |
||
21 | * Handle the incoming request. |
||
22 | * |
||
23 | * @param \Illuminate\Http\Request $request |
||
24 | * @param \Closure $next |
||
25 | * @return \Illuminate\Http\Response|null |
||
26 | */ |
||
27 | public function handle($request, $next) |
||
28 | { |
||
29 | return Authenticator::check($request) ? $next($request) : abort(403); |
||
0 ignored issues
–
show
|
|||
30 | } |
||
31 | } |
||
32 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.