Fix Config handling

This commit is contained in:
the-djmaze 2022-11-10 19:20:09 +01:00
parent efbc7563ac
commit d76ba3abc9
2 changed files with 16 additions and 10 deletions

View file

@ -58,16 +58,7 @@ abstract class AbstractConfig implements \JsonSerializable
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$aData = [];
foreach ($this->aData as $sSectionKey => $aSectionValue) {
if (\is_array($aSectionValue)) {
$aData[$sSectionKey] = [];
foreach ($aSectionValue as $sParamKey => $mParamValue) {
$aData[$sSectionKey][$sParamKey] = $mParamValue[0];
}
}
}
return $aData;
return $this->aData;;
}
/**

View file

@ -37,4 +37,19 @@ class Plugin extends \RainLoop\Config\AbstractConfig
{
return $this->aMap;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$aData = [];
foreach ($this->aData as $sSectionKey => $aSectionValue) {
if (\is_array($aSectionValue)) {
$aData[$sSectionKey] = [];
foreach ($aSectionValue as $sParamKey => $mParamValue) {
$aData[$sSectionKey][$sParamKey] = $mParamValue[0];
}
}
}
return $aData;
}
}