Code Duplication    Length = 12-12 lines in 3 locations

modules/widgets/gallery.php 3 locations

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