original_string: public static function scope($path, $params = [], $callback = null)
      {
          $options = [];
          if (is_array($params)) {
              $options = $params;
              unset($params['routeClass'], $params['extensions']);
          }
          $builder = static::createRouteBuilder('/', $options);
          $builder->scope($path, $params, $callback);
      }
code: public static function scope($path, $params = [], $callback = null)
      {
          $options = [];
          if (is_array($params)) {
              $options = $params;
              unset($params['routeClass'], $params['extensions']);
          }
          $builder = static::createRouteBuilder('/', $options);
          $builder->scope($path, $params, $callback);
      }
code_tokens: public static function scope ( $ path , $ params = [ ] , $ callback = null ) { $ options = [ ] ; if ( is_array ( $ params ) ) { $ options = $ params ; unset ( $ params [ 'routeClass' ] , $ params [ 'extensions' ] ) ; } $ builder = static :: createRouteBuilder ( '/' , $ options ) ; $ builder -> scope ( $ path , $ params , $ callback ) ; }
docstring: Create a routing scope.
  
  Routing scopes allow you to keep your routes DRY and avoid repeating
  common path prefixes, and or parameter sets.
  
  Scoped collections will be indexed by path for faster route parsing. If you
  re-open or re-use a scope the connected routes will be merged with the
  existing ones.
  
  ### Options
  
  The `$params` array allows you to define options for the routing scope.
  The options listed below *are not* available to be used as routing defaults
  
  - `routeClass` The route class to use in this scope. Defaults to
  `Router::defaultRouteClass()`
  - `extensions` The extensions to enable in this scope. Defaults to the globally
  enabled extensions set with `Router::extensions()`
  
  ### Example
  
  ```
  Router::scope('/blog', ['plugin' => 'Blog'], function ($routes) {
  $routes->connect('/', ['controller' => 'Articles']);
  });
  ```
  
  The above would result in a `/blog/` route being created, with both the
  plugin & controller default parameters set.
  
  You can use `Router::plugin()` and `Router::prefix()` as shortcuts to creating
  specific kinds of scopes.
  
  @param string $path The path prefix for the scope. This path will be prepended
  to all routes connected in the scoped collection.
  @param array|callable $params An array of routing defaults to add to each connected route.
  If you have no parameters, this argument can be a callable.
  @param callable|null $callback The callback to invoke with the scoped collection.
  @throws \InvalidArgumentException When an invalid callable is provided.
  @return void
docstring_tokens: Create a routing scope .