thephpleague/url — pull request #10 by nyamsprod (2014-06-01 19:17:46+00:00)
Title: Update to version 3

## Immutable Value Object
`League\Url\Url` is now a Immutable Value Object. This means that any change made to the object will return a new object with the changed property and will leave the original object unchanged.

```php
use League\Url\Factory as Url;
$original_url = Url::createFromString('http://www.example.com');
$modified_url = $original_url->setQuery(array('foo' => 'bar'));
echo $original_url; // output http://www.example.com/
echo $modified_url; // output http://www.example.com/?foo=bar
```
Prior to version 3, some url component properties where returned as string and other as object. Now all component property are returned:
* as object that implement a common Interface which includes the `__toString` method;
* as cloned from the internal property to avoid breaking the `League\Url\Url` Immutable state;

```php
use League\Url\Factory as Url;
$original_url = Url::createFromString('http://www.example.com');
$host = $original_url->getHost();
$host->remove('www');
$host->prepend('test');
echo $original_url; // output http://www.example.com/
echo $host; // output test.example.com
```
Url parsing has been improved as well as `League\Url\Url::__toString()` methods.