Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge 5a0859e into 4901fc6
Browse files Browse the repository at this point in the history
  • Loading branch information
eweso committed May 17, 2018
2 parents 4901fc6 + 5a0859e commit c2c3cf6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ArrayInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ public function isValid($context = null)
$validator = $this->getValidatorChain();
$values = $this->getValue();
$result = true;

if ($required && empty($values)) {
if ($this->errorMessage === null) {
$this->errorMessage = $this->prepareRequiredValidationFailureMessage();
}
return false;
}

foreach ($values as $value) {
$empty = ($value === null || $value === '' || $value === []);
if ($empty && ! $this->isRequired() && ! $this->continueIfEmpty()) {
Expand Down

0 comments on commit c2c3cf6

Please sign in to comment.