{
"name": "unrealircd/unrealircd-rpc",
+ "version": "0.1.0",
"description": "JSON-RPC interface to UnrealIRCd",
"type": "library",
"require": {
{
"name": "Bram Matthys",
"email": "syzop@vulnscan.org"
+ },
+ {
+ "name": "Denver Freeburn",
+ "email": "sketch@sketchni.uk"
}
],
"support": {
*/
public function add(string $user, array $params): stdClass
{
- $response = $this->connection->query('server_ban.add', [
+ return $this->connection->query('server_ban.add', [
'name' => $user,
'type' => $params['type'],
'reason' => $params['reason'],
'duration_string' => $params['length'] ?? '1d',
]);
-
- return $response;
}
/**
*/
public function delete(string $user, array $params): stdClass
{
- $response = $this->connection->query('server_ban.del', [
+ return $this->connection->query('server_ban.del', [
'name' => $user,
'type' => $params['type'],
]);
-
- return $response;
}
/**
{
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();
* @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);