/** * {@inheritdoc} */ public function __toString() { $value = parent::__toString(); // according to http://tools.ietf.org/html/rfc3986#section-3.5 $rawSymbols = array('/', '?', '-', '.', '_', '~', '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=', ':', '@'); $encodedSymbols = array_map(function ($symbol) { return urlencode($symbol); }, $rawSymbols); return str_replace($encodedSymbols, $rawSymbols, rawurlencode($value)); }
/** * {@inheritdoc} */ public function __toString() { $value = parent::__toString(); return rawurlencode($value); }