@param InstalledRepositoryInterface $repo

@return PackageInterface
551013
protected function getPHPCodeSnifferPackage(InstalledRepositoryInterface $repo)
    {
        $packageKey = 'squizlabs/php_codesniffer';
        $package = $repo->findPackage($packageKey, '*');
        if (! $package) {
            throw new \RuntimeException(sprintf('Package "%s" not installed.', $packageKey));
        }

        return $package;
    }
328341
public function githubCreateRepo(InputInterface $input, OutputInterface $output)
    {
        $this->api->setCredentials($this->getCredentials($output));
        $name = $this->repoName($input);
        try {
            $this->api->createRepo($name,$this->repoDescription($input));
        } catch (ServerException $se) {
            //TODO
            $output->writeln('<error>Server exception thrown</error>');
            die();
        } catch (ClientException $ce) {
            $this->showError( $ce , $output );
        }
        $output->writeln('<info>Repository ' . $name . ' created</info>');
    }
903835
protected function initMultiVcsRepositories(Composer $composer, IOInterface $io)
    {
        $repoDownloader = new GitMultiRepoDownloader($io, $composer->getConfig());
        foreach ($this->getVcsTypes() as $type) {
            $composer->getDownloadManager()
                ->setDownloader($type, $repoDownloader);
            $composer->getRepositoryManager()
                ->setRepositoryClass($type, $this->getMultiRepositoryClassName());
        }

        return $this;
    }
730251
public function create(Repo $repo)
    {
        $rows = $this->getRows();
        $id = sizeof($rows) + 1;

        $rows[] = array(
            'id' => $id,
            'slug' => $repo->getSlug(),
            'type' => $repo->getType(),
            'qualityBadgeHash' => $repo->getQualityBadgeHash(),
            'coverageBadgeHash' => $repo->getCoverageBadgeHash(),
        );

        file_put_contents($this->filename, Yaml::dump($rows));
    }
259153
public function create(string $repo, array $params = [])
    {
        $path = $this->buildUsersPath($repo);

        return $this->post($path, $params);
    }
206328
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $this->logVerbose(sprintf('Installing Contao sources for %s', $package->getName()));

        parent::install($repo, $package);

        $this->addSymlinks($package, $this->getContaoRoot(), $this->getSources($package));
        $this->addCopies($package, $this->getFilesRoot(), $this->getUserFiles($package), self::DUPLICATE_IGNORE);
        $this->addRunonces($package, $this->getRunonces($package));

        $this->logVerbose('');
    }
596911
public function installDependencies(InstallerInterface $installer)
    {
        $decode = $this->config->getBowerFileContent();
        if (!empty($decode['dependencies'])) {
            foreach ($decode['dependencies'] as $name => $requiredVersion) {
                if (false !== strpos($requiredVersion, 'github')) {
                    list($name, $requiredVersion) = explode('#', $requiredVersion);
                }
                $package = new Package($name, $requiredVersion);
                $this->installPackage($package, $installer, true);
            }
        }
    }
1133967
public function install(InstalledRepositoryInterface $repo, PackageInterface $package) {
        parent::install($repo, $package);
        $instructions = $this->getInstructions($package);
        if (!$instructions || empty($instructions['install'])) { return; }
        $this->handleInstructions($package, $instructions['install']);
    }
981287
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;
        }
    }
628773
public function update(\Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $initial,
			\Composer\Package\PackageInterface $target) {
				
		$this->moveBackResources($initial);
		
		parent::update($repo, $initial, $target);
		
		$this->removeResources($target);
		$this->installResources($target);
	}
756938
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $extra = $package->getExtra();

        if (array_key_exists('pxb-config', $extra)) {
            $this->loadModule($package, $extra['pxb-config']);
        }

        parent::install($repo, $package);
    }
1004677
public function createRepo(string $repo = null)
    {
        $end = $this->getVendorType() === 'org'
            ?'/orgs/' . $this->getVendor() . '/repos'
            : '/user/repos'
        ;
        $res = $this->request('POST', $end, [
            'name'        => $this->getName(),
            'description' => $this->getDescription(),
        ]);
        if (Helper::isResponseOk($res)) {
            echo "\ngit remote add origin git@github.com:{$this->getFullName()}.git\n";
            echo "git push -u origin master\n";
        }

        return $res;
    }
33898
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        parent::install($repo, $package);
        $this->generateVendorMetaData();
    }
75109
private function getClass($repo)
    {
        $class = S::create(
            str_replace(['.'], ['-'], basename($repo, '.git'))
        )->camelize();

        return ucfirst(trim($class));
    }
1285004
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        parent::install($repo, $package);
        foreach ($this->getSupportedHooks() as $gitHookName) {
            $installedHookFilePath = $this->getInstallPath($package) . DIRECTORY_SEPARATOR . $gitHookName;

            if (file_exists($installedHookFilePath)) {
                $hookDestinationPath = $this->getGitHooksPath() . DIRECTORY_SEPARATOR . $gitHookName;
                if (!copy($installedHookFilePath, $hookDestinationPath)) {
                    echo sprintf(
                        'GitHookInstallerPlugin failed to copy %s to %s!',
                        $installedHookFilePath,
                        $hookDestinationPath
                    );
                }
                chmod($hookDestinationPath, 0755);
            }
        }

        // clean up temporary data
        exec('rm -rf ' . $this->getHooksInstallationPath());
    }
81863
public function update(string $repo, array $params = [])
    {
        $path = $this->buildUsersPath($repo);

        return $this->put($path, $params);
    }
235149
public function show(string $repo, array $params = [])
    {
        $path = $this->buildUsersPath($repo);

        return $this->get($path, $params);
    }