Skip to content

Commit

Permalink
Merge c90bf9e into 9b73b9b
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Apr 29, 2019
2 parents 9b73b9b + c90bf9e commit 6d95912
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Slug.php
Expand Up @@ -118,6 +118,9 @@ public static function getUsernameFromSlug($slug, $provider)

public static function getUserRepoFromSlug($slug, $provider)
{
if (empty($parts[1])) {
throw new \InvalidArgumentException('The slug repo part could not be determined from path');
}
$parts = self::getSlugPartsFromProvider($slug, $provider);
return $parts[1];
}
Expand Down Expand Up @@ -174,7 +177,7 @@ public static function createFromUrlAndSupportedProviders($url, $supported_provi
$slug->setProvider($url['host']);
}
if (!empty($url['path'])) {
// It's probably going to start with a slash.
// It's probably going to start with a slash.
$path = ltrim($url['path'], '/');
$slug->setSlug($path);
}
Expand Down

0 comments on commit 6d95912

Please sign in to comment.