Repository: vapor/vapor
File: Sources/Vapor/Routing/RoutingGroups.swift (Swift)

Code before:
    /// }
    ///
    /// ```
    ///
    /// [Learn More →](https://docs.vapor.codes/3.0/vapor/route-group/#path-components)
    ///
    /// - Parameter path: Group path components separated by commas
    /// - Returns: created RouteGroup
    public func group(with path: PathComponent..., configure: (RouteGroup) -> ()) {
        configure(RouteGroup(cascadingTo: self, components: path))
    }
    
    
    // MARK: - Add using of middleware
    
    /// Returns a RouteGroup cascading to router with middleware attached
    ///
    /// **Example:**
    /// ```
    /// let userMustBeAuthorized = AuthorizationMiddleware(....)
    /// let currentUser = CheckIfCurrentUserMiddleware(....)
    ///
    /// // creating new group on router
    /// let users = router.grouped("user")
    ///     .grouped(using: AuthorizationMiddleware)
    ///     .grouped(using: userMustBeCurrentUser)
    ///
    /// // adding "user/profile/" route to router
    /// // both of validations applied
    /// users.get("auth", use: userAuthHandler)
    ///
    /// ```
    ///
    /// [Learn More →](https://docs.vapor.codes/3.0/vapor/route-group/#path-components)
    ///
    /// - Parameter middleware: Middleware
    /// - Returns: RouterGroup with middleware attached
    public func grouped(using middleware: Middleware...) -> RouteGroup {
        return RouteGroup(cascadingTo: self, middleware: middleware)
    }
    
    
    /// Returns a RouteGroup cascading to router with middleware attached
    ///
    /// **Example:**
    /// ```
    /// let userMustBeAuthorized = AuthorizationMiddleware()
    ///
    /// // creating new group on router
    /// router.group(using: userMustBeAuthorized) { group in
    ///

Review comment (security):
So to line up all the comment code it should read:
```swift
let userMustBeAuthorized = AuthorizationMiddleware(....)
let userMustBeCurrentUser = CheckIfCurrentUserMiddleware(....)

// creating new group on router
let users = router.grouped("user")
    .grouped(using: userMustBeAuthorized)
    .grouped(using: userMustBeCurrentUser)
```

Make sense?

Code after:
    /// // adding "user/auth/" route to router
    /// users.get("auth", use: userAuthHandler)
    ///
    /// // adding "user/profile/" route to router
    /// users.get("profile", use: userProfileHandler)
    ///
    /// ```
    ///
    /// [Learn More →](https://docs.vapor.codes/3.0/vapor/route-group/#path-components)
    ///
    /// - Parameter path: Group path components separated by commas
    /// - Returns: created RouteGroup
    public func grouped(_ path: PathComponent...) -> RouteGroup {
        return RouteGroup(cascadingTo: self, components: path)
    }
    
    
    /// Creates a group cascading to router or group with the provided path components
    /// and use `configure` closure to configure crated group
    ///
    /// **Example:**
    /// ```
    /// // create new group and adds on router
    /// router.group(with: "user") { group in
    ///     // adding "user/auth/" route to router
    ///     group.get("auth", use: userAuthHandler)
    ///
    ///     // adding "user/profile/" route to router
    ///     group.get("profile", use: userProfileHandler)
    /// }
    ///
    /// ```
    ///
    /// [Learn More →](https://docs.vapor.codes/3.0/vapor/route-group/#path-components)
    ///
    /// - Parameter path: Group path components separated by commas
    /// - Returns: created RouteGroup
    public func group(with path: PathComponent..., configure: (RouteGroup) -> ()) {
        configure(RouteGroup(cascadingTo: self, components: path))
    }
    
    
    // MARK: - Add using of middleware
    
    /// Returns a RouteGroup cascading to router with middleware attached
    ///
    /// **Example:**
    /// ```
    /// let userMustBeAuthorized = AuthorizationMiddleware(....)
    /// let userMustBeCurrentUser = CheckIfCurrentUserMiddleware(....)
    ///