]> jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/blobdiff - lib/Spamfilter.php
Add streaming JSON-LOG support. Requires UnrealIRCd 6.1.0+
[irc/unrealircd/unrealircd-rpc-php.git] / lib / Spamfilter.php
index 723c3708bd336fa8ca4fcba10304eee728575b05..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
     {
@@ -57,7 +55,7 @@ class Spamfilter
 
         if (is_bool($response))
             return false;
-            
+
         if (property_exists($response, 'tkl'))
             return $response->tkl;
         return FALSE;
@@ -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
     {
@@ -99,6 +96,6 @@ class Spamfilter
             return $response->tkl;
         }
 
-        throw new Exception('Invalid JSON Response from UnrealIRCd RPC.');
+        return false; // not found
     }
 }