Knp\Bundle\KnpBundlesBundle\Finder\Github::extractUrlRepository PHP 메소드

extractUrlRepository() 보호된 메소드

Returns the github repository extracted from the given URL
protected extractUrlRepository ( string $url ) : string
$url string
리턴 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;
    }