kriswallsmith/Buzz — pull request #137 by rybakit (2013-09-16 10:37:30+00:00)
Title: [POC] Introduce ListenerAwareClient and simpify Browser class (BC break)

I've also removed `Browser::getLastRequest()`, `Browser::getLastResponse()`. For those who need this functionality use the listener, e.g.:

```php
$client = new Curl();
$client = new ListenerAwareClient($curl);
$client->addListener(new CallbackListener(function ($request, $response = null) {
if ($response) {
// do something with `$request` and `$response`
})
);

$browser = new Browser($client);
$browser->call(...);
```
or
```php
$client = new Curl();
$client->addListener($listener = new LastMessageListener());

$browser = new Browser($client);
$browser->call(...);

$lastRequest = $listener->getLastRequest();
$lastResponse = $listener->getLastResponse();
```

TODO

- [ ] Add tests