Code Duplication    Length = 12-12 lines in 3 locations

modules/widgets/gallery.php 3 locations

@@ 175-186 (lines=12) @@
172
	 * @param array $instance The Widget instance to generate HTML for
173
	 * @return string String of HTML representing a rectangular gallery
174
	 */
175
	public function rectangular_widget( $args, $instance ) {
176
		if ( ! class_exists( 'Jetpack_Tiled_Gallery' )
177
			&& ! class_exists( 'Jetpack_Tiled_Gallery_Layout_Rectangular') ) {
178
			return;
179
		}
180
181
		$widget_tiled_gallery = new Jetpack_Tiled_Gallery();
182
		$widget_tiled_gallery->default_scripts_and_styles();
183
184
		$layout = new Jetpack_Tiled_Gallery_Layout_Rectangular( $instance['attachments'], $instance['link'], false, 3 );
185
		return $layout->HTML();
186
	}
187
188
	/**
189
	 * Generate HTML for a square (grid style) Widget
@@ 195-206 (lines=12) @@
192
	 * @param array $instance The Widget instance to generate HTML for
193
	 * @return string String of HTML representing a square gallery
194
	 */
195
	public function square_widget( $args, $instance ) {
196
		if ( ! class_exists( 'Jetpack_Tiled_Gallery' )
197
			&& ! class_exists( 'Jetpack_Tiled_Gallery_Layout_Square') ) {
198
			return;
199
		}
200
201
		$widget_tiled_gallery = new Jetpack_Tiled_Gallery();
202
		$widget_tiled_gallery->default_scripts_and_styles();
203
204
		$layout = new Jetpack_Tiled_Gallery_Layout_Square( $instance['attachments'], $instance['link'], false, 3 );
205
		return $layout->HTML();
206
	}
207
208
	/**
209
	 * Generate HTML for a circular (grid style) Widget
@@ 215-226 (lines=12) @@
212
	 * @param array $instance The Widget instance to generate HTML for
213
	 * @return string String of HTML representing a circular gallery
214
	 */
215
	public function circle_widget( $args, $instance ) {
216
		if ( ! class_exists( 'Jetpack_Tiled_Gallery' )
217
			&& ! class_exists( 'Jetpack_Tiled_Gallery_Layout_Circle') ) {
218
			return;
219
		}
220
221
		$widget_tiled_gallery = new Jetpack_Tiled_Gallery();
222
		$widget_tiled_gallery->default_scripts_and_styles();
223
224
		$layout = new Jetpack_Tiled_Gallery_Layout_Circle( $instance['attachments'], $instance['link'], false, 3 );
225
		return $layout->HTML();
226
	}
227
228
	/**
229
	 * Generate HTML for a slideshow Widget