| Conditions | 4 |
| Paths | 5 |
| Total Lines | 33 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function isValid($value, array $context = []): bool |
||
| 33 | { |
||
| 34 | $criteria = $this->getFilterCriteria($value, $context); |
||
| 35 | $entityName = $this->repository->getClassName(); |
||
| 36 | |||
| 37 | if (empty($criteria)) { |
||
| 38 | throw new RuntimeException( |
||
| 39 | sprintf( |
||
| 40 | 'Unable to perform validation for entity \'%s\' in \'%s\' with an empty criteria', |
||
| 41 | $entityName, |
||
| 42 | static::class |
||
| 43 | ) |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | |||
| 47 | try { |
||
| 48 | $entity = $this->repository->findOneBy($criteria); |
||
| 49 | |||
| 50 | if (null === $entity) { |
||
| 51 | return true; |
||
| 52 | } |
||
| 53 | |||
| 54 | $this->error(IsNotEntityError::FOUND, $criteria); |
||
| 55 | return false; |
||
| 56 | } catch (\Throwable $e) { |
||
| 57 | throw new RuntimeException( |
||
| 58 | sprintf( |
||
| 59 | 'Failed to perform the validation for entity of type \'%s\': %s', |
||
| 60 | $entityName, |
||
| 61 | $e->getMessage() |
||
| 62 | ), |
||
| 63 | $e->getCode(), |
||
| 64 | $e |
||
| 65 | ); |
||
| 69 |
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