Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public static function create(string $className): Profile |
||
11 | { |
||
12 | $profile = app($className); |
||
13 | |||
14 | if (!is_a($profile, Profile::class, true)) { |
||
15 | throw InvalidCspProfile::create($profile); |
||
16 | } |
||
17 | |||
18 | if (! empty(config('csp.report_uri'))) { |
||
19 | $profile->reportTo(config('csp.report_uri')); |
||
20 | } |
||
21 | |||
22 | return $profile; |
||
23 | } |
||
24 | } |