1 | <?php |
||
9 | |||
10 | abstract class Profile |
||
11 | { |
||
12 | protected $directives = []; |
||
13 | |||
14 | protected $reportOnly = false; |
||
15 | |||
16 | public function addDirective(string $directive, string $value): self |
||
24 | |||
25 | abstract public function registerDirectives(); |
||
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 applyTo(Response $response) |
||
71 | |||
72 | protected function guardAgainstInvalidDirectives(string $directive) |
||
78 | |||
79 | public function __toString() |
||
80 | { |
||
81 | return collect($this->directives) |
||
82 | ->map(function (array $values, string $directive) { |
||
83 | $valueString = implode(' ', $values); |
||
84 | |||
90 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.