diff options
Diffstat (limited to 'src/Support/Parser.php')
-rw-r--r-- | src/Support/Parser.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/Support/Parser.php b/src/Support/Parser.php index d850de1..02ec251 100644 --- a/src/Support/Parser.php +++ b/src/Support/Parser.php @@ -4,10 +4,10 @@ namespace App\Support; class Parser { - /** - * @return array<string, string> - */ - public static function parseUser(string $user): array + /** + * @return array<string, string> + */ + public static function parseUser(string $user): array { $username = $user; $server = ""; @@ -24,4 +24,22 @@ class Parser "server" => $server, ]; } + + /** + * @return array<string, string> + */ + public static function parseRoomAlias(string $alias): array + { + $name = ""; + $server = ""; + + $parts = explode(":", $alias); + $name = substr($parts[0], 1); + $server = $parts[1]; + + return [ + "name" => $name, + "server" => $server, + ]; + } } |