/**
 * Generic method to preprocess a URL
 *
 * @param   array  $query  An associative array of URL arguments
 *
 * @return  array  The URL arguments to use to assemble the subsequent URL.
 *
 * @since   3.5
 */
public function preprocess($query)
{
    // Process the parsed variables based on custom defined rules
    foreach ($this->rules as $rule) {
        $rule->preprocess($query);
    }
    return $query;
}