summaryrefslogtreecommitdiff
path: root/src/Support/Parser.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-09-11 13:19:21 +0200
committerDaniel Weipert <git@mail.dweipert.de>2025-09-11 13:19:21 +0200
commitb1b101fd98c8b4354a4e0c73e867d817466de30e (patch)
tree763e6d3dab13a2af8c324f7f879c5874dced76f2 /src/Support/Parser.php
parentdb014ebf9f8f84a1a0d0972298e70bf29e57c37e (diff)
sync, rooms, events, etc
Diffstat (limited to 'src/Support/Parser.php')
-rw-r--r--src/Support/Parser.php26
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,
+ ];
+ }
}