protected function extractUrlRepository($url) { if (preg_match('/https:\\/\\/github\\.com\\/(?<username>[\\w\\.-]+)\\/(?<repository>[\\w\\.-]+)/', $url, $matches)) { return $matches['username'] . '/' . $matches['repository']; } return null; }