applyRoutesPrefix($config); } private function applyRoutesPrefix(array $config): array { $routes =& $config['routes'] ?? []; // Prepend the routes prefix to every path foreach ($routes as $key => $route) { ['can_be_versioned' => $routeCanBeVersioned, 'path' => $path] = $route; $routes[$key]['path'] = sprintf( '%s%s%s', self::ROUTES_PREFIX, $routeCanBeVersioned ? self::ROUTES_VERSION_PARAM : '', $path ); unset($routes[$key]['can_be_versioned']); } return $config; } }