Add $keysCount & minor CS fix

This commit is contained in:
Lee McDermott 2011-06-11 16:43:28 +01:00
parent 91f4097a09
commit 5a986bfc27

View File

@ -75,6 +75,7 @@ EOF;
$routeIterator = $routes->getIterator();
$keys = array_keys($routeIterator->getArrayCopy());
$keysCount = count($keys);
$i = 0;
@ -86,8 +87,10 @@ EOF;
$optimizable = $prefix && count($route->all()) > 1 && false === strpos($route->getPrefix(), '{');
$indent = '';
if ($optimizable) {
for ($j = $i; $j < count($keys); $j++) {
if ($keys[$j] === null) continue;
for ($j = $i; $j < $keysCount; $j++) {
if ($keys[$j] === null) {
continue;
}
$testRoute = $routeIterator->offsetGet($keys[$j]);
$isCollection = ($testRoute instanceof RouteCollection);