Code Duplication    Length = 4-5 lines in 2 locations

Ubiquity/controllers/Router.php 2 locations

@@ 153-157 (lines=5) @@
150
		$paramsOrder=$routeArray["details"]["parameters"];
151
		$index=0;
152
		foreach ( $paramsOrder as $order ) {
153
			if($order==="*"){
154
				if(isset($params[$index]))
155
					$result=\array_merge($result,\array_diff(\explode("/", $params[$index]),[""]));
156
				break;
157
			}
158
			if(\substr($order, 0,1)==="~"){
159
				$order=\intval(\substr($order,1,1));
160
				if(isset($params[$order])){
@@ 160-163 (lines=4) @@
157
			}
158
			if(\substr($order, 0,1)==="~"){
159
				$order=\intval(\substr($order,1,1));
160
				if(isset($params[$order])){
161
					$result=\array_merge($result,\array_diff(\explode("/", $params[$order]),[""]));
162
					break;
163
				}
164
			}
165
			$result[]=self::cleanParam($params[$order]);
166
			unset($params[$order]);