Conditions | 2 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function configureOptions(OptionsResolver $resolver): void |
||
30 | { |
||
31 | $resolver->setDefaults([ |
||
32 | 'exclude_sites' => [], |
||
33 | ]); |
||
34 | |||
35 | $resolver->setNormalizer('choices', function (Options $options, $value) { |
||
36 | if ($options['exclude_sites']) { |
||
37 | $value = array_filter($value, function (IdentifiedSiteInterface $site) use ($options): bool { |
||
38 | return !\in_array($site->getIdentifier(), $options['exclude_sites'], true); |
||
39 | }); |
||
40 | } |
||
41 | |||
42 | return $value; |
||
43 | }); |
||
51 |