Commit 5b86ad60 authored by Taylor Otwell's avatar Taylor Otwell

trim route finder iterator instantiation.

parent 44e88676
......@@ -42,7 +42,9 @@ class Finder {
return static::$names[$name];
}
$recursiveIterator = new \RecursiveIteratorIterator($arrayIterator = new \RecursiveArrayIterator(static::$routes));
$arrayIterator = new \RecursiveArrayIterator(static::$routes);
$recursiveIterator = new \RecursiveIteratorIterator($arrayIterator);
foreach ($recursiveIterator as $iterator)
{
......@@ -67,9 +69,11 @@ class Finder {
{
$routes = array();
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(APP_PATH.'routes'), \RecursiveIteratorIterator::SELF_FIRST);
$directoryIterator = new \RecursiveDirectoryIterator(APP_PATH.'routes');
$recursiveIterator = new \RecursiveIteratorIterator($directoryIterator, \RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $file)
foreach ($recursiveIterator as $file)
{
if (filetype($file) === 'file')
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment