Passed
Push — master ( 88c85c...f5a1ed )
by Darko
08:01
created

CustomCsp   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
dl 0
loc 12
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
1
<?php
2
3
namespace App\Policies;
4
5
use Spatie\Csp\Directive;
6
use Spatie\Csp\Policies\Basic;
7
8
class CustomCsp extends Basic
9
{
10
    /**
11
     * Create a new policy instance.
12
     */
13
    public function configure()
14
    {
15
        parent::configure();
16
        $this->addDirective(Directive::SCRIPT, 'self')
17
            ->addDirective(Directive::STYLE, 'self')
18
            ->addNonceForDirective(Directive::SCRIPT)
19
            ->addNonceForDirective(Directive::STYLE);
20
    }
21
}
22