Refactor SettingsInformationFieldExists to ensure field parameter is cast to string for proper handling

https://github.com/nosial/Socialbox-PHP/issues/64
This commit is contained in:
netkas 2025-03-12 17:49:45 -04:00
parent 919f75b8ee
commit f02109bdc9
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -27,7 +27,8 @@
{
throw new MissingRpcArgumentException('field');
}
$fieldName = InformationFieldName::tryFrom(strtoupper($rpcRequest->getParameter('field')));
$fieldName = InformationFieldName::tryFrom(strtoupper((string)$rpcRequest->getParameter('field')));
if($fieldName === null)
{
throw new InvalidRpcArgumentException('field');