Пример #1
0
 /**
  * {@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));
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function __toString()
 {
     $value = parent::__toString();
     return rawurlencode($value);
 }