public function each(\Closure $closure, $deep = false)
    {
        foreach($this->storage as $route)
        {
            $result = $closure($route);

            if($result !== null)
                return $result;

            if($route->hasSubroutes() && $deep)
            {
                $result = $route->getSubroutes()->each($closure, true);

                if($result !== null)
                    return $result;
            }
        }

        return null;
    }
public function each(\Closure $closure, $deep = false)
    {
        foreach($this->storage as $route)
        {
            $result = $closure($route);

            if($result !== null)
                return $result;

            if($route->hasSubroutes() && $deep)
            {
                $result = $route->getSubroutes()->each($closure, true);

                if($result !== null)
                    return $result;
            }
        }

        return null;
    }
public function each ( \ Closure $ closure , $ deep = false ) { foreach ( $ this -> storage as $ route ) { $ result = $ closure ( $ route ) ; if ( $ result !== null ) return $ result ; if ( $ route -> hasSubroutes ( ) && $ deep ) { $ result = $ route -> getSubroutes ( ) -> each ( $ closure , true ) ; if ( $ result !== null ) return $ result ; } } return null ; }
Loop the routes within this routing group
Break on other closure result not equal to null
@param \Closure $closure
@param bool $deep
@return mixed|null
Loop the routes within this routing group Break on other closure result not equal to null