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
This commit is contained in:
netkas 2025-03-12 17:57:55 -04:00
parent 7aafd0334e
commit 9806c317e9
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -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