Skip to content

Commit

Permalink
New check for a valid callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
andretefras committed Oct 23, 2016
1 parent 577c3dc commit b6d3426
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Routing/RouteBuilder.php
Expand Up @@ -606,6 +606,9 @@ public function redirect($route, $url, array $options = [])
public function prefix($name, $params = [], callable $callback = null) public function prefix($name, $params = [], callable $callback = null)
{ {
if ($callback === null) { if ($callback === null) {
if (!is_callable($params)) {
throw new InvalidArgumentException('A valid callback is expected');
}
$callback = $params; $callback = $params;
$params = []; $params = [];
} }
Expand Down

0 comments on commit b6d3426

Please sign in to comment.