Basic   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 15 1
1
<?php
2
3
namespace Spatie\Csp\Policies;
4
5
use Spatie\Csp\Directive;
6
use Spatie\Csp\Keyword;
7
8
class Basic extends Policy
9
{
10
    public function configure()
11
    {
12
        $this
13
            ->addDirective(Directive::BASE, Keyword::SELF)
14
            ->addDirective(Directive::CONNECT, Keyword::SELF)
15
            ->addDirective(Directive::DEFAULT, Keyword::SELF)
16
            ->addDirective(Directive::FORM_ACTION, Keyword::SELF)
17
            ->addDirective(Directive::IMG, Keyword::SELF)
18
            ->addDirective(Directive::MEDIA, Keyword::SELF)
19
            ->addDirective(Directive::OBJECT, Keyword::NONE)
20
            ->addDirective(Directive::SCRIPT, Keyword::SELF)
21
            ->addDirective(Directive::STYLE, Keyword::SELF)
22
            ->addNonceForDirective(Directive::SCRIPT)
23
            ->addNonceForDirective(Directive::STYLE);
24
    }
25
}
26