Code Duplication    Length = 4-5 lines in 2 locations

Ubiquity/controllers/Router.php 2 locations

@@ 108-112 (lines=5) @@
105
		$paramsOrder=$routeArray["details"]["parameters"];
106
		$index=0;
107
		foreach ( $paramsOrder as $order ) {
108
			if($order==="*"){
109
				if(isset($params[$index]))
110
					$result=\array_merge($result,\array_diff(\explode("/", $params[$index]),[""]));
111
				break;
112
			}
113
			if(\substr($order, 0,1)==="~"){
114
				$order=\intval(\substr($order,1,1));
115
				if(isset($params[$order])){
@@ 115-118 (lines=4) @@
112
			}
113
			if(\substr($order, 0,1)==="~"){
114
				$order=\intval(\substr($order,1,1));
115
				if(isset($params[$order])){
116
					$result=\array_merge($result,\array_diff(\explode("/", $params[$order]),[""]));
117
					break;
118
				}
119
			}
120
			$result[]=self::cleanParam($params[$order]);
121
			unset($params[$order]);