Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
15 | 26 | public function generateForProperty(FieldMetadata $field, FakeMock $fakemock, ?string $group = null) |
|
16 | { |
||
17 | 26 | if (!$field->configuration->useAsserts) { |
|
18 | 10 | return null; |
|
19 | } |
||
20 | |||
21 | 16 | $allAsserts = $field->annotations->findAllBy(Constraint::class); |
|
22 | 16 | $asserts = $this->filterByGroup($allAsserts, $group); |
|
23 | |||
24 | 16 | if ($asserts) { |
|
25 | 6 | $assert = $asserts[0]; |
|
26 | |||
27 | // https://coderwall.com/p/cpxxxw/php-get-class-name-without-namespace - reflection is the fastest? |
||
28 | 6 | $baseClass = new \ReflectionClass($assert); |
|
29 | |||
30 | 6 | if ($generator = $this->getGenerator($baseClass->getShortName())) { |
|
31 | 4 | return $generator->generateForProperty($field, $assert, $this->generator); |
|
32 | } |
||
33 | } |
||
34 | |||
35 | 12 | return null; |
|
36 | } |
||
58 |
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