1 | <?php |
||
10 | abstract class Profile |
||
11 | { |
||
12 | protected $directives = []; |
||
13 | |||
14 | protected $reportOnly = false; |
||
15 | |||
16 | abstract public function configure(); |
||
17 | |||
18 | public function addDirective(string $directive, string $value): self |
||
19 | { |
||
20 | $this->guardAgainstInvalidDirectives($directive); |
||
21 | |||
22 | $this->directives[$directive][] = $value; |
||
23 | |||
24 | return $this; |
||
25 | } |
||
26 | |||
27 | public function reportOnly(): self |
||
33 | |||
34 | public function enforce(): self |
||
40 | |||
41 | public function reportTo(string $uri): self |
||
55 | |||
56 | public function shouldBeApplied(Request $request, Response $response): bool |
||
60 | |||
61 | public function addNonceForDirective(string $directive): self |
||
62 | { |
||
65 | |||
66 | public function applyTo(Response $response) |
||
80 | |||
81 | public function __toString() |
||
91 | |||
92 | protected function guardAgainstInvalidDirectives(string $directive) |
||
98 | } |
||
99 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.