Skip to content

Commit

Permalink
Working on validation
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Oct 1, 2021
1 parent 8d9c2b6 commit fcbce9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Validator.php
Expand Up @@ -138,7 +138,7 @@ public function array(string $parameter): array
$value = [];
}

return array_reduce($this->rules, static fn($rule) => $rule($value), $value);
return array_reduce($this->rules, static fn ($value, $rule) => $rule($value), $value);
}

/**
Expand All @@ -156,7 +156,7 @@ public function integer(string $parameter): ?int
$value = null;
}

return array_reduce($this->rules, static fn($rule) => $rule($value), $value);
return array_reduce($this->rules, static fn ($value, $rule) => $rule($value), $value);
}

/**
Expand All @@ -172,6 +172,6 @@ public function string(string $parameter): ?string
$value = null;
}

return array_reduce($this->rules, static fn($value, $rule) => $rule($value), $value);
return array_reduce($this->rules, static fn ($value, $rule) => $rule($value), $value);
}
}

0 comments on commit fcbce9d

Please sign in to comment.