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

FullFrameGuard::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
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