Code Duplication    Length = 10-11 lines in 4 locations

lib/timber-image-helper.php 4 locations

@@ 486-496 (lines=11) @@
483
484
// -- the below methods are just used for unit testing the URL generation code
485
//
486
	static function get_letterbox_file_url($url, $w, $h, $color) {
487
		$au = self::analyze_url($url);
488
		$op = new TimberImageOperationLetterbox($w, $h, $color);
489
		$new_url = self::_get_file_url(
490
			$au['base'],
491
			$au['subdir'],
492
			$op->filename($au['filename'], $au['extension']),
493
			$au['absolute']
494
		);
495
		return $new_url;
496
	}
497
	public static function get_letterbox_file_path($url, $w, $h, $color ) {
498
		$au = self::analyze_url($url);
499
		$op = new TimberImageOperationLetterbox($w, $h, $color);
@@ 497-506 (lines=10) @@
494
		);
495
		return $new_url;
496
	}
497
	public static function get_letterbox_file_path($url, $w, $h, $color ) {
498
		$au = self::analyze_url($url);
499
		$op = new TimberImageOperationLetterbox($w, $h, $color);
500
		$new_path = self::_get_file_path(
501
			$au['base'],
502
			$au['subdir'],
503
			$op->filename($au['filename'], $au['extension'])
504
		);
505
		return $new_path;
506
	}
507
	static function get_resize_file_url($url, $w, $h, $crop) {
508
		$au = self::analyze_url($url);
509
		$op = new TimberImageOperationResize($w, $h, $crop);
@@ 507-517 (lines=11) @@
504
		);
505
		return $new_path;
506
	}
507
	static function get_resize_file_url($url, $w, $h, $crop) {
508
		$au = self::analyze_url($url);
509
		$op = new TimberImageOperationResize($w, $h, $crop);
510
		$new_url = self::_get_file_url(
511
			$au['base'],
512
			$au['subdir'],
513
			$op->filename($au['filename'], $au['extension']),
514
			$au['absolute']
515
		);
516
		return $new_url;
517
	}
518
	static function get_resize_file_path($url, $w, $h, $crop) {
519
		$au = self::analyze_url($url);
520
		$op = new TimberImageOperationResize($w, $h, $crop);
@@ 518-527 (lines=10) @@
515
		);
516
		return $new_url;
517
	}
518
	static function get_resize_file_path($url, $w, $h, $crop) {
519
		$au = self::analyze_url($url);
520
		$op = new TimberImageOperationResize($w, $h, $crop);
521
		$new_path = self::_get_file_path(
522
			$au['base'],
523
			$au['subdir'],
524
			$op->filename($au['filename'], $au['extension'])
525
		);
526
		return $new_path;
527
	}
528
529
530
}