Skip to content

Commit

Permalink
Rework ValidateTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Sep 17, 2024
1 parent b93e74d commit 96bd6ad
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Traits/ValidateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@ public function validate(array $data)

$validation->set_rules($this->rules);

$valid = true;

if (! $validation->run())
{
$this->errors = $validation->error_array();

$valid = false;
}

return $valid;
return count($this->errors) === 0;
}
}

0 comments on commit 96bd6ad

Please sign in to comment.