Conditions | 5 |
Paths | 9 |
Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
17 | 6 | public function generateForProperty(FieldMetadata $field, Constraint $constraint, Generator $faker) |
|
18 | { |
||
19 | /** |
||
20 | * @var \Symfony\Component\Validator\Constraints\CardScheme |
||
21 | */ |
||
22 | 6 | $providers = $constraint->schemes; |
|
23 | |||
24 | 6 | $provider = null; |
|
25 | 6 | if (!empty($providers)) { |
|
26 | 6 | foreach ($providers as $p) { |
|
27 | 6 | $p = strtolower($p); |
|
28 | 6 | if (array_key_exists($p, self::SUPPORTED_PROVIDERS)) { |
|
29 | 3 | $provider = self::SUPPORTED_PROVIDERS[$p]; |
|
30 | 5 | break; |
|
31 | } |
||
32 | } |
||
33 | |||
34 | 6 | if (empty($provider)) { |
|
35 | 3 | throw new \InvalidArgumentException( |
|
36 | 3 | sprintf('Cannot find supported among: %s', implode(', ', $providers)) |
|
37 | ); |
||
38 | } |
||
39 | } |
||
40 | |||
41 | 3 | return $faker->creditCardNumber($provider); |
|
42 | } |
||
44 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths