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);
    }
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);
    }
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 ) ; }
Try to find the best version fot the package.

@param string $name

@throws \Narrowspark\Automatic\Common\Contract\Exception\InvalidArgumentException

@return string
Try to find the best version fot the package .