Skip to content

Commit

Permalink
Optimized nested conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-James committed Jan 22, 2016
1 parent 9a0fd77 commit 965309a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Validation/Validator.php
Expand Up @@ -551,7 +551,11 @@ protected function validateFailonfirst()
*/
protected function shouldBreakOnFail($attribute)
{
return $this->hasRule($attribute, ['Failonfirst']) && $this->messages->has($attribute);
if (! $this->hasRule($attribute, ['Failonfirst'])) {
return false;
}

return $this->messages->has($attribute);
}

/**
Expand Down

0 comments on commit 965309a

Please sign in to comment.