public function fetchByRepository($repository)
    {
        $apiPackage = $this->client->get($repository);
        if ($apiPackage && $apiPackage instanceof ApiPackage) {
            // create a new Package from the ApiPackage
            $class = self::$packageClass;

            return $class::createFromApi($apiPackage);
        }

        throw new UnexpectedValueException(sprintf('Impossible to fetch package by "%s" repository.', $repository));
    }
public function fetchByRepository($repository)
    {
        $apiPackage = $this->client->get($repository);
        if ($apiPackage && $apiPackage instanceof ApiPackage) {
            // create a new Package from the ApiPackage
            $class = self::$packageClass;

            return $class::createFromApi($apiPackage);
        }

        throw new UnexpectedValueException(sprintf('Impossible to fetch package by "%s" repository.', $repository));
    }
public function fetchByRepository ( $ repository ) { $ apiPackage = $ this -> client -> get ( $ repository ) ; if ( $ apiPackage && $ apiPackage instanceof ApiPackage ) { // create a new Package from the ApiPackage $ class = self :: $ packageClass ; return $ class :: createFromApi ( $ apiPackage ) ; } throw new UnexpectedValueException ( sprintf ( 'Impossible to fetch package by "%s" repository.' , $ repository ) ) ; }
Returns package if founded.

@param string $repository

@return Package

@throws UnexpectedValueException
Returns package if founded .