Code Duplication    Length = 21-23 lines in 2 locations

dist/jate/functions/block.php 1 location

@@ 29-49 (lines=21) @@
26
		return jBlockParsing($_type, $text, $_parameters);
27
	}
28
29
	function jBlockParsing( $_type = "html", $_string = "", $_parameters = [] ) {
30
		switch ($_type) {
31
			case "pug":
32
			case "jade":
33
				$Pug = new Pug();
34
				$_string = $Pug->drawText($_string, $_parameters);
35
			break;
36
			case "md":
37
			case "markdown":
38
			case "parsedown":
39
				$Parsedown = new Parsedown();
40
				$_string = $Parsedown->drawText($_string);
41
			break;
42
			case "twig":
43
				$Twig = new Twig();
44
				$_string = $Twig->drawText($_string, $_parameters);
45
			break;
46
			default: break;
47
		}
48
		return $_string;
49
	}
50
51
	function minifyOutput($_buffer) {
52
		$search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );

dist/jate/modules/GUI/GUI.php 1 location

@@ 26-48 (lines=23) @@
23
					$_page = str_replace("<_${key}_>", "$value", $_page);
24
			return $_page;
25
		}
26
		protected function parsingFile( $_file, $_type = "html" ) {
27
			switch ($_type) {
28
				case 'pug':
29
				case 'jade':
30
					$pug = new Pug();
31
					$page = $pug->drawFile($_file);
32
				break;
33
				case "md":
34
				case "markdown":
35
				case "parsedown":
36
					$Parsedown = new Parsedown();
37
					$page = $Parsedown->drawFile($_file);
38
				break;
39
				case 'twig':
40
					$twig = new Twig();
41
					$page = $twig->drawFile($_file);
42
				break;
43
				default:
44
					$page = file_get_contents($_file);
45
				break;
46
			}
47
			return $page;
48
		}
49
	}
50
?>
51