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