[Routing] fixed CS

This commit is contained in:
Fabien Potencier 2011-04-05 12:13:47 +02:00
parent 7c0a39c353
commit 372907ead1

View File

@ -53,9 +53,7 @@ class PhpMatcherDumper extends MatcherDumper
foreach ($this->getRoutes()->all() as $name => $route) {
$compiledRoute = $route->compile();
$conditions = array();
$hasTrailingSlash = false;
$matches = false;
if (!count($compiledRoute->getVariables()) && false !== preg_match('#^(.)\^(?P<url>.*?)\$\1#', $compiledRoute->getRegex(), $m)) {
@ -73,11 +71,9 @@ class PhpMatcherDumper extends MatcherDumper
$regex = $compiledRoute->getRegex();
if ($pos = strpos($regex, '/$')) {
$regex = substr($regex, 0, $pos).'/?$'.substr($regex, $pos + 2);
$conditions[] = sprintf("preg_match('%s', \$pathinfo, \$matches)", $regex);
$hasTrailingSlash = true;
} else {
$conditions[] = sprintf("preg_match('%s', \$pathinfo, \$matches)", $regex);
}
$conditions[] = sprintf("preg_match('%s', \$pathinfo, \$matches)", $regex);
$matches = true;
}