Skip to content

Commit

Permalink
Merge pull request #145 from utopia-php/fix-array-list-validator
Browse files Browse the repository at this point in the history
fix: rearranging arraylist validators
  • Loading branch information
christyjacob4 authored Sep 10, 2024
2 parents d9aa291 + a2fa010 commit fc63ec6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Http/Validator/ArrayList.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ public function isValid(mixed $value): bool
return false;
}

if ($this->length && \count($value) > $this->length) {
return false;
}

foreach ($value as $element) {
if (!$this->validator->isValid($element)) {
return false;
}
}

if ($this->length && \count($value) > $this->length) {
return false;
}

return true;
}
}

0 comments on commit fc63ec6

Please sign in to comment.