| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.0218 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 1 | protected function extractSchemes(array $config): array|null |
|
| 34 | { |
||
| 35 | 1 | $schemes = $this->explodeString($config['schemes'] ?? ''); |
|
| 36 | 1 | if (!$schemes) { |
|
|
|
|||
| 37 | return null; |
||
| 38 | } |
||
| 39 | |||
| 40 | 1 | $result = []; |
|
| 41 | 1 | foreach ($schemes as $schemaName) { |
|
| 42 | 1 | $s = \constant(sprintf('%s::%s', CardScheme::class, $schemaName)); |
|
| 43 | 1 | $result[] = $s ?: $schemaName; |
|
| 44 | } |
||
| 45 | |||
| 46 | 1 | return $result; |
|
| 47 | } |
||
| 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.