thephpleague/url — pull request #49 by dennisbirkholz (2014-12-31 13:52:32+00:00)
Title: Let return all set method $this to allow a fluent use of the interface

Hi Ignace,

I would like you to consider my PR to implement a fluent interface for all setter methods.
I changed it mainly to later query parts.

With the current version, you always have to store the query-object to alter it:
```php
$url = \League\Url\UrlImmutable::createFromServer($_SERVER);
$query = $url->getQuery();
$query->set(['page' => 123]);
$newurl = $url->setQuery($query);
```

The fluent interface would allow to alter the query string in a single line:
```php
$url = \League\Url\UrlImmutable::createFromServer($_SERVER);
$newurl = $url->setQuery($url->getQuery()->set(['page' => $page]));
```

Thanks for considering!
Greets,
Dennis