original_string: protected function getPackage(RepositoryInterface $repos, $name)
      {
          $name = strtolower($name);
          $pool = new Pool('dev');
          $pool->addRepository($repos);
          $matches = $pool->whatProvides($name);
  
          foreach ($matches as $index => $package) {
              // skip providers/replacers
              if ($package->getName() !== $name) {
                  unset($matches[$index]);
                  continue;
              }
  
              return $package;
          }
      }
code: protected function getPackage(RepositoryInterface $repos, $name)
      {
          $name = strtolower($name);
          $pool = new Pool('dev');
          $pool->addRepository($repos);
          $matches = $pool->whatProvides($name);
  
          foreach ($matches as $index => $package) {
              // skip providers/replacers
              if ($package->getName() !== $name) {
                  unset($matches[$index]);
                  continue;
              }
  
              return $package;
          }
      }
code_tokens: protected function getPackage ( RepositoryInterface $ repos , $ name ) { $ name = strtolower ( $ name ) ; $ pool = new Pool ( 'dev' ) ; $ pool -> addRepository ( $ repos ) ; $ matches = $ pool -> whatProvides ( $ name ) ; foreach ( $ matches as $ index => $ package ) { // skip providers/replacers if ( $ package -> getName ( ) !== $ name ) { unset ( $ matches [ $ index ] ) ; continue ; } return $ package ; } }
docstring: finds a package by name
  
  @param  RepositoryInterface      $repos
  @param  string                   $name
  @return CompletePackageInterface
docstring_tokens: finds a package by name