original_string: public function addPrefix($prefix, array $defaults = [], array $requirements = [])
      {
          $prefix = trim(trim($prefix), '/');
  
          if ('' === $prefix) {
              return;
          }
  
          foreach ($this->routes as $route) {
              $route->setPath('/'.$prefix.$route->getPath());
              $route->addDefaults($defaults);
              $route->addRequirements($requirements);
          }
      }
code: public function addPrefix($prefix, array $defaults = [], array $requirements = [])
      {
          $prefix = trim(trim($prefix), '/');
  
          if ('' === $prefix) {
              return;
          }
  
          foreach ($this->routes as $route) {
              $route->setPath('/'.$prefix.$route->getPath());
              $route->addDefaults($defaults);
              $route->addRequirements($requirements);
          }
      }
code_tokens: public function addPrefix ( $ prefix , array $ defaults = [ ] , array $ requirements = [ ] ) { $ prefix = trim ( trim ( $ prefix ) , '/' ) ; if ( '' === $ prefix ) { return ; } foreach ( $ this -> routes as $ route ) { $ route -> setPath ( '/' . $ prefix . $ route -> getPath ( ) ) ; $ route -> addDefaults ( $ defaults ) ; $ route -> addRequirements ( $ requirements ) ; } }
docstring: Adds a prefix to the path of all child routes.
  
  @param string $prefix       An optional prefix to add before each pattern of the route collection
  @param array  $defaults     An array of default values
  @param array  $requirements An array of requirements
docstring_tokens: Adds a prefix to the path of all child routes .