Skip to content

Commit

Permalink
Update RepositoryName.php
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <[email protected]>
  • Loading branch information
ghostwriter committed Dec 19, 2022
1 parent 485c86d commit ca44fa2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Github/Value/RepositoryName.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use Psl\Type;
use Psr\Http\Message\UriInterface;

use function explode;

/** @psalm-immutable */
final class RepositoryName
{
Expand Down Expand Up @@ -39,7 +41,7 @@ public static function fromFullName(string $fullName): self
{
Psl\invariant(Regex\matches($fullName, '~^[a-zA-Z0-9_\\.-]+/[a-zA-Z0-9_\\.-]+$~'), 'Invalid repository name.');

[$owner, $name] = Str\split($fullName, '/');
[$owner, $name] = explode('/', $fullName);

return new self(
Type\non_empty_string()->assert($owner),
Expand Down

0 comments on commit ca44fa2

Please sign in to comment.