Completed
Push — master ( 75955e...d5bb65 )
by Freek
01:22
created

InvalidCspPolicy   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
1
<?php
2
3
namespace Spatie\Csp\Exceptions;
4
5
use Exception;
6
use Spatie\Csp\Policies\Policy;
7
8
class InvalidCspPolicy extends Exception
9
{
10
    public static function create($class): self
11
    {
12
        $className = get_class($class);
13
14
        return new self("The CSP class `{$className}` is not valid. A valid policy extends ".Policy::class);
15
    }
16
}
17