original_string: public function load($file, $type = null)
      {
          $path = $this->locator->locate($file);
  
          $collection = new RouteCollection();
          if ($class = $this->findClass($path)) {
              $refl = new \ReflectionClass($class);
              if ($refl->isAbstract()) {
                  return;
              }
  
              $collection->addResource(new FileResource($path));
              $collection->addCollection($this->loader->load($class, $type));
          }
  
          gc_mem_caches();
  
          return $collection;
      }
code: public function load($file, $type = null)
      {
          $path = $this->locator->locate($file);
  
          $collection = new RouteCollection();
          if ($class = $this->findClass($path)) {
              $refl = new \ReflectionClass($class);
              if ($refl->isAbstract()) {
                  return;
              }
  
              $collection->addResource(new FileResource($path));
              $collection->addCollection($this->loader->load($class, $type));
          }
  
          gc_mem_caches();
  
          return $collection;
      }
code_tokens: public function load ( $ file , $ type = null ) { $ path = $ this -> locator -> locate ( $ file ) ; $ collection = new RouteCollection ( ) ; if ( $ class = $ this -> findClass ( $ path ) ) { $ refl = new \ ReflectionClass ( $ class ) ; if ( $ refl -> isAbstract ( ) ) { return ; } $ collection -> addResource ( new FileResource ( $ path ) ) ; $ collection -> addCollection ( $ this -> loader -> load ( $ class , $ type ) ) ; } gc_mem_caches ( ) ; return $ collection ; }
docstring: Loads from annotations from a file.
  
  @param string      $file A PHP file path
  @param string|null $type The resource type
  
  @return RouteCollection A RouteCollection instance
  
  @throws \InvalidArgumentException When the file does not exist or its routes cannot be parsed
docstring_tokens: Loads from annotations from a file .