original_string: public function addCollection(self $collection)
      {
          // we need to remove all routes with the same names first because just replacing them
          // would not place the new route at the end of the merged array
          foreach ($collection->all() as $name => $route) {
              unset($this->routes[$name]);
              $this->routes[$name] = $route;
          }
  
          foreach ($collection->getResources() as $resource) {
              $this->addResource($resource);
          }
      }
code: public function addCollection(self $collection)
      {
          // we need to remove all routes with the same names first because just replacing them
          // would not place the new route at the end of the merged array
          foreach ($collection->all() as $name => $route) {
              unset($this->routes[$name]);
              $this->routes[$name] = $route;
          }
  
          foreach ($collection->getResources() as $resource) {
              $this->addResource($resource);
          }
      }
code_tokens: public function addCollection ( self $ collection ) { // we need to remove all routes with the same names first because just replacing them // would not place the new route at the end of the merged array foreach ( $ collection -> all ( ) as $ name => $ route ) { unset ( $ this -> routes [ $ name ] ) ; $ this -> routes [ $ name ] = $ route ; } foreach ( $ collection -> getResources ( ) as $ resource ) { $ this -> addResource ( $ resource ) ; } }
docstring: Adds a route collection at the end of the current set by appending all
  routes of the added collection.
docstring_tokens: Adds a route collection at the end of the current set by appending all routes of the added collection .