Upgrade to 3.8.0

This commit is contained in:
Bastian Allgeier
2022-10-06 10:11:54 +02:00
parent a9ed4e45ca
commit 7d168aae58
332 changed files with 26337 additions and 21977 deletions

View File

@@ -17,20 +17,21 @@ class NestObject extends Obj
{
/**
* Converts the object to an array
*
* @return array
*/
public function toArray(): array
{
$result = [];
foreach ((array)$this as $key => $value) {
if (is_a($value, 'Kirby\Cms\Field') === true) {
if ($value instanceof Field) {
$result[$key] = $value->value();
continue;
}
if (is_object($value) === true && method_exists($value, 'toArray')) {
if (
is_object($value) === true &&
method_exists($value, 'toArray')
) {
$result[$key] = $value->toArray();
continue;
}