| Conditions | 5 |
| Paths | 6 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function validate($value, Constraint $constraint) |
||
| 14 | { |
||
| 15 | if (!$constraint instanceof InducementsAmount) { |
||
| 16 | throw new UnexpectedTypeException($constraint, InducementsAmount::class); |
||
| 17 | } |
||
| 18 | if (!is_array($value)) { |
||
| 19 | throw new UnexpectedTypeException($value, Encounter::class); |
||
| 20 | } |
||
| 21 | |||
| 22 | $spend = 0; |
||
| 23 | |||
| 24 | foreach ($value as $inducement) { |
||
| 25 | /** @var Inducement $inducement */ |
||
| 26 | $spend += $inducement->getValue(); |
||
| 27 | } |
||
| 28 | |||
| 29 | if ($spend > $constraint->budget) { |
||
| 30 | $this->context->buildViolation($constraint->limitMessage) |
||
| 31 | ->setParameter('{{ budget }}', $constraint->budgetToDisplay) |
||
| 32 | ->addViolation(); |
||
| 33 | } |
||
| 36 |
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