<commit_before>HalGuzzleResponse
=================

[Guzzle](https://github.com/guzzle/guzzle) event subscriber to decorate
responses to provide Hal resources.

If you register the listener it will decorate the responses from Guzzle
giving them a `hal` method. This will return a [Nocarrier\Hal](https://github.com/blongden/hal)
resource created from the response body.

## Installation

Require the extension:

```
$ composer require rmiller/hal-guzzle-response:dev-master
```

## Usage

Attach the listener:

```php
$client = new GuzzleHttp\Client();
$emitter = $client->getEmitter();
$subscriber = new RMiller\HalGuzzleResponse();
$emitter->attach($subscriber);
```

Get the Hal resource from the response:

```php
$response = $client->get($url);
$hal = $response->hal(); //Nocarrier\Hal<commit_msg>Update version in README<commit_after>HalGuzzleResponse
=================

[Guzzle](https://github.com/guzzle/guzzle) event subscriber to decorate
responses to provide Hal resources.

If you register the listener it will decorate the responses from Guzzle
giving them a `hal` method. This will return a [Nocarrier\Hal](https://github.com/blongden/hal)
resource created from the response body.

## Installation

Require the extension:

```
$ composer require rmiller/hal-guzzle-response:~0.1
```

## Usage

Attach the listener:

```php
$client = new GuzzleHttp\Client();
$emitter = $client->getEmitter();
$subscriber = new RMiller\HalGuzzleResponse();
$emitter->attach($subscriber);
```

Get the Hal resource from the response:

```php
$response = $client->get($url);
$hal = $response->hal(); //Nocarrier\Hal
{'fraction_non_alphanumeric': 0.15102548166563082, 'fraction_numerical': 0.001243008079552517, 'mean_word_length': 5.544715447154472, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7599737', 'n_tokens_mistral': 520, 'n_tokens_neox': 477, 'n_words': 148}