Skip to content

Commit

Permalink
Merge pull request #2 from Tobion/patch-2
Browse files Browse the repository at this point in the history
remove logic that could not be triggered anyway
  • Loading branch information
pborreli committed Nov 17, 2012
2 parents f7ea68f + 38802ea commit a146156
Showing 1 changed file with 2 additions and 7 deletions.
Expand Up @@ -214,14 +214,9 @@ private function getRouteMethods(Route $route)
*/
private function regexToApacheRegex($regex)
{
$delimiter = $regex[0];
$regexPatternEnd = strrpos($regex, $delimiter);
if (strlen($regex) < 2 || 0 === $regexPatternEnd) {
throw new \LogicException('The route regex "%s" is invalid', $regex);
}
$regex = preg_replace('/\?<.+?>/', '', substr($regex, 1, $regexPatternEnd - 1));
$regexPatternEnd = strrpos($regex, $regex[0]);

return $regex;
return preg_replace('/\?<.+?>/', '', substr($regex, 1, $regexPatternEnd - 1));
}

/**
Expand Down

0 comments on commit a146156

Please sign in to comment.