trim route finder iterator instantiation.
This commit is contained in:
parent
44e8867672
commit
5b86ad6067
|
@ -42,7 +42,9 @@ public static function find($name)
|
||||||
return static::$names[$name];
|
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)
|
foreach ($recursiveIterator as $iterator)
|
||||||
{
|
{
|
||||||
|
@ -67,9 +69,11 @@ private static function load()
|
||||||
{
|
{
|
||||||
$routes = array();
|
$routes = array();
|
||||||
|
|
||||||
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(APP_PATH.'routes'), \RecursiveIteratorIterator::SELF_FIRST);
|
$directoryIterator = new \RecursiveDirectoryIterator(APP_PATH.'routes');
|
||||||
|
|
||||||
foreach ($iterator as $file)
|
$recursiveIterator = new \RecursiveIteratorIterator($directoryIterator, \RecursiveIteratorIterator::SELF_FIRST);
|
||||||
|
|
||||||
|
foreach ($recursiveIterator as $file)
|
||||||
{
|
{
|
||||||
if (filetype($file) === 'file')
|
if (filetype($file) === 'file')
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue