	public static function sortByPriority( $parameters ) {
		if ( !is_array( $parameters ) ) {
			throw new \MWException( __METHOD__ . ': A non-array was passed.' );
		}
		//'category' to get category headings first for ordermethod.
		//'include'/'includepage' to make sure section labels are ready for 'table'.
		$priority = [
			'distinct'			=> 1,
			'openreferences'	=> 2,
			'ignorecase'		=> 3,
			'category'			=> 4,
			'title'				=> 5,
			'goal'				=> 6,
			'ordercollation'	=> 7,
			'ordermethod'		=> 8,
			'includepage'		=> 9,
			'include'			=> 10
		];

		$_first = [];
		foreach ( $priority as $parameter => $order ) {
			if ( isset( $parameters[$parameter] ) ) {
				$_first[$parameter] = $parameters[$parameter];
				unset( $parameters[$parameter] );
			}
		}

		$parameters = $_first + $parameters;

		return $parameters;
	}
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.