Get the extended metadata for a repository.

@param string $user
@param string $repo

@return array|null
336168
public function repository(string $user, string $repo): ?array
    {
        $api = $this->client->api('repo');
        $params = [$user, $repo];

        $repo = $this->callGitHub([$api, 'show'], $params);

        return is_array($repo) ? $repo : null;
    }
786416
public function getMetadata($author, $name)
    {
        $author = $this->arrayKey($author);

        if (isset($this->metadata[$author][$name])) {
            return $this->metadata[$author][$name];
        }

        return null;
    }
259153
public function create(string $repo, array $params = [])
    {
        $path = $this->buildUsersPath($repo);

        return $this->post($path, $params);
    }
544752
function get (repo, cb) {
    try {
      Gitters.fetch(repo.username + '/' + repo.repo, function(data){
        cb.call(null, repo, data)
      }, /* bubble error */ true)
    } catch(err) {
      log(err.message)
    }
  }
308912
private function getPackages(RepositoryInterface $repo)
    {
        $packages = [];

        if ($this->hasFilterForPackages()) {
            // apply package filter if defined
            foreach ($this->packagesFilter as $filter) {
                $packages += $repo->findPackages($filter);
            }
        } else {
            // process other repos directly
            $packages = $repo->getPackages();
        }

        return $packages;
    }
1273889
protected function getRepositoryReference(Adapter $adapter, $org, $repo)
    {
        $remote = $this->findRemoteName(false);
        $repoInfo = $this->gitConfigHelper->getRemoteInfo($remote);

        if (null === $org) {
            $org = $repoInfo['vendor'];
        }

        if (null === $repo) {
            $repo = $repoInfo['repo'];
        }

        $adapterRepoInfo = $adapter->getRepositoryInfo($org, $repo);

        if ($adapterRepoInfo['is_fork']) {
            $org = $adapterRepoInfo['fork_origin']['org'];
            $repo = $adapterRepoInfo['fork_origin']['repo'];
        }

        return [$org, $repo];
    }
451165
public function repoGetFileInfo($repo, $path, $ref = null)
    {
        $src = $this->client->api('Repositories\Src');
        /** @var \Buzz\Message\Response $response */
        $response = $this->checkResponse($src->get($this->username, $repo, $ref, $path));

        return $this->cleanSrcData(json_decode($response->getContent(), true));
    }
836056
public static function getRepository($identifier, $config = array())
    {
        if (strpos($identifier, 'repos:') === 0) {
            $repository = AnService::get($identifier);
        } else {
            $strIdentifier = (string) $identifier;

            if (!AnService::has($identifier)) {
                $identifier = self::getEntityIdentifier($identifier);
            }

            if (!AnService::has($identifier)) {
                AnService::set($strIdentifier, AnService::get($identifier, $config));
            }

            $repository = AnService::get($identifier)->getRepository();
        }

        return $repository;
    }
308899
public function tags(string $user, string $repo): array
    {
        $default = [];
        $api = $this->client->api('git_data')->references();
        $params = [$api, 'tags', [$user, $repo]];

        $refs = $this->callGitHub([$this->pager, 'fetchAll'], $params, $default);

        array_walk($refs, function (&$data) {
            $data['name'] = str_replace('refs/tags/', '', $data['ref']);
        });

        usort($refs, $this->tagSorter());

        return $refs;
    }
1310390
protected function getGithubTags($repo)
    {
        $jsonTags = $this->retrieveContentFromUrl(
            'https://api.github.com/repos/' . $repo . '/tags'
        );

        return array_map(
            function ($tag) {
                return $tag['name'];
            },
            json_decode($jsonTags, true)
        );
    }
867845
public function listUserRepositories(string $username, string $type = AbstractApi::TYPE_OWNER,
                                         string $sort = AbstractApi::SORT_FULL_NAME,
                                         string $direction = AbstractApi::DIRECTION_DESC): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/users/:username/repos?:args', $username,
            http_build_query(['type' => $type, 'sort' => $sort, 'direction' => $direction])));
    }
100109
public function get($account, $repo)
    {
        return $this->getClient()->setApiVersion('2.0')->get(
            sprintf('repositories/%s/%s', $account, $repo)
        );
    }
1064016
public function getList($owner, $repo)
	{
		// Build the request path.
		$path = '/repos/' . $owner . '/' . $repo . '/downloads';

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}
430028
public function urlForReference(string $user, string $repo, string $ref): string
    {
        $key = sprintf(self::CACHE_KEY_TEMPLATE, md5($user . $repo), 'ref_url_' . md5($ref));

        if (($latest = $this->getFromCache($key)) !== null) {
            return $latest;
        }

        [$type, $resolved] = $this->resolveRefType($ref);
        $repoURL = $this->urlForRepository($user, $repo);

        switch ($type) {
            case 'commit':
                $url = "${repoURL}/commit/${resolved}";
                break;

            case 'tag':
                $url = "${repoURL}/releases/tag/${resolved}";
                break;

            case 'pull':
                $url = "${repoURL}/pull/${resolved}";
                break;

            case 'branch':
            default:
                $url = "${repoURL}/tree/${resolved}";
        }

        $this->setToCache($key, $url, 30);
        return $url;
    }
265040
public function loadPackagistInfos(Repo $repo)
    {
        try {
            $this->composerReader->load($repo->getSlug());

            // Load package name
            if ($this->composerReader->has('name')) {
                $repo->setPackagistSlug($this->composerReader->get('name'));
            }

            // Load authors
            if ($this->composerReader->has('authors')) {
                $repo->setAuthors($this->composerReader->get('authors'));
            }

            // Load dependencies
            if ($this->composerReader->has('require')) {
                $repo->setDependencies($this->composerReader->get('require'));
            }
        } catch (\Exception $e) {
            // We do not want to throw exception here!
        }
    }
782105
private function resolveBranch($user, $repo, $branch)
    {
        $api = $this->client->api('git_data')->references();
        $params = [$user, $repo, sprintf('heads/%s', $branch)];

        $data = $this->callGitHub([$api, 'show'], $params);
        return $data['object']['sha'] ?? null;
    }
1184833
protected function parse_header_uri( $repo_header ) {
		$header_parts         = parse_url( $repo_header );
		$header_path          = pathinfo( $header_parts['path'] );
		$header['original']   = $repo_header;
		$header['scheme']     = isset( $header_parts['scheme'] ) ? $header_parts['scheme'] : null;
		$header['host']       = isset( $header_parts['host'] ) ? $header_parts['host'] : null;
		$header['owner']      = trim( $header_path['dirname'], '/' );
		$header['repo']       = $header_path['filename'];
		$header['owner_repo'] = implode( '/', [ $header['owner'], $header['repo'] ] );
		$header['base_uri']   = str_replace( $header_parts['path'], '', $repo_header );
		$header['uri']        = isset( $header['scheme'] ) ? trim( $repo_header, '/' ) : null;

		$header = $this->sanitize( $header );

		return $header;
	}