From 76c3629be2519f6261d6d931b99e072c0637768a Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 27 Sep 2024 14:21:27 -0400 Subject: [PATCH] Expand valid RpcRequest result types --- src/Socialbox/Objects/RpcRequest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Socialbox/Objects/RpcRequest.php b/src/Socialbox/Objects/RpcRequest.php index 1834042..366700f 100644 --- a/src/Socialbox/Objects/RpcRequest.php +++ b/src/Socialbox/Objects/RpcRequest.php @@ -108,6 +108,18 @@ class RpcRequest implements SerializableInterface { $valid = true; } + elseif(is_string($result)) + { + $valid = true; + } + elseif(is_bool($result)) + { + $valid = true; + } + elseif(is_int($result)) + { + $valid = true; + } elseif(is_null($result)) { $valid = true; @@ -115,7 +127,7 @@ class RpcRequest implements SerializableInterface if(!$valid) { - throw new InvalidArgumentException('The \'$result\' property must either be array, null or SerializableInterface'); + throw new InvalidArgumentException('The \'$result\' property must either be string, boolean, integer, array, null or SerializableInterface'); } return new RpcResponse($this->id, $result);