Passed
Push — feature/job-env-culture ( 009e4e )
by Tristan
21:55 queued 13:02
created

FullFrameGuard   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 16
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
namespace App\Http\Middleware;
3
4
use Closure;
5
6
class FullFrameGuard
7
{
8
    /**
9
     * Set X-FRAME-OPTIONS header to DENY
10
     *
11
     * @param  \Illuminate\Http\Request  $request
2 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
12
     * @param  \Closure  $next
2 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 17 spaces after parameter type; 2 found
Loading history...
13
     * @return mixed
14
     */
15
    public function handle($request, Closure $next) {
1 ignored issue
show
introduced by
Method \App\Http\Middleware\FullFrameGuard::handle() does not have parameter type hint for its parameter $request but it should be possible to add it based on @param annotation "\Illuminate\Http\Request".
Loading history...
Coding Style introduced by
Type hint "\Illuminate\Http\Request" missing for $request
Loading history...
16
17
        $response = $next($request);
18
19
        $response->headers->set('X-Frame-Options', 'SAMEORIGIN');
20
21
        return $response;
22
    }
23
}
24