Issues (185)

app/Http/Middleware/AddHeaderAccessToken.php (3 issues)

1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
7
/**
8
 * Class AddHeaderAccessToken.
9
 */
10
class AddHeaderAccessToken
11
{
12
    /**
13
     * Handle an incoming request.
14
     *
15
     * @param \Illuminate\Http\Request $request
16
     * @param \Closure                 $next
17
     *
18
     * @return mixed
19
     */
20
    public function handle($request, Closure $next)
21
    {
22
        if ($request->has('access_token')) {
0 ignored issues
show
The method has() does not exist on Illuminate\Http\Request. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        if ($request->/** @scrutinizer ignore-call */ has('access_token')) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
            $request->headers->set('Authorization', 'Bearer '.$request->get('access_token'));
0 ignored issues
show
The method get() does not exist on Illuminate\Http\Request. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
            $request->headers->set('Authorization', 'Bearer '.$request->/** @scrutinizer ignore-call */ get('access_token'));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
The property headers does not seem to exist on Illuminate\Http\Request.
Loading history...
24
        }
25
26
        return $next($request);
27
    }
28
}
29