src/Composer/Search/RepositorySearch.php
protected function decorate($packageName)
    {
        $results = $this->repository->findPackages($packageName);

        if (!count($results)) {
            throw new \InvalidArgumentException('Could not find package with specified name ' . $packageName);
        }

        $latest   = array_slice($results, 0, 1)[0];
        $versions = array_slice($results, 1);
        $package  = new VersionedPackage($latest, $versions);

        return $this->decorateWithPackagistStats($package);
    }
protected function decorate($packageName)
    {
        $results = $this->repository->findPackages($packageName);

        if (!count($results)) {
            throw new \InvalidArgumentException('Could not find package with specified name ' . $packageName);
        }

        $latest   = array_slice($results, 0, 1)[0];
        $versions = array_slice($results, 1);
        $package  = new VersionedPackage($latest, $versions);

        return $this->decorateWithPackagistStats($package);
    }
protected function decorate ( $ packageName ) { $ results = $ this -> repository -> findPackages ( $ packageName ) ; if ( ! count ( $ results ) ) { throw new \ InvalidArgumentException ( 'Could not find package with specified name ' . $ packageName ) ; } $ latest = array_slice ( $ results , 0 , 1 ) [ 0 ] ; $ versions = array_slice ( $ results , 1 ) ; $ package = new VersionedPackage ( $ latest , $ versions ) ; return $ this -> decorateWithPackagistStats ( $ package ) ; }
Decorate a package.

@param string $packageName The name of the package to decorate.

@return VersionedPackage

@throws \InvalidArgumentException When the package could not be found.
Decorate a package .