Total Complexity | 7 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 94.12% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class CardSchemeStrategy extends AbstractConstraintStrategy |
||
19 | { |
||
20 | 1 | protected function generateArguments(array $config): array |
|
21 | { |
||
22 | 1 | $parent = parent::generateArguments($config); |
|
23 | 1 | $parent['schemes'] = $this->extractSchemes($config); |
|
24 | |||
25 | 1 | return array_filter($parent); |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param array<string, mixed> $config |
||
30 | * |
||
31 | * @return array<string>|null |
||
32 | */ |
||
33 | 1 | protected function extractSchemes(array $config): array|null |
|
47 | } |
||
48 | |||
49 | 1 | protected function getValidatorProperty(): string |
|
50 | { |
||
51 | 1 | return 'card_scheme'; |
|
52 | } |
||
53 | |||
54 | 1 | protected function getAttributeClassName(): string |
|
57 | } |
||
58 | } |
||
59 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.