Skip to content

Commit

Permalink
Set a default method for validation message variable replacing (#15527)
Browse files Browse the repository at this point in the history
* Set a default method for validation message variable replacing

* Fixed CS

* Updated to not use container call
  • Loading branch information
hannesvdvreken authored and taylorotwell committed Sep 20, 2016
1 parent 5f5ab94 commit 391ba86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3352,7 +3352,11 @@ protected function callReplacer($message, $attribute, $rule, $parameters)
*/
protected function callClassBasedReplacer($callback, $message, $attribute, $rule, $parameters)
{
list($class, $method) = explode('@', $callback);
if (Str::contains($callback, '@')) {
list($class, $method) = explode('@', $callback);
} else {
list($class, $method) = [$callback, 'replace'];
}

return call_user_func_array([$this->container->make($class), $method], array_slice(func_get_args(), 1));
}
Expand Down

0 comments on commit 391ba86

Please sign in to comment.