src/Routing/Adapter/Lumen.php
public function getIterableRoutes($version = null)
    {
        $iterable = [];

        foreach ($this->getRoutes($version) as $version => $collector) {
            $routeData = $collector->getData();

            // The first element in the array are the static routes that do not have any parameters.
            foreach ($this->normalizeStaticRoutes($routeData[0]) as $method => $routes) {
                if ($method === 'HEAD') {
                    continue;
                }

                foreach ($routes as $route) {
                    $route['methods'] = $this->setRouteMethods($route, $method);

                    $iterable[$version][] = $route;
                }
            }

            // The second element is the more complicated regex routes that have parameters.
            foreach ($routeData[1] as $method => $routes) {
                if ($method === 'HEAD') {
                    continue;
                }

                foreach ($routes as $data) {
                    foreach ($data['routeMap'] as list($route, $parameters)) {
                        $route['methods'] = $this->setRouteMethods($route, $method);

                        $iterable[$version][] = $route;
                    }
                }
            }
        }

        return new ArrayIterator($iterable);
    }
public function getIterableRoutes($version = null)
    {
        $iterable = [];

        foreach ($this->getRoutes($version) as $version => $collector) {
            $routeData = $collector->getData();

            // The first element in the array are the static routes that do not have any parameters.
            foreach ($this->normalizeStaticRoutes($routeData[0]) as $method => $routes) {
                if ($method === 'HEAD') {
                    continue;
                }

                foreach ($routes as $route) {
                    $route['methods'] = $this->setRouteMethods($route, $method);

                    $iterable[$version][] = $route;
                }
            }

            // The second element is the more complicated regex routes that have parameters.
            foreach ($routeData[1] as $method => $routes) {
                if ($method === 'HEAD') {
                    continue;
                }

                foreach ($routes as $data) {
                    foreach ($data['routeMap'] as list($route, $parameters)) {
                        $route['methods'] = $this->setRouteMethods($route, $method);

                        $iterable[$version][] = $route;
                    }
                }
            }
        }

        return new ArrayIterator($iterable);
    }
public function getIterableRoutes ( $ version = null ) { $ iterable = [ ] ; foreach ( $ this -> getRoutes ( $ version ) as $ version => $ collector ) { $ routeData = $ collector -> getData ( ) ; // The first element in the array are the static routes that do not have any parameters. foreach ( $ this -> normalizeStaticRoutes ( $ routeData [ 0 ] ) as $ method => $ routes ) { if ( $ method === 'HEAD' ) { continue ; } foreach ( $ routes as $ route ) { $ route [ 'methods' ] = $ this -> setRouteMethods ( $ route , $ method ) ; $ iterable [ $ version ] [ ] = $ route ; } } // The second element is the more complicated regex routes that have parameters. foreach ( $ routeData [ 1 ] as $ method => $ routes ) { if ( $ method === 'HEAD' ) { continue ; } foreach ( $ routes as $ data ) { foreach ( $ data [ 'routeMap' ] as list ( $ route , $ parameters ) ) { $ route [ 'methods' ] = $ this -> setRouteMethods ( $ route , $ method ) ; $ iterable [ $ version ] [ ] = $ route ; } } } } return new ArrayIterator ( $ iterable ) ; }
Get routes in an iterable form.

@param string $version

@return \ArrayIterator
Get routes in an iterable form .