library/QATools/QATools/PageObject/Url/Builder.php
protected function unmaskUrl($url, array $params)
	{
		if ( !preg_match_all('/\{([^{}]+)\}/', $url, $matches) ) {
			return array($url, $params);
		}

		$url_masks = array_unique($matches[0]);
		$parameter_names = array_unique($matches[1]);
		$mask_replacements = array();
		$missing_parameters = array();

		foreach ( $parameter_names as $parameter_name ) {
			if ( !array_key_exists($parameter_name, $params) ) {
				$missing_parameters[] = $parameter_name;
				continue;
			}

			$mask_replacements[] = rawurlencode($params[$parameter_name]);
			unset($params[$parameter_name]);
		}

		if ( $missing_parameters ) {
			throw new MissingParametersException($missing_parameters);
		}

		return array(str_replace($url_masks, $mask_replacements, $url), $params);
	}
protected function unmaskUrl($url, array $params)
	{
		if ( !preg_match_all('/\{([^{}]+)\}/', $url, $matches) ) {
			return array($url, $params);
		}

		$url_masks = array_unique($matches[0]);
		$parameter_names = array_unique($matches[1]);
		$mask_replacements = array();
		$missing_parameters = array();

		foreach ( $parameter_names as $parameter_name ) {
			if ( !array_key_exists($parameter_name, $params) ) {
				$missing_parameters[] = $parameter_name;
				continue;
			}

			$mask_replacements[] = rawurlencode($params[$parameter_name]);
			unset($params[$parameter_name]);
		}

		if ( $missing_parameters ) {
			throw new MissingParametersException($missing_parameters);
		}

		return array(str_replace($url_masks, $mask_replacements, $url), $params);
	}
protected function unmaskUrl ( $ url , array $ params ) { if ( ! preg_match_all ( '/\{([^{}]+)\}/' , $ url , $ matches ) ) { return array ( $ url , $ params ) ; } $ url_masks = array_unique ( $ matches [ 0 ] ) ; $ parameter_names = array_unique ( $ matches [ 1 ] ) ; $ mask_replacements = array ( ) ; $ missing_parameters = array ( ) ; foreach ( $ parameter_names as $ parameter_name ) { if ( ! array_key_exists ( $ parameter_name , $ params ) ) { $ missing_parameters [ ] = $ parameter_name ; continue ; } $ mask_replacements [ ] = rawurlencode ( $ params [ $ parameter_name ] ) ; unset ( $ params [ $ parameter_name ] ) ; } if ( $ missing_parameters ) { throw new MissingParametersException ( $ missing_parameters ) ; } return array ( str_replace ( $ url_masks , $ mask_replacements , $ url ) , $ params ) ; }
Unmasks a URL and replaces masks with a parameter value.

@param string $url    URL to be unmasked.
@param array  $params Params holding values for masks.

@return array Returns an array of 0 => unmasked url and 1 => parameters.
@throws MissingParametersException Thrown if a mask was found in $url which does not exist in $params.
Unmasks a URL and replaces masks with a parameter value .