original_string: protected function buildCollection(array $sources, array $extensions)
      {
          $collection = new Collection();
          $collection->setAllowedExtensions($extensions);
          foreach ($sources as $path) {
              if (is_dir($path)) {
                  $collection->addDirectory($path);
                  continue;
              }
  
              $collection->addFile($path);
          }
  
          return $collection;
      }
code: protected function buildCollection(array $sources, array $extensions)
      {
          $collection = new Collection();
          $collection->setAllowedExtensions($extensions);
          foreach ($sources as $path) {
              if (is_dir($path)) {
                  $collection->addDirectory($path);
                  continue;
              }
  
              $collection->addFile($path);
          }
  
          return $collection;
      }
code_tokens: protected function buildCollection ( array $ sources , array $ extensions ) { $ collection = new Collection ( ) ; $ collection -> setAllowedExtensions ( $ extensions ) ; foreach ( $ sources as $ path ) { if ( is_dir ( $ path ) ) { $ collection -> addDirectory ( $ path ) ; continue ; } $ collection -> addFile ( $ path ) ; } return $ collection ; }
docstring: Constructs a Fileset collection and returns that.
  
  @param array $sources    List of source paths.
  @param array $extensions List of extensions to scan for in directories.
  
  @return Collection
docstring_tokens: Constructs a Fileset collection and returns that .