protected function castArrayValuesToSimpleTypes(array $data)
    {
        foreach ($data as $key => $item) {
            if (is_array($item)) {
                $data[$key] = $this->castArrayValuesToSimpleTypes($item);
            } elseif (is_object($item)) {
                $data[$key] = $this->convertObjectToSimpleType($item);
            }
        }

        return $data;
    }