private function getFieldInfo($key, $value): array
    {
        $name = null;
        $options = [];
        if (is_numeric($key) && is_string($value)) {
            $name = $value;
        } else if (is_numeric($key) && is_array($value)) {
            $name = array_shift($value);
            $options = $value;
        } else if (is_string($key)) {
            $name = $key;
            $options = $value;
        }
        return ['name' => $name, 'options' => $options];
    }