Code Duplication    Length = 11-11 lines in 3 locations

lib/private/util.php 3 locations

@@ 478-488 (lines=11) @@
475
	 * @param bool $prepend prepend the Script to the beginning of the list
476
	 * @return void
477
	 */
478
	public static function addVendorScript($application, $file = null, $prepend = false) {
479
		$path = OC_Util::generatePath($application, 'vendor', $file);
480
		//TODO eliminate double code		
481
		if (! in_array ( $path, self::$scripts )) {
482
			if ($prepend === true) {
483
				array_unshift ( self::$scripts, $path );
484
			} else {
485
				self::$scripts [] = $path;
486
			}
487
		}
488
	}
489
490
	/**
491
	 * add a translation JS file
@@ 524-534 (lines=11) @@
521
	 * @param bool $prepend prepend the Style to the beginning of the list
522
	 * @return void
523
	 */
524
	public static function addStyle($application, $file = null, $prepend = false) {
525
		$path = OC_Util::generatePath($application, 'css', $file);
526
		//TODO eliminate double code		
527
		if (!in_array($path, self::$styles)) {
528
			if ($prepend === true) {
529
				array_unshift ( self::$styles, $path );
530
			} else {
531
				self::$styles[] = $path;
532
			}	
533
		}
534
	}
535
536
	/**
537
	 * add a css file from the vendor sub folder
@@ 544-554 (lines=11) @@
541
	 * @param bool $prepend prepend the Style to the beginning of the list
542
	 * @return void
543
	 */
544
	public static function addVendorStyle($application, $file = null, $prepend = false) {
545
		$path = OC_Util::generatePath($application, 'vendor', $file);
546
		//TODO eliminate double code
547
		if (!in_array($path, self::$styles)) {
548
			if ($prepend === true) {
549
				array_unshift ( self::$styles, $path );
550
			} else {
551
				self::$styles[] = $path;
552
			}	
553
		}
554
	}
555
556
	/**
557
	 * Add a custom element to the header