| Total Complexity | 7 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class FormShield implements FormShieldInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var array<string,ServerRequestPolicyInterface> |
||
| 15 | */ |
||
| 16 | protected array $policies = []; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param array<string,ServerRequestPolicyInterface> $policies |
||
| 20 | */ |
||
| 21 | 12 | public function __construct(array $policies) |
|
| 22 | { |
||
| 23 | 12 | foreach ($policies as $name => $policy) { |
|
| 24 | 12 | $this->addPolicy($name, $policy); |
|
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | 12 | protected function addPolicy(string $name, ServerRequestPolicyInterface $policy) |
|
| 31 | } |
||
| 32 | |||
| 33 | 6 | public function approvesRequest(ServerRequestInterface $request): bool |
|
| 36 | } |
||
| 37 | |||
| 38 | 12 | public function analyzeRequest(ServerRequestInterface $request): FormShieldReportInterface |
|
| 52 | } |
||
| 53 | } |
||
| 54 |