private function cleanFields(array $fields): array
    {
        foreach ($fields['fields'] as &$field) {
            if (array_key_exists('generator', $field[key($field)])) {
                unset($field[key($field)]['generator']);
            }
        }

        unset($fields['section']);
        return $fields;
    }
private function cleanFields(array $fields): array
    {
        foreach ($fields['fields'] as &$field) {
            if (array_key_exists('generator', $field[key($field)])) {
                unset($field[key($field)]['generator']);
            }
        }

        unset($fields['section']);
        return $fields;
    }
private function cleanFields ( array $ fields ) : array { foreach ( $ fields [ 'fields' ] as & $ field ) { if ( array_key_exists ( 'generator' , $ field [ key ( $ field ) ] ) ) { unset ( $ field [ key ( $ field ) ] [ 'generator' ] ) ; } } unset ( $ fields [ 'section' ] ) ; return $ fields ; }
Just remove stuff that's not needed for a frontend

@todo: I might want to introduce a method in the field that only returns the relevant
data for the front-end

@param array $fields
@return array
Just remove stuff that s not needed for a frontend