original_string: protected function findBestVersionForPackage(string $name): string
      {
          // find the latest version allowed in this pool
          $package = $this->versionSelector->findBestCandidate($name, null, null, 'stable');
  
          if ($package === false) {
              throw new InvalidArgumentException(\sprintf(
                  'Could not find package %s at any version for your minimum-stability (%s).'
                  . ' Check the package spelling or your minimum-stability.',
                  $name,
                  $this->stability
              ));
          }
  
          return $this->versionSelector->findRecommendedRequireVersion($package);
      }
code: protected function findBestVersionForPackage(string $name): string
      {
          // find the latest version allowed in this pool
          $package = $this->versionSelector->findBestCandidate($name, null, null, 'stable');
  
          if ($package === false) {
              throw new InvalidArgumentException(\sprintf(
                  'Could not find package %s at any version for your minimum-stability (%s).'
                  . ' Check the package spelling or your minimum-stability.',
                  $name,
                  $this->stability
              ));
          }
  
          return $this->versionSelector->findRecommendedRequireVersion($package);
      }
code_tokens: protected function findBestVersionForPackage ( string $ name ) : string { // find the latest version allowed in this pool $ package = $ this -> versionSelector -> findBestCandidate ( $ name , null , null , 'stable' ) ; if ( $ package === false ) { throw new InvalidArgumentException ( \ sprintf ( 'Could not find package %s at any version for your minimum-stability (%s).' . ' Check the package spelling or your minimum-stability.' , $ name , $ this -> stability ) ) ; } return $ this -> versionSelector -> findRecommendedRequireVersion ( $ package ) ; }
docstring: Try to find the best version fot the package.
  
  @param string $name
  
  @throws \Narrowspark\Automatic\Common\Contract\Exception\InvalidArgumentException
  
  @return string
docstring_tokens: Try to find the best version fot the package .