Code Duplication    Length = 11-11 lines in 3 locations

lib/private/util.php 3 locations

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