X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-rpc-php.git/blobdiff_plain/f979c1e0b4bdb6a86456b582159098884cb320ce..93f8a3ee8d1ab65e34e8f551d0018db8961955f8:/lib/ServerBan.php diff --git a/lib/ServerBan.php b/lib/ServerBan.php index e00fc61..126692a 100644 --- a/lib/ServerBan.php +++ b/lib/ServerBan.php @@ -19,10 +19,10 @@ class ServerBan * Add a ban. * * @param string $user - * @return stdClass + * @return stdClass|array|bool * @throws Exception */ - public function add(string $name, string $type, string $duration, string $reason): stdClass + public function add(string $name, string $type, string $duration, string $reason): stdClass|array|bool { return $this->connection->query('server_ban.add', [ 'name' => $name, @@ -36,10 +36,10 @@ class ServerBan * Delete a ban. * * @param string $name - * @return stdClass + * @return stdClass|array|bool * @throws Exception */ - public function delete(string $name, string $type): stdClass + public function delete(string $name, string $type): stdClass|array|bool { return $this->connection->query('server_ban.del', [ 'name' => $name, @@ -50,15 +50,15 @@ class ServerBan /** * Return a list of all bans. * - * @return stdClass + * @return stdClass|array|bool * @throws Exception */ - public function getAll(): stdClass + public function getAll(): stdClass|array|bool { $response = $this->connection->query('server_ban.list'); if (!is_bool($response)) { - return $response; + return $response->list; } throw new Exception('Invalid JSON Response from UnrealIRCd RPC.'); @@ -67,10 +67,10 @@ class ServerBan /** * Get a specific ban. * - * @return stdClass + * @return stdClass|array|bool * @throws Exception */ - public function get(string $name, string $type): stdClass + public function get(string $name, string $type): stdClass|array|bool { $response = $this->connection->query('server_ban.get', [ 'name' => $name,