Issues (7)

src/Middleware/ValidateSignedUrl.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace Spinzar\SignedUrl\Middleware;
4
5
use Closure;
6
7
class ValidateSignedUrl
8
{
9
    /**
10
     * Handle an incoming request.
11
     *
12
     * @param \Illuminate\Http\Request $request
13
     * @param \Closure                 $next
14
     *
15
     * @return mixed
16
     */
17
    public function handle($request, Closure $next)
18
    {
19
        $urlIsSigned = app('signed-url')->validate($request->fullUrl());
0 ignored issues
show
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

19
        $urlIsSigned = /** @scrutinizer ignore-call */ app('signed-url')->validate($request->fullUrl());
Loading history...
20
21
        if (!$urlIsSigned) {
22
            abort(403);
0 ignored issues
show
The function abort was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

22
            /** @scrutinizer ignore-call */ 
23
            abort(403);
Loading history...
23
        }
24
25
        return $next($request);
26
    }
27
}
28