private function formTarget(IUri $uri) { $target = $uri->getPath(); if ($query = $uri->getQuery()) { $target .= '?' . $query; } return $target; }