]> jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/commitdiff
Update some apidoc and remove throw on user not found.
authorBram Matthys <redacted>
Wed, 11 Jan 2023 06:45:11 +0000 (07:45 +0100)
committerBram Matthys <redacted>
Wed, 11 Jan 2023 06:45:11 +0000 (07:45 +0100)
(yeah this whole thing needs an overhaul, later.. later..)

lib/Channel.php
lib/NameBan.php
lib/ServerBan.php
lib/Spamfilter.php
lib/User.php

index e98e6cd202cdf7c7cdc206d4009acef859d801ce..2a3f9e5fa8d0c298643613989f3e39611fcf93c3 100644 (file)
@@ -36,7 +36,6 @@ class Channel
      * Get a channel object
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function get(string $channel): stdClass|array|bool
     {
@@ -45,15 +44,13 @@ class Channel
         if (!is_bool($response)) {
             return $response->channel;
         }
-
-        throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');
+        return false; /* eg user not found */
     }
 
     /**
      * Set and unset modes on a channel.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_mode(string $channel, string $modes, string $parameters): stdClass|array|bool
     {
@@ -68,7 +65,6 @@ class Channel
      * Set the channel topic.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_topic(string $channel, string $topic,
                               string $set_by=null, string $set_at=null): stdClass|array|bool
@@ -85,7 +81,6 @@ class Channel
      * Kick a user from the channel.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function kick(string $channel, string $nick, string $reason): stdClass|array|bool
     {
index fd7f7cb9df720d5bc78afae4d7df17cf78e6f01d..66dbdc0ff8f17386b3dc549d8e633ea891dd994f 100644 (file)
@@ -23,7 +23,6 @@ class NameBan
      * @param string $duration Optional
      * @param string $set_by Optional
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function add(string $name, string $reason, string $duration = NULL, $set_by = NULL): stdClass|array|bool
     {
@@ -51,7 +50,6 @@ class NameBan
      *
      * @param  string  $name
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function delete(string $name): stdClass|array|bool
     {
@@ -89,7 +87,6 @@ class NameBan
      *
      * @param string $name
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function get(string $name): stdClass|array|bool
     {
index 0183ee367b27ec8daa662059ad2faf8bf3d1fb29..5764d542d8ef93d100df09af51bd452cde90a8ef 100644 (file)
@@ -20,7 +20,6 @@ class ServerBan
      *
      * @param  string  $user
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function add(string $name, string $type, string $duration, string $reason): stdClass|array|bool
     {
@@ -44,7 +43,6 @@ class ServerBan
      *
      * @param  string  $name
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function delete(string $name, string $type): stdClass|array|bool
     {
index 103f455804fbcfc69f7947bce6d97dec9d24a566..fbb889a8cf68475b5069730c6839eb576d8ffcfb 100644 (file)
@@ -19,7 +19,6 @@ class Spamfilter
      * Add a spamfilter.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function add(string $name, string $match_type, string $spamfilter_targets, string $ban_action, string $ban_duration, string $reason): stdClass|array|bool
     {
@@ -44,7 +43,6 @@ class Spamfilter
      * Delete a spamfilter.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function delete(string $name, string $match_type, string $spamfilter_targets, string $ban_action): stdClass|array|bool
     {
@@ -84,7 +82,6 @@ class Spamfilter
      * Get a specific spamfilter.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function get(string $name, string $match_type, string $spamfilter_targets, string $ban_action): stdClass|array|bool
     {
index 484dbef4657267d75aad55240e7820b39133c423..c02a53530259f35d72f14341d8537085cbab2205 100644 (file)
@@ -17,8 +17,6 @@ class User
 
     /**
      * Return a list of all users.
-     *
-     * @throws Exception
      */
     public function getAll(): stdClass|array|bool
     {
@@ -35,7 +33,6 @@ class User
      * Return a user object
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function get(string $nick): stdClass|array|bool
     {
@@ -52,7 +49,6 @@ class User
      * Set the nickname of a user (changes the nick)
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_nick(string $nick, string $newnick): stdClass|array|bool
     {
@@ -66,7 +62,6 @@ class User
      * Set the username/ident of a user
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_username(string $nick, string $username): stdClass|array|bool
     {
@@ -80,7 +75,6 @@ class User
      * Set the realname/gecos of a user
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_realname(string $nick, string $realname): stdClass|array|bool
     {
@@ -94,7 +88,6 @@ class User
      * Set a virtual host (vhost) on the user
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_vhost(string $nick, string $vhost): stdClass|array|bool
     {
@@ -108,7 +101,6 @@ class User
      * Change the user modes of a user.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_mode(string $nick, string $mode, bool $hidden = false): stdClass|array|bool
     {
@@ -123,7 +115,6 @@ class User
      * Change the snomask of a user (oper).
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_snomask(string $nick, string $snomask, bool $hidden = false): stdClass|array|bool
     {
@@ -138,7 +129,6 @@ class User
      * Make user an IRC Operator (oper).
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function set_oper(string $nick, string $oper_account, string $oper_class,
                              string $class = null, string $modes = null,
@@ -159,7 +149,6 @@ class User
      * Join a user to a channel.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function join(string $nick, string $channel,
                          string $key = null, bool $force = false): stdClass|array|bool
@@ -176,7 +165,6 @@ class User
      * Part a user from a channel.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function part(string $nick, string $channel, bool $force = false): stdClass|array|bool
     {
@@ -191,7 +179,6 @@ class User
      * Quit a user from IRC. Pretend it is a normal QUIT.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function quit(string $nick, string $reason): stdClass|array|bool
     {
@@ -205,7 +192,6 @@ class User
      * Kill a user from IRC. Show that the user is forcefully removed.
      *
      * @return stdClass|array|bool
-     * @throws Exception
      */
     public function kill(string $nick, string $reason): stdClass|array|bool
     {