Code Duplication    Length = 4-5 lines in 2 locations

Ubiquity/controllers/Router.php 2 locations

@@ 140-144 (lines=5) @@
137
		$paramsOrder=$routeArray["details"]["parameters"];
138
		$index=0;
139
		foreach ( $paramsOrder as $order ) {
140
			if($order==="*"){
141
				if(isset($params[$index]))
142
					$result=\array_merge($result,\array_diff(\explode("/", $params[$index]),[""]));
143
				break;
144
			}
145
			if(\substr($order, 0,1)==="~"){
146
				$order=\intval(\substr($order,1,1));
147
				if(isset($params[$order])){
@@ 147-150 (lines=4) @@
144
			}
145
			if(\substr($order, 0,1)==="~"){
146
				$order=\intval(\substr($order,1,1));
147
				if(isset($params[$order])){
148
					$result=\array_merge($result,\array_diff(\explode("/", $params[$order]),[""]));
149
					break;
150
				}
151
			}
152
			$result[]=self::cleanParam($params[$order]);
153
			unset($params[$order]);