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

CustomCsp::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 7
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
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