original_string: public function addNamePrefix(string $prefix)
      {
          $prefixedRoutes = [];
  
          foreach ($this->routes as $name => $route) {
              $prefixedRoutes[$prefix.$name] = $route;
              if (null !== $name = $route->getDefault('_canonical_route')) {
                  $route->setDefault('_canonical_route', $prefix.$name);
              }
          }
  
          $this->routes = $prefixedRoutes;
      }
code: public function addNamePrefix(string $prefix)
      {
          $prefixedRoutes = [];
  
          foreach ($this->routes as $name => $route) {
              $prefixedRoutes[$prefix.$name] = $route;
              if (null !== $name = $route->getDefault('_canonical_route')) {
                  $route->setDefault('_canonical_route', $prefix.$name);
              }
          }
  
          $this->routes = $prefixedRoutes;
      }
code_tokens: public function addNamePrefix ( string $ prefix ) { $ prefixedRoutes = [ ] ; foreach ( $ this -> routes as $ name => $ route ) { $ prefixedRoutes [ $ prefix . $ name ] = $ route ; if ( null !== $ name = $ route -> getDefault ( '_canonical_route' ) ) { $ route -> setDefault ( '_canonical_route' , $ prefix . $ name ) ; } } $ this -> routes = $ prefixedRoutes ; }
docstring: Adds a prefix to the name of all the routes within in the collection.
docstring_tokens: Adds a prefix to the name of all the routes within in the collection .