From 372907ead1771b43590084fca5a2e89247bff667 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 5 Apr 2011 12:13:47 +0200 Subject: [PATCH] [Routing] fixed CS --- .../Routing/Matcher/Dumper/PhpMatcherDumper.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php index dc5524ac77..e362bded97 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -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.*?)\$\1#', $compiledRoute->getRegex(), $m)) { @@ -72,12 +70,10 @@ 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); + $regex = substr($regex, 0, $pos).'/?$'.substr($regex, $pos + 2); $hasTrailingSlash = true; - } else { - $conditions[] = sprintf("preg_match('%s', \$pathinfo, \$matches)", $regex); } + $conditions[] = sprintf("preg_match('%s', \$pathinfo, \$matches)", $regex); $matches = true; } @@ -107,7 +103,7 @@ EOF; return array('_controller' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction', 'url' => \$this->context['base_url'].\$pathinfo.'/', 'permanent' => true, '_route' => '%s'); } EOF - , $name); + , $name); } // optimize parameters array