Total Complexity | 8 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | class ContentSecurityManager { |
||
14 | |||
15 | private static NonceGenerator $nonceGenerator; |
||
16 | |||
17 | private static array $csp = []; |
||
18 | |||
19 | private static bool $reportOnly; |
||
20 | |||
21 | public static function start(string $nonceGeneratorClass = null, bool $reportOnly = false, ?callable $onNonce = null) { |
||
22 | $nonceGeneratorClass ??= NonceGenerator::class; |
||
23 | self::$nonceGenerator = new $nonceGeneratorClass($onNonce); |
||
24 | self::$reportOnly = $reportOnly; |
||
25 | } |
||
26 | |||
27 | public static function getNonce(string $name) { |
||
29 | } |
||
30 | |||
31 | public static function isStarted(): bool { |
||
33 | } |
||
34 | |||
35 | public static function addCsp(?bool $reportOnly = null): ContentSecurity { |
||
36 | return self::$csp[] = new ContentSecurity($reportOnly ?? self::$reportOnly); |
||
37 | } |
||
38 | |||
39 | public static function clearCsp() { |
||
41 | } |
||
42 | |||
43 | public static function defaultUbiquity(?bool $reportOnly = null): ContentSecurity { |
||
45 | } |
||
46 | |||
47 | public static function addHeadersToResponse(?bool $reportOnly = null): void { |
||
55 |