private function fixDataType(array &$data): void
    {
        if ('default' === $data['type']) {
            return;
        }

        $valid_var_name = [
            'image' => 'images',
            'video' => 'video',
        ];

        if (!isset($valid_var_name[$data['type']], $data[$valid_var_name[$data['type']]]) || !\is_array($data[$valid_var_name[$data['type']]])) {
            $data['type'] = 'default';
        }
    }
private function fixDataType(array &$data): void
    {
        if ('default' === $data['type']) {
            return;
        }

        $valid_var_name = [
            'image' => 'images',
            'video' => 'video',
        ];

        if (!isset($valid_var_name[$data['type']], $data[$valid_var_name[$data['type']]]) || !\is_array($data[$valid_var_name[$data['type']]])) {
            $data['type'] = 'default';
        }
    }
private function fixDataType ( array & $ data ) : void { if ( 'default' === $ data [ 'type' ] ) { return ; } $ valid_var_name = [ 'image' => 'images' , 'video' => 'video' , ] ; if ( ! isset ( $ valid_var_name [ $ data [ 'type' ] ] , $ data [ $ valid_var_name [ $ data [ 'type' ] ] ] ) || ! \ is_array ( $ data [ $ valid_var_name [ $ data [ 'type' ] ] ] ) ) { $ data [ 'type' ] = 'default' ; } }
Fix type of data, if data type is specific,
he must to be defined in data and he must to be a array.

@param array &$data List of parameters
Fix type of data if data type is specific he must to be defined in data and he must to be a array .