Knp\Bundle\KnpBundlesBundle\Finder\Github::extractUrlRepository PHP Method

extractUrlRepository() protected method

Returns the github repository extracted from the given URL
protected extractUrlRepository ( string $url ) : string
$url string
return string or NULL if the URL does not contain any repository
    protected function extractUrlRepository($url)
    {
        if (preg_match('/https:\\/\\/github\\.com\\/(?<username>[\\w\\.-]+)\\/(?<repository>[\\w\\.-]+)/', $url, $matches)) {
            return $matches['username'] . '/' . $matches['repository'];
        }
        return null;
    }