protected function cleanFormData(array $data)
    {
        foreach ($data as $key => $value) {
            if (\is_array($value)) {
                $data[$key] = $this->cleanFormData($value);
            } elseif (\is_object($value)) {
                unset($data[$key]);
            }
        }

        return $data;
    }
protected function cleanFormData(array $data)
    {
        foreach ($data as $key => $value) {
            if (\is_array($value)) {
                $data[$key] = $this->cleanFormData($value);
            } elseif (\is_object($value)) {
                unset($data[$key]);
            }
        }

        return $data;
    }
protected function cleanFormData ( array $ data ) { foreach ( $ data as $ key => $ value ) { if ( \ is_array ( $ value ) ) { $ data [ $ key ] = $ this -> cleanFormData ( $ value ) ; } elseif ( \ is_object ( $ value ) ) { unset ( $ data [ $ key ] ) ; } } return $ data ; }
Remove all objects in data, because they are probably not serializable

@param array $data
@return array
Remove all objects in data because they are probably not serializable