Code Duplication    Length = 28-28 lines in 2 locations

includes/fields/class-gravityview-field-fileupload.php 2 locations

@@ 105-132 (lines=28) @@
102
			switch( true ) {
103
104
				// Audio file
105
				case in_array( $extension, wp_get_audio_extensions() ):
106
107
					$disable_lightbox = true;
108
109
					if( shortcode_exists( 'audio' ) ) {
110
111
						$disable_wrapped_link = true;
112
113
						/**
114
						 * @filter `gravityview_audio_settings` Modify the settings passed to the `wp_video_shortcode()` function
115
						 * @since  1.2
116
						 * @param array $audio_settings Array with `src` and `class` keys
117
						 */
118
						$audio_settings = apply_filters( 'gravityview_audio_settings', array(
119
							'src' => $file_path,
120
							'class' => 'wp-audio-shortcode gv-audio gv-field-id-'.$field_settings['id']
121
						));
122
123
						/**
124
						 * Generate the audio shortcode
125
						 * @see http://codex.wordpress.org/Audio_Shortcode
126
						 * @see https://developer.wordpress.org/reference/functions/wp_audio_shortcode/
127
						 */
128
						$content = wp_audio_shortcode( $audio_settings );
129
130
					}
131
132
					break;
133
134
				// Video file
135
				case in_array( $extension, wp_get_video_extensions() ):
@@ 135-162 (lines=28) @@
132
					break;
133
134
				// Video file
135
				case in_array( $extension, wp_get_video_extensions() ):
136
137
					$disable_lightbox = true;
138
139
					if( shortcode_exists( 'video' ) ) {
140
141
						$disable_wrapped_link = true;
142
143
						/**
144
						 * @filter `gravityview_video_settings` Modify the settings passed to the `wp_video_shortcode()` function
145
						 * @since  1.2
146
						 * @param array $video_settings Array with `src` and `class` keys
147
						 */
148
						$video_settings = apply_filters( 'gravityview_video_settings', array(
149
							'src' => $file_path,
150
							'class' => 'wp-video-shortcode gv-video gv-field-id-'.$field_settings['id']
151
						));
152
153
						/**
154
						 * Generate the video shortcode
155
						 * @see http://codex.wordpress.org/Video_Shortcode
156
						 * @see https://developer.wordpress.org/reference/functions/wp_video_shortcode/
157
						 */
158
						$content = wp_video_shortcode( $video_settings );
159
160
					}
161
162
					break;
163
164
				// PDF
165
				case $extension === 'pdf':