Skip to content

Commit

Permalink
Fix types in ConstRangeValidator (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashabeton authored and Horat1us committed Oct 30, 2018
1 parent 0468943 commit ad79581
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Validators/ConstRangeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getClosure(): \Closure
$class = $this->targetClass ?? get_class($model);

$cache = ConstRangeValidator::$ranges[$class][$prefix] ?? null;
if ($cache instanceof \Traversable) {
if (is_array($cache)) {
return $this->filterExceptValues($cache);
}

Expand Down Expand Up @@ -100,7 +100,7 @@ public function validateAttribute($model, $attribute)
$this->range = $this->getClosure();
}

protected function filterExceptValues(\iterable $constants): \iterable
protected function filterExceptValues(array $constants): array
{
if (!$this->except) {
return $constants;
Expand Down

0 comments on commit ad79581

Please sign in to comment.