From 9806c317e9db8540991fafde8e544072357e73aa Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 12 Mar 2025 17:57:55 -0400 Subject: [PATCH] Refactor SettingsAddSignature to ensure 'name' parameter is cast to string for proper handling and remove unnecessary exception handling for missing parameter. https://github.com/nosial/Socialbox-PHP/issues/56 --- .../StandardMethods/Settings/SettingsAddSignature.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Socialbox/Classes/StandardMethods/Settings/SettingsAddSignature.php b/src/Socialbox/Classes/StandardMethods/Settings/SettingsAddSignature.php index cca89cf..5c8fe47 100644 --- a/src/Socialbox/Classes/StandardMethods/Settings/SettingsAddSignature.php +++ b/src/Socialbox/Classes/StandardMethods/Settings/SettingsAddSignature.php @@ -2,7 +2,6 @@ namespace Socialbox\Classes\StandardMethods\Settings; - use Exception; use InvalidArgumentException; use Socialbox\Abstracts\Method; use Socialbox\Classes\Configuration; @@ -33,15 +32,11 @@ { $expires = (int)$rpcRequest->getParameter('expires'); } - if(!$rpcRequest->containsParameter('name')) - { - throw new MissingRpcArgumentException('name'); - } $name = null; if($rpcRequest->containsParameter('name')) { - $name = $rpcRequest->getParameter('name'); + $name = (string)$rpcRequest->getParameter('name'); } try