public static function collectRoutes($routeConfig, $app = null)
    {
        $app = empty($app) ? Yii::$app : $app;
        $rules = [];
        if (isset($routeConfig['urlPrefix']) && $routeConfig['urlPrefix'] !== false && is_file($routeConfig['fileRoutes'])) {
            //!! config file use var $routeConfig:
            $routes = include($routeConfig['fileRoutes']);
            if (empty($routes)) return [];

            switch ($routeConfig['class']) {
                case GroupUrlRule::className(): // only for this class config-routes-files very simple
                    $configGroupRules = [
                        'rules'  => $routes,
                        'prefix' => $routeConfig['urlPrefix'],
                        'routePrefix' => $routeConfig['moduleUid'],
                    ];
                    $rules = [new GroupUrlRule($configGroupRules)];
                    break;
                default: // universal
                    if (isset($routes['enablePrettyUrl'])) {
                        $app->urlManager->enablePrettyUrl = $routes['enablePrettyUrl'];
                        unset($routes['enablePrettyUrl']);
                    }
                    $rules = $routes;
                    break;
            }
        }
        return $rules;
    }