| Conditions | 7 | 
| Paths | 8 | 
| Total Lines | 32 | 
| Code Lines | 17 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 14 | 
| CRAP Score | 7.5375 | 
| Changes | 3 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 22 | 12 | public function validate(mixed $value, object $rule, ValidationContext $context): Result  | 
            |
| 23 |     { | 
            ||
| 24 | 12 |         if (!$rule instanceof AtLeast) { | 
            |
| 25 | 1 | throw new UnexpectedRuleException(AtLeast::class, $rule);  | 
            |
| 26 | }  | 
            ||
| 27 | |||
| 28 | 11 | $result = new Result();  | 
            |
| 29 | |||
| 30 | 11 |         if (!is_array($value) && !is_object($value)) { | 
            |
| 31 | $result->addError($rule->getIncorrectInputMessage(), [  | 
            ||
| 32 | 'attribute' => $context->getAttribute(),  | 
            ||
| 33 | 'valueType' => get_debug_type($value),  | 
            ||
| 34 | ]);  | 
            ||
| 35 | |||
| 36 | return $result;  | 
            ||
| 37 | }  | 
            ||
| 38 | |||
| 39 | 11 | $filledCount = 0;  | 
            |
| 40 | 11 |         foreach ($rule->getAttributes() as $attribute) { | 
            |
| 41 | 11 |             if (!(new SkipOnEmpty())(ArrayHelper::getValue($value, $attribute), $context->isAttributeMissing())) { | 
            |
| 42 | 10 | $filledCount++;  | 
            |
| 43 | }  | 
            ||
| 44 | }  | 
            ||
| 45 | |||
| 46 | 11 |         if ($filledCount < $rule->getMin()) { | 
            |
| 47 | 3 | $result->addError($rule->getMessage(), [  | 
            |
| 48 | 3 | 'attribute' => $context->getAttribute(),  | 
            |
| 49 | 3 | 'min' => $rule->getMin(),  | 
            |
| 50 | ]);  | 
            ||
| 51 | }  | 
            ||
| 52 | |||
| 53 | 11 | return $result;  | 
            |
| 54 | }  | 
            ||
| 56 |