Skip to content
Browse files

remove logic that could not be triggered anyway

the regex by the compiler is always valid. even if it was invalid like '' it wasn't caught by the exception and would have given a php notice.
  • Loading branch information...
1 parent f7ea68f commit 38802ea32ca92f3e3e9db973c43a08d6dc1b7646 @Tobion committed Nov 17, 2012
Showing with 2 additions and 7 deletions.
  1. +2 −7 src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
View
9 src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
@@ -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));
}
/**

0 comments on commit 38802ea

Please sign in to comment.
Something went wrong with that request. Please try again.