original_string: public function import($resource, $prefix = '/', $type = null)
      {
          /** @var RouteCollection[] $collections */
          $collections = $this->load($resource, $type);
  
          // create a builder from the RouteCollection
          $builder = $this->createBuilder();
  
          foreach ($collections as $collection) {
              if (null === $collection) {
                  continue;
              }
  
              foreach ($collection->all() as $name => $route) {
                  $builder->addRoute($route, $name);
              }
  
              foreach ($collection->getResources() as $resource) {
                  $builder->addResource($resource);
              }
          }
  
          // mount into this builder
          $this->mount($prefix, $builder);
  
          return $builder;
      }
code: public function import($resource, $prefix = '/', $type = null)
      {
          /** @var RouteCollection[] $collections */
          $collections = $this->load($resource, $type);
  
          // create a builder from the RouteCollection
          $builder = $this->createBuilder();
  
          foreach ($collections as $collection) {
              if (null === $collection) {
                  continue;
              }
  
              foreach ($collection->all() as $name => $route) {
                  $builder->addRoute($route, $name);
              }
  
              foreach ($collection->getResources() as $resource) {
                  $builder->addResource($resource);
              }
          }
  
          // mount into this builder
          $this->mount($prefix, $builder);
  
          return $builder;
      }
code_tokens: public function import ( $ resource , $ prefix = '/' , $ type = null ) { /** @var RouteCollection[] $collections */ $ collections = $ this -> load ( $ resource , $ type ) ; // create a builder from the RouteCollection $ builder = $ this -> createBuilder ( ) ; foreach ( $ collections as $ collection ) { if ( null === $ collection ) { continue ; } foreach ( $ collection -> all ( ) as $ name => $ route ) { $ builder -> addRoute ( $ route , $ name ) ; } foreach ( $ collection -> getResources ( ) as $ resource ) { $ builder -> addResource ( $ resource ) ; } } // mount into this builder $ this -> mount ( $ prefix , $ builder ) ; return $ builder ; }
docstring: Import an external routing resource and returns the RouteCollectionBuilder.
  
  $routes->import('blog.yml', '/blog');
  
  @param mixed       $resource
  @param string|null $prefix
  @param string      $type
  
  @return self
  
  @throws LoaderLoadException
docstring_tokens: Import an external routing resource and returns the RouteCollectionBuilder .