/**
* Process the parsed router variables based on custom defined rules
*
* @param \Joomla\CMS\Uri\Uri &$uri The URI to parse
* @param string $stage The stage that should be processed.
* Possible values: 'preprocess', 'postprocess'
* and '' for the main parse stage
*
* @return void
*
* @since 3.2
*/
protected function processParseRules(&$uri, $stage = self::PROCESS_DURING)
{
if (!\array_key_exists('parse' . $stage, $this->rules)) {
throw new \InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__));
}
foreach ($this->rules['parse' . $stage] as $rule) {
$rule($this, $uri);
}
}