]> jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/blobdiff - lib/Connection.php
Added version to composer.json and a couple of small (hopefully non-breaking) changes
[irc/unrealircd/unrealircd-rpc-php.git] / lib / Connection.php
index d9a7342a531d8103d7c6adcbad84f6ce72ddb0b9..7832e9df8c74f0f159b36e97631291928c9e0c77 100644 (file)
@@ -9,7 +9,7 @@ class Connection
 {
     protected WebSocket\Client $connection;
 
-    public function __construct(string $uri, string $api_login, array $options)
+    public function __construct(string $uri, string $api_login, array $options = null)
     {
         $context = $options["context"] ?? stream_context_create();
 
@@ -34,11 +34,12 @@ class Connection
      * @note I'm not sure on the response type except that it may be either an object or array.
      *
      * @param  string  $method
-     * @param  array  $params
+     * @param  array|null  $params
+     *
      * @return object|array|bool
      * @throws Exception
      */
-    public function query(string $method, array $params): object|array|bool
+    public function query(string $method, array|null $params = null): object|array|bool
     {
         $id = random_int(1, 99999);