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;
}